Customize internal metrics eg get http codes for each datasource

this is one of the metrics we can get:

http_request_total{handler="/datasources/proxy/:id/*",method="get",statuscode="200"}

Is it possible to get:

http_request_total{handler="/datasources/proxy/:id/123",method="get",statuscode="200"}
http_request_total{handler="/datasources/proxy/:id/456",method="get",statuscode="200"}

etc?

Not without changing the code for reporting metrics. You should open a feature request on GitHub.

1 Like

Thanks for the quick reply. I did submit an enhancement request: https://github.com/grafana/grafana/issues/16828 :slight_smile:
We are also trying to use the API (passing the datasource IDs), but not getting the status codes returned that we expect. Not sure if this is a valid work-around…