Skip to content
Open
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
8 changes: 4 additions & 4 deletions sample-apps/java-sample-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ This application also tries to demonstrate how the correlation between traces an
1. Define the resource attribute `aws.log.group.names`. [Reference](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/cloud_provider/aws/logs/)
2. Inject the trace id in the logs. The following string must be present in the log line `AWS-XRAY-TRACE-ID: TraceID@EntityID`. Example: `AWS-XRAY-TRACE-ID: 1-5d77f256-19f12e4eaa02e3f76c78f46a@1ce7df03252d99e1`. [Reference](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java-configuration.html#xray-sdk-java-configuration-logging).

Both the manual and auto instrumentation applications are implementing the steps bellow. They use different mechanisms to do that:
Both the manual and auto instrumentation applications implement the steps bellow. They use different mechanisms to do that:

1. Resource attribute. This is configurable using the system property `adot.sampleapp.loggroup`. The default value is `sample-app-trace-logs`. Each application type use a different mechanism to set this resource attribute.
1. Resource attribute. This is configurable using the system property `adot.sampleapp.loggroup`. The default value is `sample-app-trace-logs`. Each application type uses a different mechanism to set this resource attribute.
* Manual instrumentation - During SDK initialization.
* Auto instrumentation - Using extension mechanism defined [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/examples/extension).
* Auto instrumentation - Uses the extension mechanism defined [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/examples/extension).
2. Trace id injection.
* Both applications use log4j Mapped Diagnostic Context (MDC). The format of the log is defined in the `log4j2.xml` file in each application directory.

We are also including an example configuration file in `cw-agent.json` so that cloudwatch agent can capture the logs of the sample application when running locally.
We also include an example configuration file in `cw-agent.json` so that the cloudwatch agent can capture the logs of the sample application when running locally.