Skip to content

[chore] fix expected service name for prometheus e2e test #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

bacherfl
Copy link
Contributor

@bacherfl bacherfl commented Feb 21, 2025

The metrics exposed by the collector's self monitoring prometheus endpoint at port 8888 contain a service_name="dynatrace-otel-collector" label, which is used for the resulting resource name.
Previously, apparently the job name from the prometheus config has been used for the service name:

        - job_name: opentelemetry-collector
          scrape_interval: 60s
          static_configs:
            - targets:
                - 127.0.0.1:8888

I'm not 100% sure yet why this has changed with the new upstream release, but my guess is that this is linked to the recent major version upgrade of the prometheus dependency: open-telemetry/opentelemetry-collector-contrib#36873

Update: It seems like since the prometheus version upgrade, the prometheus scrape manager will convert the service_name label provided by the collector self monitoring metrics to service.name, which is then set as a resource attribute by the prometheus receiver, overriding the previous service.name value determined by the job label

@bacherfl bacherfl marked this pull request as ready for review February 21, 2025 06:34
@bacherfl bacherfl requested a review from a team as a code owner February 21, 2025 06:34
@bacherfl bacherfl added the Skip Changelog No changelog entry is needed label Feb 21, 2025
@bacherfl bacherfl merged commit 54b161b into main Feb 21, 2025
21 checks passed
@bacherfl bacherfl deleted the fix/prometheus-test branch February 21, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog No changelog entry is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants