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

Allow configuring MDC key names for trace_id, span_id, trace_flags #11329

Merged
merged 22 commits into from
Jun 10, 2024

Conversation

AlchemyDing
Copy link
Member

resolve issue
continue with PR

@AlchemyDing AlchemyDing requested a review from a team as a code owner May 10, 2024 06:36
@AlchemyDing
Copy link
Member Author

continue in this pr @pavelvodrazka

Copy link
Contributor

@laurit laurit left a comment

Choose a reason for hiding this comment

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

could you also add tests

@github-actions github-actions bot requested a review from theletterf May 24, 2024 05:51
@AlchemyDing AlchemyDing requested a review from laurit May 24, 2024 07:16
@AlchemyDing AlchemyDing requested a review from laurit May 24, 2024 14:44
Comment on lines 29 to 33
sources {
java {
setSrcDirs(listOf("src/test/java"))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't have removed this. The intent here is that this test suite uses the same test sources as the main test. If you remove it then it will use src/testDisableThreadLocals/java as test sources, as that directory does not exist it won't run any tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for your answer

@AlchemyDing
Copy link
Member Author

Why Build pull request / common / test0 (21, hotspot) (pull_request) has been cancelled

Comment on lines 35 to 40
If the `otel.instrumentation.logback-mdc.add-baggage` system property (or the
`OTEL_INSTRUMENTATION_LOGBACK_MDC_ADD_BAGGAGE` environment variable) is set to `true`,
key/value pairs in [baggage](https://opentelemetry.io/docs/concepts/signals/baggage/) will be added to the context too.

- `baggage.<entry_name>`

Copy link
Contributor

Choose a reason for hiding this comment

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

in library instrumentation logback appender is configured via logback.xml not system properties or environment variables, see

Comment on lines 74 to 81

If you want to customize the names of these keys, you can set system property or environment variable:

| System property | Environment variable |
|-------------------------------------------------------|---------------------------------------------------|
| `otel.instrumentation.common.logging.trace-id` | `OTEL_INSTRUMENTATION_COMMON_LOGGING_TRACE_ID` |
| `otel.instrumentation.common.logging.span-id` | `OTEL_INSTRUMENTATION_COMMON_LOGGING_SPAN_ID` |
| `otel.instrumentation.common.logging.trace-flags` | `OTEL_INSTRUMENTATION_COMMON_LOGGING_TRACE_FLAGS` |
Copy link
Contributor

Choose a reason for hiding this comment

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

these are also configured in logback.xml

@@ -42,6 +42,14 @@ will be added to the context when a log statement is made when a span is active:
- `span_id`
- `trace_flags`

If you want to customize the names of these keys, you can set system property or environment variable:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you want to customize the names of these keys, you can set system property or environment variable:
These keys can be customized using the following system properties or environment variables:

@pavelvodrazka
Copy link

Hi, is this request planned to be merged / included in the next release?

@trask trask merged commit b47aca9 into open-telemetry:main Jun 10, 2024
53 checks passed
zeitlinger pushed a commit to zeitlinger/opentelemetry-java-instrumentation that referenced this pull request Jun 12, 2024
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.

Allow configuring MDC key names for trace_id, span_id, trace_flags
4 participants