Skip to content

feat(collector): Add preset to reduce the log record attributes#256

Merged
douglascamata merged 4 commits into
mainfrom
reduce-log-record-attributes
Jul 22, 2025
Merged

feat(collector): Add preset to reduce the log record attributes#256
douglascamata merged 4 commits into
mainfrom
reduce-log-record-attributes

Conversation

@douglascamata

@douglascamata douglascamata commented Jul 22, 2025

Copy link
Copy Markdown
Member

Fixes ES-688.

Got a few examples from testing it in our boutique deployment:

Example log attributes before reduction
resource.attributes.host.id:i-091add7f3f1561581
resource.attributes.k8s.container.name:frontend
resource.attributes.k8s.namespace.name:onlineboutique
resource.attributes.k8s.pod.name:astronomy-store-frontend-656f5574b9-bk8ws
resource.attributes.k8s.container.restart_count:0
resource.attributes.k8s.cluster.name:eco-system-onlineboutique
resource.attributes.cx.otel_integration.name:coralogix-integration-helm
resource.attributes.host.name:ip-10-0-2-13.eu-west-1.compute.internal
resource.attributes.k8s.node.name:ip-10-0-2-13.eu-west-1.compute.internal
resource.attributes.host.image.id:ami-0fd9ff4ca2bb79d0b
resource.attributes.k8s.deployment.name:astronomy-store-frontend
scope.attributes:{}
resourceSchemaUrl:https://opentelemetry.io/schemas/1.6.1
logRecord.timeUnixNano:1753176028049833500
logRecord.observedTimeUnixNano:1753176028195250200
logRecord.body:options: {}
logRecord.attributes.logtag:F
logRecord.attributes.log.iostream:stderr
logRecord.attributes.log.file.path:/var/log/pods/onlineboutique_astronomy-store-frontend-656f5574b9-bk8ws_c4404f3b-09af-41e0-93e4-1d1dcd4c196a/frontend/0.log
logRecord.attributes.time:2025-07-22T09:20:28.049833363Z
Example log attributes after reduction
resource.attributes.host.id:i-0a0009540045850ba
resource.attributes.k8s.container.name:loadgenerator
resource.attributes.k8s.namespace.name:onlineboutique
resource.attributes.k8s.pod.name:astronomy-store-loadgenerator-8644d98cbb-dh6fc
resource.attributes.k8s.container.restart_count:336
resource.attributes.k8s.cluster.name:eco-system-onlineboutique
resource.attributes.cx.otel_integration.name:coralogix-integration-helm
resource.attributes.host.name:ip-10-0-3-162.eu-west-1.compute.internal
resource.attributes.k8s.node.name:ip-10-0-3-162.eu-west-1.compute.internal
resource.attributes.host.image.id:ami-0fd9ff4ca2bb79d0b
resource.attributes.k8s.deployment.name:astronomy-store-loadgenerator
scope.attributes:{}
resourceSchemaUrl:https://opentelemetry.io/schemas/1.6.1
logRecord.timeUnixNano:1753177232556224000
logRecord.observedTimeUnixNano:1753177232698984200
logRecord.body:GET /api/products/2ZYFJ3GM2N 453 0(0.00%) | 9 6 37 9 | 0.00 0.00
logRecord.attributes:{}

Also changed the error_mode of the transformers in this and the reduceResourceAttributes preset to silent.

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
@douglascamata douglascamata marked this pull request as ready for review July 22, 2025 10:36
@douglascamata douglascamata requested review from a team, nicolastakashi and oded-dd as code owners July 22, 2025 10:36
Comment thread charts/opentelemetry-collector/values.yaml
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
@douglascamata douglascamata merged commit a058e7b into main Jul 22, 2025
3 checks passed
@douglascamata douglascamata deleted the reduce-log-record-attributes branch July 22, 2025 13:29
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.

3 participants