Skip to content

Document service log correlation #10454

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

Merged
merged 6 commits into from
Mar 24, 2023
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
1 change: 1 addition & 0 deletions docs/empty2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# delete me
8 changes: 5 additions & 3 deletions docs/log-correlation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ See the relevant https://www.elastic.co/guide/en/apm/agent/index.html[Agent docu

Once log correlation is enabled,
you must ensure your logs contain APM identifiers.

In some supported frameworks, this is already done for you.
In other scenarios, like for unstructured logs,
you'll need to add APM identifiers to your logs in any easy to parse manner.

The identifiers we're interested in are: {ecs-ref}/ecs-tracing.html[`trace.id`] and
{ecs-ref}/ecs-tracing.html[`transaction.id`]. Certain Agents also support the `span.id` field.
Log correlation relies on these fields:
- Service level: {ecs-ref}/ecs-service.html[`service.name`], {ecs-ref}/ecs-service.html[`service.version`], and {ecs-ref}/ecs-service.html[`service.environment`]
- Trace level: {ecs-ref}/ecs-tracing.html[`trace.id`] and {ecs-ref}/ecs-tracing.html[`transaction.id`]

This process for adding these fields will differ based the Agent you're using, the logging framework,
The process for adding these fields will differ based the Agent you're using, the logging framework,
and the type and structure of your logs.

See the relevant https://www.elastic.co/guide/en/apm/agent/index.html[Agent documentation] to learn more.
Expand Down