Skip to content

Scrape: do not AppendExemplar for native histogram if ingestion is disabled #16217

@krajorama

Description

@krajorama

What did you do?

I was writing unit test in open-telemetry/opentelemetry-collector-contrib#38652 when I noticed that I get the native histogram exemplars from Prometheus scrape, even if native histograms ingestion is disabled.

Basically AppendExemplar call here

_, exemplarErr := app.AppendExemplar(ref, lset, e)
is missing a guard like this:
if isHistogram && sl.enableNativeHistogramIngestion {
:

isHistogram && sl.enableNativeHistogramIngestion 

What did you expect to see?

Exemplars for native histograms ignored when native histogram ingestion is disabled.

What did you see instead? Under which circumstances?

AppendExemplar called.

System information

No response

Prometheus version

3.0 - 3.3

Prometheus configuration file

none

Alertmanager version


Alertmanager configuration file

Logs


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions