Datasources: Enable native histograms for datasource response size metric (#87962)

This commit is contained in:
Marcus Efraimsson 2024-05-16 13:48:51 +02:00 committed by GitHub
parent c46c0c9eb9
commit 961272a76d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View File

@ -7,6 +7,7 @@
command: >
--enable-feature=remote-write-receiver
--enable-feature=exemplar-storage
--enable-feature=native-histograms
--config.file=/etc/prometheus/prometheus.yml
--storage.tsdb.path=/prometheus
volumes:

View File

@ -4,6 +4,7 @@ global:
scrape_configs:
- job_name: grafana
scrape_classic_histograms: true
static_configs:
- targets:
- host.docker.internal:3000

View File

@ -3,6 +3,7 @@ package httpclientprovider
import (
"net/http"
"strconv"
"time"
sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
"github.com/grafana/grafana/pkg/infra/httpclient"
@ -37,6 +38,9 @@ var (
Name: "datasource_response_size_bytes",
Help: "histogram of data source response sizes returned to Grafana",
Buckets: []float64{128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576},
NativeHistogramBucketFactor: 1.1,
NativeHistogramMaxBucketNumber: 100,
NativeHistogramMinResetDuration: time.Hour,
}, []string{"datasource", "datasource_type", "secure_socks_ds_proxy_enabled"},
)