I have Calculated service metric.
This metric have filter by Service Display name
when I use a request GET /metrics/query via api I don't see data
why is the query GET /metrics/query not returning data ?
as a workaround I added filter by entity type and entity name
we send a metric to an external system and we cannot always know which entities they are limited to.
The restrictions have already been set by the user who created the metric.
I don't quite understand how this api works.
In my understanding, we refer to the unique name of a metric that has limitations.
Why api tries to search all over the environment?
As the documentation says, you must specify at least one of 'type' or 'entityId' when making a query.
It is not required to know in advance the entities. Simply leave it as 'entitySelector=type(SERVICE)' in your query parameters and that should be general enough. Your calculated service metric will only be collected for Service entities anyway.
I hope this helps.
Unfortunately, this is not so
firstly, As the documentation says entitySelector is an optional parameter
secondly, I tried to use only the type parameter - the result is similar that there is no data