fix(opentelemetry): add resource attributes for application and environment in log transformation

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-04-21 17:20:39 +08:00
parent 473f5cea54
commit c08ddf7f76

View File

@ -43,6 +43,14 @@ spec:
# - k8s.deployment.uid # - k8s.deployment.uid
# - k8s.namespace.name # - k8s.namespace.name
# - k8s.node.name # - k8s.node.name
# resource:
# attributes:
# - action: upsert
# key: application
# from_attribute: context.app
# - action: upsert
# key: environment
# from_attribute: context.env
transform: transform:
log_statements: log_statements:
- context: log - context: log
@ -50,7 +58,6 @@ spec:
- set(log.body["kubernetes"], log.attributes["kubernetes"]) - set(log.body["kubernetes"], log.attributes["kubernetes"])
- set(resource.attributes["application"], log.attributes["context"]["app"]) - set(resource.attributes["application"], log.attributes["context"]["app"])
- set(resource.attributes["environment"], log.attributes["context"]["env"]) - set(resource.attributes["environment"], log.attributes["context"]["env"])
- context
batch: batch:
send_batch_size: 5 send_batch_size: 5
timeout: 10s timeout: 10s