Ok, so:
What’s (probably) happening rn?
expression
{env=“Production”}
will return all the series that have the label env
set to Production. From your git, it seems that there’s only one metric with such a label - target_info

Notice that not all the metrics must have the same set of labels, which most probably is your case - metric http_server_request_duration_seconds_count
most probably does not have env
label at all.
It is strange though because if I type {env="Production"}
it finds both the label, and all three of its values.
Yes, it does because the metric target_info
does provide this label and the three values but it doesn’t mean http_server_request_duration_seconds_count
metric will have such a label.
I’m not sure I explain it well enough, so here’s another example:
Let’s say you have two applications - a Java one and a C one. In Java you might have a metric application_memory_usage
. Since Java has quite different memory management than C, Java devs might have put label type
in the application_memory_usage
metric. So from Java application you will be reporting two series application_memory_usage{application="my_awesome_java_app", type="heap"}
and application_memory_usage{application="my_awesome_java_app", type="off-heap"}
. Whereas, in C there’s no such thing as heap or off-heap memory (at least I hope so, I almost failed that subject
), so there’s no reason to put type
label and C application will only expose application_memory_usage{application="my_awesome_c_app"}
metric.
What would happen when you type in application_memory_usage{application="my_awesome_c_app", type="heap"}
in the query window. Prometheus would want to find all metrics of name applciation_memory_usage
from my_awesome_c_app
with memory used of type heap
. But there’s no such thing! Hence, empty result.
The same thing is happening to you rn. There’s a metric http_server_request_duration_seconds_count
but it doesn’t have env
label, so Prometheus won’t find any match. It’s like saying you need a computer that is both Mac
and produced by HP
. You can ask for one, but there’s none.
Why is it happening?
AFAIK Otel collectors push relevant resource information in target_info
metric (I’m not using that so I’m not sure) to limit the number of labels in other metrics (in your instance http_server_request_duration_seconds_count
.
How can I fix it?
Can you type in explore both of the following queries (exactly like that, nothing more
):
target_info{env="Production"}
http_server_request_duration_seconds_count
And copy the result labels?

You can join one query with another to get the desired result but to help I need to know what are available labels on both sides (there should be one that is common for them). You should blur the values that are sensitive (e.g. some IPs etc.) but don’t blur out the names of the labels, they are important (also if the common value is sensitive, you can blur the value but please tell which label has the same value for both results).
Alternatively you probably could go into otel collector config and play around with adding env
label to the metrics - this might be better idea if you have access for that (unfortunatelly, I’m not quite sure how to do that myself).