Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closes #1044 - Adding documentation for the agent's propagation format #1047

Merged
merged 2 commits into from
Apr 20, 2021
Merged
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
19 changes: 13 additions & 6 deletions inspectit-ocelot-documentation/docs/tracing/log-correlation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,25 @@ As a result, log messages, generated within an exported trace, will be prefixed
Note that the trace ID is only available when the log statement is within a trace which is sampled, otherwise the trace-id is empty.
:::

You can change the key under which the trace-id is placed in the MDC using the property `inspectit.tracing.log-correlation.trace-id-mdc-injection.key`.
As already mentioned, by default the TraceID is inserted into the MDC under the key `"traceid"`. However, this key can also be configured individually, which can be achieved with the following configuration:
```yaml
inspectit:
tracing:
log-correlation:
trace-id-mdc-injection:
key: "traceid" # the key which is used to store the trace id in the MDC
```

By default, the trace-id will be inserted into all MDCs. If required, you can selectively exclude the supported libraries using the following flags:
By default, the TraceID will be inserted into all MDCs. If required, you can selectively exclude the supported libraries using the following flags:
```yaml
inspectit:
tracing:
log-correlation:
trace-id-mdc-injection:
slf4j-enabled: true # Set to "false" to disable slf4J-Support
log4j1-enabled: true # Set to "false" to disable Log4J Version 1 Support
log4j2-enabled: true # Set to "false" to disable Log4J Version 2 Support
jboss-logmanager-enabled: true # Set to "false" to disable JBoss Logmanager support
slf4j-enabled: true # set to "false" to disable slf4J-Support
log4j1-enabled: true # set to "false" to disable Log4J Version 1 Support
log4j2-enabled: true # set to "false" to disable Log4J Version 2 Support
jboss-logmanager-enabled: true # set to "false" to disable JBoss Logmanager support
```


Expand Down
25 changes: 25 additions & 0 deletions inspectit-ocelot-documentation/docs/tracing/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,28 @@ Available options are:
* `ON_LOCAL_ROOT` (default) - Add common tags to local span roots. If a trace spans over several JVMs, then attributes will be set on the first span of each JVM.
* `ALWAYS` - Add common tags as attributes to all spans.

### Trace Correlation and Distributed Tracing

The inspectIT Ocelot agent supports out-of-the-box distributed tracing, which allows traces to be correlated across multiple components to trace the entire flow through a system.
By default, the agent supports correlating a communication via HTTP and JMS.
To achieve this, correlation information is exchanged during the communication (for example by injecting additional headers into requests), for which the **B3 Propagation format is used by default**.

If you want to use the agent together with other components that also perform distributed tracing but do not support the correlation information in B3 format, this can be adjusted with the following configuration:

```YAML
inspectit:
tracing:
propagation-format: B3 # the format for propagating correlation headers
```

Currently the following formats are supported for sending correlation information:

| Property | Format | Description
|---|---|---|
|`B3` *(default)*|[B3 Propagation](https://github.com/openzipkin/b3-propagation/blob/master/README.md)|B3 Propagation used by, e.g. Zipkin.
|`TRACE_CONTEXT`|[W3C Trace Context](https://www.w3.org/TR/trace-context/#traceparent-header)|Standard headers and a value format to propagate context information.
|`DATADOG`|[Datadog Format](https://github.com/inspectIT/inspectit-ocelot/issues/792)|Headers used by Datadog for context correlation.

:::important
It is important to note that this configuration refers to the format of the correlation information used to **send this data**. When processing correlation information that the agent receives, it automatically uses the correct format.
:::