mirror of
https://github.com/grafana/grafana.git
synced 2024-12-26 17:01:09 -06:00
feat(instrumentation): documented instrumentation options, closes #4696
This commit is contained in:
parent
064e474b0a
commit
1059a35bbc
@ -341,11 +341,11 @@ global_session = -1
|
||||
|
||||
#################################### Internal Grafana Metrics ##########################
|
||||
[metrics]
|
||||
enabled = false
|
||||
interval_seconds = 10
|
||||
enabled = true
|
||||
interval_seconds = 60
|
||||
|
||||
[metrics.graphite]
|
||||
address = localhost:2003
|
||||
prefix = prod.grafana.%(instance_name)s.
|
||||
; [metrics.graphite]
|
||||
; address = localhost:2003
|
||||
; prefix = prod.grafana.%(instance_name)s.
|
||||
|
||||
|
||||
|
@ -272,5 +272,17 @@ check_for_updates = true
|
||||
;enabled = false
|
||||
;path = /var/lib/grafana/dashboards
|
||||
|
||||
#################################### Internal Grafana Metrics ##########################
|
||||
[metrics]
|
||||
# Disable / Enable internal metrics
|
||||
;enabled = true
|
||||
|
||||
# Publish interval
|
||||
;interval_seconds = 10
|
||||
|
||||
# Send internal metrics to Graphite
|
||||
; [metrics.graphite]
|
||||
; address = localhost:2003
|
||||
; prefix = prod.grafana.%(instance_name)s.
|
||||
|
||||
|
||||
|
@ -44,6 +44,12 @@ Then you can override them using:
|
||||
|
||||
<hr />
|
||||
|
||||
## instance_name
|
||||
Set the name of the grafana-server instance. Used in logging and internal metrics and in
|
||||
clustering info. Defaults to: `${HOSTNAME}, which will be replaced with
|
||||
environment variable `HOSTNAME`, if that is empty or does not exist Grafana will try to use
|
||||
system calls to get the machine name.
|
||||
|
||||
## [paths]
|
||||
|
||||
### data
|
||||
@ -439,3 +445,22 @@ Grafana backend index those json dashboards which will make them appear in regul
|
||||
|
||||
### path
|
||||
The full path to a directory containing your json dashboards.
|
||||
|
||||
## [metrics]
|
||||
|
||||
### enabled
|
||||
Enable metrics reporting. defaults true. Available via HTTP API `/api/metrics`.
|
||||
|
||||
### interval_seconds
|
||||
|
||||
Flush/Write interval when sending metrics to external TSDB. Defaults to 60s.
|
||||
|
||||
## [metrics.graphite]
|
||||
Include this section if you want to send internal Grafana metrics to Graphite.
|
||||
|
||||
### address
|
||||
Format `<Hostname or ip>`:port
|
||||
|
||||
### prefix
|
||||
Graphite metric prefix. Defaults to `prod.grafana.%(instance_name)s.`
|
||||
|
||||
|
@ -39,8 +39,11 @@ func instrumentationLoop(settings *MetricSettings) chan struct{} {
|
||||
}
|
||||
|
||||
func sendMetrics(settings *MetricSettings) {
|
||||
metrics := MetricStats.GetSnapshots()
|
||||
if len(settings.Publishers) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
metrics := MetricStats.GetSnapshots()
|
||||
for _, publisher := range settings.Publishers {
|
||||
publisher.Publish(metrics)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user