Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e4e42fcd
Commit
e4e42fcd
authored
Feb 11, 2019
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds edition to build_info metric
parent
13f21fff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pkg/metrics/metrics.go
+9
-2
No files found.
pkg/metrics/metrics.go
View file @
e4e42fcd
...
...
@@ -3,6 +3,8 @@ package metrics
import
(
"runtime"
"github.com/grafana/grafana/pkg/setting"
"github.com/prometheus/client_golang/prometheus"
)
...
...
@@ -282,7 +284,7 @@ func init() {
Name
:
"build_info"
,
Help
:
"A metric with a constant '1' value labeled by version, revision, branch, and goversion from which Grafana was built."
,
Namespace
:
exporterName
,
},
[]
string
{
"version"
,
"revision"
,
"branch"
,
"goversion"
})
},
[]
string
{
"version"
,
"revision"
,
"branch"
,
"goversion"
,
"edition"
})
}
// SetBuildInformation sets the build information for this binary
...
...
@@ -291,8 +293,13 @@ func SetBuildInformation(version, revision, branch string) {
// Once this have been released for some time we should be able to remote `M_Grafana_Version`
// The reason we added a new one is that its common practice in the prometheus community
// to name this metric `*_build_info` so its easy to do aggregation on all programs.
edition
:=
"oss"
if
setting
.
IsEnterprise
{
edition
=
"enterprise"
}
M_Grafana_Version
.
WithLabelValues
(
version
)
.
Set
(
1
)
grafanaBuildVersion
.
WithLabelValues
(
version
,
revision
,
branch
,
runtime
.
Version
())
.
Set
(
1
)
grafanaBuildVersion
.
WithLabelValues
(
version
,
revision
,
branch
,
runtime
.
Version
()
,
edition
)
.
Set
(
1
)
}
func
initMetricVars
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment