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

fix(logs): ensure logs are truncated to 256kb #1022

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions servers/otel-collector/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ exporters:
# https://www.googlecloudcommunity.com/gc/Data-Analytics/OpenTelemetry-and-GKE/m-p/674090/highlight/true#M3861
timeout: 45s
processors:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23847
transform/google_logs:
log_statements:
- context: resource
statements:
- truncate_all(attributes, 256000)
- context: log
statements:
- set(attributes["truncate-body"], body)
- truncate_all(attributes, 256000)
- set(body, attributes["truncate-body"])
- delete_key(attributes, "truncate-body")
memory_limiter:
check_interval: 1s
limit_percentage: 70
Expand Down Expand Up @@ -94,6 +106,7 @@ service:
receivers: [otlp]
processors:
[
transform/google_logs,
resource/cleanup_for_google,
resourcedetection/ecs,
memory_limiter,
Expand Down
Loading