Commit 99df7b87 by Torkel Ödegaard

Merge branch 'master' of github.com:grafana/grafana

parents b93cdf56 6d11999e
...@@ -3,6 +3,8 @@ package metrics ...@@ -3,6 +3,8 @@ package metrics
import ( import (
"runtime" "runtime"
"github.com/grafana/grafana/pkg/setting"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
...@@ -282,7 +284,7 @@ func init() { ...@@ -282,7 +284,7 @@ func init() {
Name: "build_info", Name: "build_info",
Help: "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which Grafana was built.", Help: "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which Grafana was built.",
Namespace: exporterName, Namespace: exporterName,
}, []string{"version", "revision", "branch", "goversion"}) }, []string{"version", "revision", "branch", "goversion", "edition"})
} }
// SetBuildInformation sets the build information for this binary // SetBuildInformation sets the build information for this binary
...@@ -291,8 +293,13 @@ func SetBuildInformation(version, revision, branch string) { ...@@ -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` // 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 // 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. // 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) 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() { func initMetricVars() {
......
...@@ -935,16 +935,7 @@ ...@@ -935,16 +935,7 @@
} }
}, },
values: [ values: [
{
value: 50,
color: "lightgreen"
}, {
value: 80,
color: "yellow"
}, {
value: 100,
color: "red"
}
] ]
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment