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
Model registry
Operate
Environments
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
thirdparty
rsyslog-exporter
Commits
c714c2fe
Commit
c714c2fe
authored
7 years ago
by
Matthias Rampke
Browse files
Options
Downloads
Patches
Plain Diff
Use per-type label names
avoid the generic "name" label. Breaks all time series.
parent
65d9e1b7
Branches
Branches containing commit
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 @
c714c2fe
...
...
@@ -31,6 +31,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Value
:
a
.
Processed
,
Description
:
"messages processed"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
}
...
...
@@ -39,6 +40,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Value
:
a
.
Failed
,
Description
:
"messages failed"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
}
...
...
@@ -47,6 +49,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Value
:
a
.
Suspended
,
Description
:
"times suspended"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
}
...
...
@@ -55,6 +58,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Value
:
a
.
SuspendedDuration
,
Description
:
"time spent suspended"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
}
...
...
@@ -63,6 +67,7 @@ func (a *action) toPoints() []*point {
Type
:
counter
,
Value
:
a
.
Resumed
,
Description
:
"times resumed"
,
LabelName
:
"action"
,
LabelValue
:
a
.
Name
,
}
...
...
This diff is collapsed.
Click to expand it.
inputs.go
+
1
−
0
View file @
c714c2fe
...
...
@@ -27,6 +27,7 @@ func (i *input) toPoints() []*point {
Type
:
counter
,
Value
:
i
.
Submitted
,
Description
:
"messages submitted"
,
LabelName
:
"input"
,
LabelValue
:
i
.
Name
,
}
...
...
This diff is collapsed.
Click to expand it.
point.go
+
6
−
1
View file @
c714c2fe
...
...
@@ -24,6 +24,7 @@ type point struct {
Description
string
Type
pointType
Value
int64
LabelName
string
LabelValue
string
}
...
...
@@ -31,7 +32,7 @@ func (p *point) promDescription() *prometheus.Desc {
return
prometheus
.
NewDesc
(
prometheus
.
BuildFQName
(
""
,
"rsyslog"
,
p
.
Name
),
p
.
Description
,
[]
string
{
"n
ame
"
},
[]
string
{
p
.
promLabelN
ame
()
},
nil
,
)
}
...
...
@@ -51,6 +52,10 @@ func (p *point) promLabelValue() string {
return
p
.
LabelValue
}
func
(
p
*
point
)
promLabelName
()
string
{
return
p
.
LabelName
}
func
(
p
*
point
)
key
()
string
{
return
fmt
.
Sprintf
(
"%s.%s"
,
p
.
Name
,
p
.
LabelValue
)
}
This diff is collapsed.
Click to expand it.
queues.go
+
6
−
0
View file @
c714c2fe
...
...
@@ -32,6 +32,7 @@ func (q *queue) toPoints() []*point {
Type
:
gauge
,
Value
:
q
.
Size
,
Description
:
"messages currently in queue"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
}
...
...
@@ -40,6 +41,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Value
:
q
.
Enqueued
,
Description
:
"total messages enqueued"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
}
...
...
@@ -48,6 +50,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Value
:
q
.
Full
,
Description
:
"times queue was full"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
}
...
...
@@ -56,6 +59,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Value
:
q
.
DiscardedFull
,
Description
:
"messages discarded due to queue being full"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
}
...
...
@@ -64,6 +68,7 @@ func (q *queue) toPoints() []*point {
Type
:
counter
,
Value
:
q
.
DiscardedNf
,
Description
:
"messages discarded when queue not full"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
}
...
...
@@ -72,6 +77,7 @@ func (q *queue) toPoints() []*point {
Type
:
gauge
,
Value
:
q
.
MaxQsize
,
Description
:
"maximum size queue has reached"
,
LabelName
:
"queue"
,
LabelValue
:
q
.
Name
,
}
...
...
This diff is collapsed.
Click to expand it.
resources.go
+
9
−
0
View file @
c714c2fe
...
...
@@ -35,6 +35,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Utime
,
Description
:
"user time used in microseconds"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -43,6 +44,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Stime
,
Description
:
"system time used in microsends"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -51,6 +53,7 @@ func (r *resource) toPoints() []*point {
Type
:
gauge
,
Value
:
r
.
Maxrss
,
Description
:
"maximum resident set size"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -59,6 +62,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Minflt
,
Description
:
"total minor faults"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -67,6 +71,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Majflt
,
Description
:
"total major faults"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -75,6 +80,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Inblock
,
Description
:
"filesystem input operations"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -83,6 +89,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Outblock
,
Description
:
"filesystem output operations"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -91,6 +98,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Nvcsw
,
Description
:
"voluntary context switches"
,
LabelName
:
"resource"
,
LabelValue
:
r
.
Name
,
}
...
...
@@ -99,6 +107,7 @@ func (r *resource) toPoints() []*point {
Type
:
counter
,
Value
:
r
.
Nivcsw
,
Description
:
"involuntary context switches"
,
LabelName
:
"resource"
,
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