Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type Config struct {
DisablePormetheus bool `envconfig:"DISABLE_PROMETHEUS" default:"false"`
// Enables grpc request histograms in prometheus reporting
EnablePrometheusGRPCHistogram bool `envconfig:"ENABLE_PROMETHEUS_GRPC_HISTOGRAM" default:"true"`
// PrometheusGRPCHistogramBuckets specifies custom histogram buckets for gRPC request latency metrics
// Format: comma-separated float values in seconds (e.g., "0.005,0.01,0.025,0.05,0.1,0.25,0.5,1,2.5,5,10")
// If empty, uses the default buckets from go-grpc-prometheus
PrometheusGRPCHistogramBuckets []float64 `envconfig:"PROMETHEUS_GRPC_HISTOGRAM_BUCKETS" default:""`
Comment on lines +31 to +34
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config/README.md is gomarkdoc-generated from config/config.go and currently doesn’t include the newly added PrometheusGRPCHistogramBuckets field. Please regenerate/update the generated docs so the public configuration documentation matches the code.

Copilot uses AI. Check for mistakes.
// The License key for NewRelic metrics reporting
NewRelicLicenseKey string `envconfig:"NEW_RELIC_LICENSE_KEY" default:""`
// When set to true, disables all NewRelic reporting
Expand Down
6 changes: 5 additions & 1 deletion core.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ func (c *cb) processConfig() {
startSignalHandler(c, dur)
}
if c.config.EnablePrometheusGRPCHistogram {
grpc_prometheus.EnableHandlingTimeHistogram()
if len(c.config.PrometheusGRPCHistogramBuckets) > 0 {
grpc_prometheus.EnableHandlingTimeHistogram(grpc_prometheus.WithHistogramBuckets(c.config.PrometheusGRPCHistogramBuckets))
} else {
grpc_prometheus.EnableHandlingTimeHistogram()
}
}

// Setup OpenTelemetry - custom OTLP takes precedence over New Relic
Expand Down
Loading