Skip to content
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

feat(pyroscope.receive_http): ensure consistent service_name label handling #2675

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

marcsanmi
Copy link
Contributor

PR Description

This PR ensures that pyroscope.receive_http component sets the service_name label consistently from __name__ to match Pyroscope's behavior. When service_name already exists, it sets app_name from __name__ instead.

Which issue(s) this PR fixes

Notes to the Reviewer

I decided to duplicate the service name logic in Alloy rather than create a shared abstraction because:

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@marcsanmi marcsanmi requested review from a team as code owners February 10, 2025 15:28
@marcsanmi marcsanmi force-pushed the marcsanmi/ensure-service-name branch from 41cc8f2 to 94f25b0 Compare February 10, 2025 15:32
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure if that is fully "consistent" with at least my expectations.

I mix both types of APIs (pushv1/ingest). Now I have a relabel rule modifying service_name to e.g. let's say append -grafana-labs.

Now pyroscope.write will still use the old value in __name__ to write the name for the /ingest request.

I think maybe it is better if we "rename" the __name__ to service_name and then just before sending we "rename" it back

@marcsanmi marcsanmi requested a review from simonswine February 11, 2025 15:21
@marcsanmi marcsanmi force-pushed the marcsanmi/ensure-service-name branch from 95d5fa4 to 148c298 Compare February 11, 2025 15:29
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this. LGTM

@marcsanmi marcsanmi changed the title feat(pyroscope.receive_http): ensure service_name label is set feat(pyroscope.receive_http): ensure consistent service_name label handling Feb 12, 2025
@marcsanmi marcsanmi merged commit c135dd8 into main Feb 12, 2025
30 checks passed
@marcsanmi marcsanmi deleted the marcsanmi/ensure-service-name branch February 12, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants