Skip to content

how to map declarative config properties #14144

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Jun 27, 2025

This is a specification PR - implementation issues will be created when this PR is merged.

Fixes #14132

@zeitlinger zeitlinger self-assigned this Jun 27, 2025
@zeitlinger zeitlinger requested a review from a team as a code owner June 27, 2025 07:34
@zeitlinger
Copy link
Member Author

@trask @jack-berg please have a look

db-statement-sanitizer:
enabled: true # already exists - just for reference
thread_details:
enabled: true # was "otel.javaagent.add-thread-details" = "true"
Copy link
Member Author

Choose a reason for hiding this comment

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

alternatively: spans: enabled: true

Copy link
Member

Choose a reason for hiding this comment

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

it's a good question

honestly I wonder how useful this instrumentation is, and whether we should disable it by default in 3.0 @laurit?

I guess my preference would be

  • disabled by default
  • enabled applies to both spans and logs (but not metrics due to high cardinality)

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we could apply this new semantic also to the spring starter where this feature is added without declarative config in #14117

Copy link
Contributor

Choose a reason for hiding this comment

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

The semantic conventions recommend setting these attributes. Comments in open-telemetry/opentelemetry-specification#788 list some potential usages. It is difficult to predict when which attributes could be valuable.

Copy link
Member Author

Choose a reason for hiding this comment

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

@trask agreed to check with sem conv

@zeitlinger
Copy link
Member Author

@jack-berg I think we could get this unblocked with your feedback 😄

@zeitlinger
Copy link
Member Author

Strictly speaking we don't need to merge this, as we normally don't have spec PRs in this repo. Eventually, this doc should end up in the docs repo.

- use sdk style discriminator for logging
- use common "enabled" for "default-enabled"
db_statement_sanitizer:
enabled: true # already exists - just for reference
thread_details:
# disabled by default
Copy link
Contributor

Choose a reason for hiding this comment

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

currently it is enabled by default, it is disabled when running tests

Copy link
Member Author

@zeitlinger zeitlinger Jul 10, 2025

Choose a reason for hiding this comment

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

@trask suggested that is should be off by default: #14144 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought that this is supposed to represent what the agent currently does, feel free to ignore if it has a different purpose.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's supposed to be the spec for declarative configuration.
Mostly what the agent does today - but it's an opportunity to clean things up - that we could otherwise only do with a major version.

enabled: true # already exists - just for reference
thread_details:
# disabled by default
# enabled applies to both spans and logs (but not metrics due to high cardinality)
Copy link
Contributor

Choose a reason for hiding this comment

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

this setting does not apply to logs, they use a different flag for the thread attributes

Copy link
Member Author

Choose a reason for hiding this comment

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

then we should probably add this here as thread_details/logging/enabled

Copy link
Member Author

Choose a reason for hiding this comment

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

the current attributes to add thread details to logs are

  • otel.instrumentation.log4j-appender.experimental-log-attributes
  • otel.instrumentation.logback-appender.experimental-log-attributes

I similar argument could be made where we have different settings for adding baggage to log context:

  • otel.instrumentation.logback-mdc.add-baggage
  • otel.instrumentation.log4j-context-data.add-baggage

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.

declarative config: property mapping
4 participants