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: discovery of name of services emitting the logs #12392

Merged
merged 8 commits into from Mar 29, 2024

Conversation

sandeepsukhani
Copy link
Contributor

@sandeepsukhani sandeepsukhani commented Mar 28, 2024

What this PR does / why we need it:
otel specs recommends having a service name to identify the service emitting the logs. It would be good to adopt that for non-otel logs as well and add a single label to identify all the services to make it easier to discover the services and filter down the logs by service(s). This PR adds required changes to, by default, always have a service_name label if it does not exist.

service_name is defined using existing labels. It picks up values from labels defined in discover_service_name per-tenant config. The default list is configured to map one of the following labels to service_name: service, app, application, container, container_name, app_kubernetes_io_name, component, workload,job. If none of that is defined in the original labels in the stream then the service_name label would be set to value unknown_service.
The discovery of a service name can be disabled by setting the discover_service_name to an empty list.

Checklist

  • Documentation added
  • Tests updated
  • CHANGELOG.md updated

@sandeepsukhani sandeepsukhani requested a review from a team as a code owner March 28, 2024 14:01
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Mar 28, 2024
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

see my comment.

@sandeepsukhani sandeepsukhani merged commit 288c006 into main Mar 29, 2024
11 checks passed
@sandeepsukhani sandeepsukhani deleted the service-name-label branch March 29, 2024 05:40
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants