Skip to content
Closed
Show file tree
Hide file tree
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
24 changes: 12 additions & 12 deletions docs/instrumentation-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9633,19 +9633,19 @@ libraries:
Enables adding baggage entries to the Log4j ThreadContext, prefixed with "baggage.".
type: boolean
default: false
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: |
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: |
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: |
Specifies the key name used to store the trace flags in the logging context.
Expand Down Expand Up @@ -9675,19 +9675,19 @@ libraries:
Enables adding baggage entries to the Log4j ThreadContext, prefixed with "baggage.".
type: boolean
default: false
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: |
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: |
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: |
Specifies the key name used to store the trace flags in the logging context.
Expand All @@ -9711,19 +9711,19 @@ libraries:
javaagent_target_versions:
- log4j:log4j:[1.2,)
configurations:
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: |
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: |
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: |
Specifies the key name used to store the trace flags in the logging context.
Expand Down Expand Up @@ -9832,19 +9832,19 @@ libraries:
Enables adding baggage entries to the Logback MDC, prefixed with "baggage.".
type: boolean
default: false
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: |
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: |
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: |
Specifies the key name used to store the trace flags in the logging context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
|-------------------------------------------------------|---------|---------------|--------------------------------------------------------------------|
| `otel.instrumentation.log4j-context-data.add-baggage` | Boolean | `false` | Enable exposing baggage attributes through MDC. |
| `otel.instrumentation.common.mdc.resource-attributes` | String | | Comma separated list of resource attributes to expose through MDC. |
| `otel.instrumentation.common.logging.trace-id` | String | `trace_id` | Customize MDC key name for the trace id. |
| `otel.instrumentation.common.logging.span-id` | String | `span_id` | Customize MDC key name for the span id. |
| `otel.instrumentation.common.logging.trace-flags` | String | `trace_flags` | Customize MDC key name for the trace flags. |
| `otel.instrumentation.common.logging.trace-id-key` | String | `trace_id` | Customize MDC key name for the trace id. |
| `otel.instrumentation.common.logging.span-id-key` | String | `span_id` | Customize MDC key name for the span id. |
| `otel.instrumentation.common.logging.trace-flags-key` | String | `trace_flags` | Customize MDC key name for the trace flags. |
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ testing {
targets {
all {
testTask.configure {
jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-id-key=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id-key=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags-key=trace_flags_test")
jvmArgs("-Dlog4j2.enable.threadlocals=true")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ will be added to the context when a log statement is made when a span is active:

These keys can be customized using the following system properties or environment variables:

| 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` |
| System property | Environment variable |
|-------------------------------------------------------|-------------------------------------------------------|
| `otel.instrumentation.common.logging.trace-id-key` | `OTEL_INSTRUMENTATION_COMMON_LOGGING_TRACE_ID_KEY` |
| `otel.instrumentation.common.logging.span-id-key` | `OTEL_INSTRUMENTATION_COMMON_LOGGING_SPAN_ID_KEY` |
| `otel.instrumentation.common.logging.trace-flags-key` | `OTEL_INSTRUMENTATION_COMMON_LOGGING_TRACE_FLAGS_KEY` |

If the `otel.instrumentation.log4j-context-data.add-baggage` system property (or the
`OTEL_INSTRUMENTATION_LOG4J_CONTEXT_DATA_ADD_BAGGAGE` environment variable) is set to `true`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ tasks {
filter {
includeTestsMatching("LibraryLog4j2LoggingKeysTest")
}
jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-id-key=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id-key=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags-key=trace_flags_test")
}

named("check") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public static ContextDataKeys create(OpenTelemetry openTelemetry) {
logging.getString(
"trace_id",
ConfigPropertiesUtil.getString(
"otel.instrumentation.common.logging.trace-id", LoggingContextConstants.TRACE_ID)),
"otel.instrumentation.common.logging.trace-id-key", LoggingContextConstants.TRACE_ID)),
logging.getString(
"span_id",
ConfigPropertiesUtil.getString(
"otel.instrumentation.common.logging.span-id", LoggingContextConstants.SPAN_ID)),
"otel.instrumentation.common.logging.span-id-key", LoggingContextConstants.SPAN_ID)),
logging.getString(
"trace_flags",
ConfigPropertiesUtil.getString(
"otel.instrumentation.common.logging.trace-flags",
"otel.instrumentation.common.logging.trace-flags-key",
LoggingContextConstants.TRACE_FLAGS)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ configurations:
Enables adding baggage entries to the Log4j ThreadContext, prefixed with "baggage.".
type: boolean
default: false
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: >
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: >
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: >
Specifies the key name used to store the trace flags in the logging context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ tasks {
filter {
includeTestsMatching("Log4j27LoggingKeysTest")
}
jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-id-key=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id-key=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags-key=trace_flags_test")
}

named("check") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ configurations:
Enables adding baggage entries to the Log4j ThreadContext, prefixed with "baggage.".
type: boolean
default: false
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: >
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: >
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: >
Specifies the key name used to store the trace flags in the logging context.
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/log4j/log4j-mdc-1.2/javaagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
| System property | Type | Default | Description |
|-------------------------------------------------------|---------|---------------|--------------------------------------------------------------------|
| `otel.instrumentation.common.mdc.resource-attributes` | String | | Comma separated list of resource attributes to expose through MDC. |
| `otel.instrumentation.common.logging.trace-id` | String | `trace_id` | Customize MDC key name for the trace id. |
| `otel.instrumentation.common.logging.span-id` | String | `span_id` | Customize MDC key name for the span id. |
| `otel.instrumentation.common.logging.trace-flags` | String | `trace_flags` | Customize MDC key name for the trace flags. |
| `otel.instrumentation.common.logging.trace-id-key` | String | `trace_id` | Customize MDC key name for the trace id. |
| `otel.instrumentation.common.logging.span-id-key` | String | `span_id` | Customize MDC key name for the span id. |
| `otel.instrumentation.common.logging.trace-flags-key` | String | `trace_flags` | Customize MDC key name for the trace flags. |
6 changes: 3 additions & 3 deletions instrumentation/log4j/log4j-mdc-1.2/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ description: >
display_name: Log4j
library_link: https://logging.apache.org/log4j/1.2/
configurations:
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: >
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: >
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: >
Specifies the key name used to store the trace flags in the logging context.
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/logback/logback-mdc-1.0/javaagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
|-------------------------------------------------------|---------|---------------|--------------------------------------------------------------------|
| `otel.instrumentation.logback-mdc.add-baggage` | Boolean | `false` | Enable exposing baggage attributes through MDC. |
| `otel.instrumentation.common.mdc.resource-attributes` | String | | Comma separated list of resource attributes to expose through MDC. |
| `otel.instrumentation.common.logging.trace-id` | String | `trace_id` | Customize MDC key name for the trace id. |
| `otel.instrumentation.common.logging.span-id` | String | `span_id` | Customize MDC key name for the span id. |
| `otel.instrumentation.common.logging.trace-flags` | String | `trace_flags` | Customize MDC key name for the trace flags. |
| `otel.instrumentation.common.logging.trace-id-key` | String | `trace_id` | Customize MDC key name for the trace id. |
| `otel.instrumentation.common.logging.span-id-key` | String | `span_id` | Customize MDC key name for the span id. |
| `otel.instrumentation.common.logging.trace-flags-key` | String | `trace_flags` | Customize MDC key name for the trace flags. |
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ testing {
targets {
all {
testTask.configure {
jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-id-key=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id-key=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags-key=trace_flags_test")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ testing {
targets {
all {
testTask.configure {
jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-id-key=trace_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.span-id-key=span_id_test")
jvmArgs("-Dotel.instrumentation.common.logging.trace-flags-key=trace_flags_test")
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/logback/logback-mdc-1.0/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ configurations:
Enables adding baggage entries to the Logback MDC, prefixed with "baggage.".
type: boolean
default: false
- name: otel.instrumentation.common.logging.trace-id
- name: otel.instrumentation.common.logging.trace-id-key
declarative_name: java.common.logging.trace_id
description: >
Specifies the key name used to store the trace ID in the logging context.
type: string
default: trace_id
- name: otel.instrumentation.common.logging.span-id
- name: otel.instrumentation.common.logging.span-id-key
declarative_name: java.common.logging.span_id
description: >
Specifies the key name used to store the span ID in the logging context.
type: string
default: span_id
- name: otel.instrumentation.common.logging.trace-flags
- name: otel.instrumentation.common.logging.trace-flags-key
declarative_name: java.common.logging.trace_flags
description: >
Specifies the key name used to store the trace flags in the logging context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,23 @@ private static void initializeMdcAppenderFromProperties(
String traceIdKey =
applicationEnvironmentPreparedEvent
.getEnvironment()
.getProperty("otel.instrumentation.common.logging.trace-id", String.class);
.getProperty("otel.instrumentation.common.logging.trace-id-key", String.class);
if (traceIdKey != null) {
openTelemetryAppender.setTraceIdKey(traceIdKey);
}

String spanIdKey =
applicationEnvironmentPreparedEvent
.getEnvironment()
.getProperty("otel.instrumentation.common.logging.span-id", String.class);
.getProperty("otel.instrumentation.common.logging.span-id-key", String.class);
if (spanIdKey != null) {
openTelemetryAppender.setSpanIdKey(spanIdKey);
}

String traceFlagsKey =
applicationEnvironmentPreparedEvent
.getEnvironment()
.getProperty("otel.instrumentation.common.logging.trace-flags", String.class);
.getProperty("otel.instrumentation.common.logging.trace-flags-key", String.class);
if (traceFlagsKey != null) {
openTelemetryAppender.setTraceFlagsKey(traceFlagsKey);
}
Expand Down
Loading
Loading