-
Notifications
You must be signed in to change notification settings - Fork 103
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
set service_name label for podLogs #1175
Merged
Merged
+2,659
−57
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
petewall
approved these changes
Jan 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Run make build
inside charts/k8s-monitoring
to update the generated files.
petewall
approved these changes
Jan 28, 2025
rlankfo
changed the title
add podLogs to otlp-gateway test
set service_name label for podLogs
Jan 29, 2025
rlankfo
changed the title
set service_name label for podLogs
WIP: set service_name label for podLogs
Jan 29, 2025
bentonam
reviewed
Jan 29, 2025
charts/k8s-monitoring/charts/feature-pod-logs/templates/_common_pod_discovery.alloy.tpl
Outdated
Show resolved
Hide resolved
rlankfo
commented
Jan 29, 2025
rlankfo
force-pushed
the
rlankfo/otlp-gateway-logs-service-name
branch
from
January 29, 2025 22:08
2f134cb
to
6dc7369
Compare
rlankfo
force-pushed
the
rlankfo/otlp-gateway-logs-service-name
branch
3 times, most recently
from
January 30, 2025 23:30
de5ea21
to
f248799
Compare
rlankfo
commented
Jan 30, 2025
charts/k8s-monitoring/charts/feature-pod-logs/templates/_common_pod_discovery.alloy.tpl
Show resolved
Hide resolved
rlankfo
changed the title
WIP: set service_name label for podLogs
set service_name label for podLogs
Jan 30, 2025
Signed-off-by: Robbie Lankford <robert.lankford@grafana.com>
rlankfo
force-pushed
the
rlankfo/otlp-gateway-logs-service-name
branch
from
January 30, 2025 23:59
f248799
to
310a260
Compare
petewall
approved these changes
Jan 31, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR sets
service_name
,service_namespace
,deployment_environment
, anddeployment_environment_name
labels on Loki pod logs. This works when sent to loki destinations. I'll follow this PR up with updates for pod logs sent to OTLP destinations.The labels are set according to the following rules:
service_name
label set by taking the first non-empty value from these Kubernetes metadata fields (in order): the pod annotationresource.opentelemetry.io/service.name
, the pod labelapp.kubernetes.io/name
, the pod’s name, or the container’s name.service_namespace
set byresource.opentelemetry.io/service.namespace
pod annotation.deployment_environment
set byresource.opentelemetry.io/deployment.environment
pod annotation.deployment_environment_name
set byresource.opentelemetry.io/deployment.environment.name
pod annotation.If not set, Loki will attempt to set a default value according to these rules: https://grafana.com/docs/loki/latest/get-started/labels/#default-labels-for-all-users