Rate(sum ( metric ))[1m] problem

  • What Grafana version and what operating system are you using?
    version=10.1.4 - deployed inside a docker container

  • What are you trying to achieve?
    Trying to show transactions per minute for the EFT services, with direction=inbound

  • How are you trying to achieve it?
    rate(sum(fs_api_pmnt_duration_seconds_sum{service="EFT", direction="inbound"})[$__rate_interval])

  • What happened?
    it’s showing invalid calculation

The Prometheus metric this is based is defined as follows:

	api_pmnt_duration: prometheus.NewHistogramVec(prometheus.HistogramOpts{ // used to store timed values, includes a count
			Name: "fs_api_pmnt_duration_seconds",
			Help: "Duration of the FS API requests in seconds",
			Buckets: []float64{0.1, 0.5, 1, 5, 10, 100},
		}, []string{"hostname", "msg_type", "service", "participant", "direction", "payment_method", "score"}),