echo-contrib icon indicating copy to clipboard operation
echo-contrib copied to clipboard

[prometheus][proposal] custom config for standardMetrics

Open w1mvy opened this issue 3 years ago • 0 comments

Hi, This useful middleware has helped us!

Issue Description

There are cases where we want to overwrite some buckets values. For example, set buckets value of "request_duration_seconds" greather than 10 seconds.

How about defining a config and allowing it to be overridden?

I would like to get your opinion this.

type Config struct {
	OverwriteDefaultMetricsList []OverwriteDefaultMetrics
}

type OverwriteDefaultMetrics struct {
	ID      string    // example "reqDur"
	Buckets []float64 // example []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 20, 40, 80}
}

Checklist

  • [x] Dependencies installed
  • [x] No typos
  • [x] Searched existing issues and docs

Expected behaviour

none

Actual behaviour

none

Steps to reproduce

none

Working code to debug

package main

func main() {
}

Version/commit

w1mvy avatar Oct 14 '22 05:10 w1mvy