How do I increase the bucket size for metrics in Golang SDK? Specifically, I would like to increase the size of the temporal_activity_execution_latency_bucket metric
You can try something like this:
boundaries := []float64{.001, .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 60, 70}
buckets := make([]prometheus.HistogramObjective, 0, len(boundaries))
for _, boundary := range boundaries {
buckets = append(buckets, prometheus.HistogramObjective{Upper: boundary})
}
c, err := client.Dial(client.Options{
MetricsHandler: sdktally.NewMetricsHandler(newPrometheusScope(prometheus.Configuration{
ListenAddress: "0.0.0.0:9091",
TimerType: "histogram",
DefaultHistogramBuckets: buckets,
})),
})
@taonic Wouldn’t this change the default buckets for all the metrics? What if I just want to change the buckets for temporal_activity_execution_latency_bucket metric?
@shubhamu Yes, this is a limitation with Tally in the Go SDK. Please feel free to create a GH issue at GitHub - temporalio/sdk-go: Temporal Go SDK if you have the need to customize buckets per metric.