Add test for Prometheus Receiver to verify timeseries with empty label values are supported #5996
Labels
ci-cd
CI, CD, testing, build issues
comp:prometheus
Prometheus related issues
comp: receiver
Receiver
Is your feature request related to a problem? Please describe.
We want to ensure that the Prometheus receiver supports timeseries with empty label values. According to Prometheus documentation (https://prometheus.io/docs/concepts/data_model/), a label with an empty label value is considered equivalent to a label that does not exist.
Describe the solution you'd like
We propose the following solution:
Add a test that verifies timeseries with empty label values are supported.
The test will create a timeseries with empty label value.
Note that a label with an empty value is considered equivalent to a label that does not exist, i.e. Prometheus receiver should drop the label.
Case 1: Metric data with empty label value and no other label:
Expected Result:
MetricDescriptor
for test_gauge0 should not have “label1” as aLabelKey
.Case 2: Metric with two time-series, one has a value for the label "foo" whereas the other doesn’t:
Expected Result:
LabelKey
metricspb.LabelValue{ Value: “”, HasValue: false}
The corresponding OTLP format of the above case should be:
Additional context
Related to open-telemetry/wg-prometheus#57
CC: @alolita @Aneurysm9
The text was updated successfully, but these errors were encountered: