Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rsyslog-exporter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
silver-platter
rsyslog-exporter
Commits
deaaad36
Commit
deaaad36
authored
7 years ago
by
Matthias Rampke
Committed by
ale
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use per-type label names
avoid the generic "name" label. Breaks all time series.
parent
cd28337a
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
actions.go
+5
-0
5 additions, 0 deletions
actions.go
inputs.go
+1
-0
1 addition, 0 deletions
inputs.go
point.go
+6
-1
6 additions, 1 deletion
point.go
queues.go
+6
-0
6 additions, 0 deletions
queues.go
resources.go
+9
-0
9 additions, 0 deletions
resources.go
with
27 additions
and
1 deletion
actions.go
+
5
−
0
View file @
deaaad36
...
@@ -31,6 +31,7 @@ func (a *action) toPoints() []*point {
...
@@ -31,6 +31,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
a
.
Processed
,
Value
:
a
.
Processed
,
Description
:
"messages processed"
,
Description
:
"messages processed"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
LabelValue
:
a
.
Name
,
}
}
...
@@ -39,6 +40,7 @@ func (a *action) toPoints() []*point {
...
@@ -39,6 +40,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
a
.
Failed
,
Value
:
a
.
Failed
,
Description
:
"messages failed"
,
Description
:
"messages failed"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
LabelValue
:
a
.
Name
,
}
}
...
@@ -47,6 +49,7 @@ func (a *action) toPoints() []*point {
...
@@ -47,6 +49,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
a
.
Suspended
,
Value
:
a
.
Suspended
,
Description
:
"times suspended"
,
Description
:
"times suspended"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
LabelValue
:
a
.
Name
,
}
}
...
@@ -55,6 +58,7 @@ func (a *action) toPoints() []*point {
...
@@ -55,6 +58,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
a
.
SuspendedDuration
,
Value
:
a
.
SuspendedDuration
,
Description
:
"time spent suspended"
,
Description
:
"time spent suspended"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
LabelValue
:
a
.
Name
,
}
}
...
@@ -63,6 +67,7 @@ func (a *action) toPoints() []*point {
...
@@ -63,6 +67,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
a
.
Resumed
,
Value
:
a
.
Resumed
,
Description
:
"times resumed"
,
Description
:
"times resumed"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
LabelValue
:
a
.
Name
,
}
}
...
...
This diff is collapsed.
Click to expand it.
inputs.go
+
1
−
0
View file @
deaaad36
...
@@ -27,6 +27,7 @@ func (i *input) toPoints() []*point {
...
@@ -27,6 +27,7 @@ func (i *input) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
i
.
Submitted
,
Value
:
i
.
Submitted
,
Description
:
"messages submitted"
,
Description
:
"messages submitted"
,
LabelName
:
"input"
,
LabelValue
:
i
.
Name
,
LabelValue
:
i
.
Name
,
}
}
...
...
This diff is collapsed.
Click to expand it.
point.go
+
6
−
1
View file @
deaaad36
...
@@ -24,6 +24,7 @@ type point struct {
...
@@ -24,6 +24,7 @@ type point struct {
Description
string
Description
string
Type
pointType
Type
pointType
Value
int64
Value
int64
LabelName
string
LabelValue
string
LabelValue
string
}
}
...
@@ -31,7 +32,7 @@ func (p *point) promDescription() *prometheus.Desc {
...
@@ -31,7 +32,7 @@ func (p *point) promDescription() *prometheus.Desc {
return
prometheus
.
NewDesc
(
return
prometheus
.
NewDesc
(
prometheus
.
BuildFQName
(
""
,
"rsyslog"
,
p
.
Name
),
prometheus
.
BuildFQName
(
""
,
"rsyslog"
,
p
.
Name
),
p
.
Description
,
p
.
Description
,
[]
string
{
"n
ame
"
},
[]
string
{
p
.
promLabelN
ame
()
},
nil
,
nil
,
)
)
}
}
...
@@ -51,6 +52,10 @@ func (p *point) promLabelValue() string {
...
@@ -51,6 +52,10 @@ func (p *point) promLabelValue() string {
return
p
.
LabelValue
return
p
.
LabelValue
}
}
func
(
p
*
point
)
promLabelName
()
string
{
return
p
.
LabelName
}
func
(
p
*
point
)
key
()
string
{
func
(
p
*
point
)
key
()
string
{
return
fmt
.
Sprintf
(
"%s.%s"
,
p
.
Name
,
p
.
LabelValue
)
return
fmt
.
Sprintf
(
"%s.%s"
,
p
.
Name
,
p
.
LabelValue
)
}
}
This diff is collapsed.
Click to expand it.
queues.go
+
6
−
0
View file @
deaaad36
...
@@ -32,6 +32,7 @@ func (q *queue) toPoints() []*point {
...
@@ -32,6 +32,7 @@ func (q *queue) toPoints() []*point {
Type
:
gauge
,
Type
:
gauge
,
Value
:
q
.
Size
,
Value
:
q
.
Size
,
Description
:
"messages currently in queue"
,
Description
:
"messages currently in queue"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
LabelValue
:
q
.
Name
,
}
}
...
@@ -40,6 +41,7 @@ func (q *queue) toPoints() []*point {
...
@@ -40,6 +41,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
q
.
Enqueued
,
Value
:
q
.
Enqueued
,
Description
:
"total messages enqueued"
,
Description
:
"total messages enqueued"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
LabelValue
:
q
.
Name
,
}
}
...
@@ -48,6 +50,7 @@ func (q *queue) toPoints() []*point {
...
@@ -48,6 +50,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
q
.
Full
,
Value
:
q
.
Full
,
Description
:
"times queue was full"
,
Description
:
"times queue was full"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
LabelValue
:
q
.
Name
,
}
}
...
@@ -56,6 +59,7 @@ func (q *queue) toPoints() []*point {
...
@@ -56,6 +59,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
q
.
DiscardedFull
,
Value
:
q
.
DiscardedFull
,
Description
:
"messages discarded due to queue being full"
,
Description
:
"messages discarded due to queue being full"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
LabelValue
:
q
.
Name
,
}
}
...
@@ -64,6 +68,7 @@ func (q *queue) toPoints() []*point {
...
@@ -64,6 +68,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
q
.
DiscardedNf
,
Value
:
q
.
DiscardedNf
,
Description
:
"messages discarded when queue not full"
,
Description
:
"messages discarded when queue not full"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
LabelValue
:
q
.
Name
,
}
}
...
@@ -72,6 +77,7 @@ func (q *queue) toPoints() []*point {
...
@@ -72,6 +77,7 @@ func (q *queue) toPoints() []*point {
Type
:
gauge
,
Type
:
gauge
,
Value
:
q
.
MaxQsize
,
Value
:
q
.
MaxQsize
,
Description
:
"maximum size queue has reached"
,
Description
:
"maximum size queue has reached"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
LabelValue
:
q
.
Name
,
}
}
...
...
This diff is collapsed.
Click to expand it.
resources.go
+
9
−
0
View file @
deaaad36
...
@@ -35,6 +35,7 @@ func (r *resource) toPoints() []*point {
...
@@ -35,6 +35,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Utime
,
Value
:
r
.
Utime
,
Description
:
"user time used in microseconds"
,
Description
:
"user time used in microseconds"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -43,6 +44,7 @@ func (r *resource) toPoints() []*point {
...
@@ -43,6 +44,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Stime
,
Value
:
r
.
Stime
,
Description
:
"system time used in microsends"
,
Description
:
"system time used in microsends"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -51,6 +53,7 @@ func (r *resource) toPoints() []*point {
...
@@ -51,6 +53,7 @@ func (r *resource) toPoints() []*point {
Type
:
gauge
,
Type
:
gauge
,
Value
:
r
.
Maxrss
,
Value
:
r
.
Maxrss
,
Description
:
"maximum resident set size"
,
Description
:
"maximum resident set size"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -59,6 +62,7 @@ func (r *resource) toPoints() []*point {
...
@@ -59,6 +62,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Minflt
,
Value
:
r
.
Minflt
,
Description
:
"total minor faults"
,
Description
:
"total minor faults"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -67,6 +71,7 @@ func (r *resource) toPoints() []*point {
...
@@ -67,6 +71,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Majflt
,
Value
:
r
.
Majflt
,
Description
:
"total major faults"
,
Description
:
"total major faults"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -75,6 +80,7 @@ func (r *resource) toPoints() []*point {
...
@@ -75,6 +80,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Inblock
,
Value
:
r
.
Inblock
,
Description
:
"filesystem input operations"
,
Description
:
"filesystem input operations"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -83,6 +89,7 @@ func (r *resource) toPoints() []*point {
...
@@ -83,6 +89,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Outblock
,
Value
:
r
.
Outblock
,
Description
:
"filesystem output operations"
,
Description
:
"filesystem output operations"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -91,6 +98,7 @@ func (r *resource) toPoints() []*point {
...
@@ -91,6 +98,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Nvcsw
,
Value
:
r
.
Nvcsw
,
Description
:
"voluntary context switches"
,
Description
:
"voluntary context switches"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
@@ -99,6 +107,7 @@ func (r *resource) toPoints() []*point {
...
@@ -99,6 +107,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Type
:
counter
,
Value
:
r
.
Nivcsw
,
Value
:
r
.
Nivcsw
,
Description
:
"involuntary context switches"
,
Description
:
"involuntary context switches"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
LabelValue
:
r
.
Name
,
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment