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

proposal for correlating synthetics traces #825

Merged
merged 7 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
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
42 changes: 42 additions & 0 deletions specs/integrations/synthetics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Synthetics Integration

Synthetic monitors play a crucial role in periodically checking the status of your services and applications on a global scale. General documentation about synthetic monitors can be found in
[Synthetics getting started page](https://www.elastic.co/guide/en/observability/current/synthetics-get-started.html).

This integration goes in to more detail about how the sythetics monitors would
be correlated with the APM traces. Synthetics traces can be categorized in to two
main types
1. HTTP checks - These have one-one mapping with APM transactions
2. Browser checks - These have a one-to-many mapping with APM transactions

### Correlation
vigneshshanmugam marked this conversation as resolved.
Show resolved Hide resolved

The Synthetics agent takes the responsibility of creating the [`traceparent`](../agents/tracing-distributed-tracing.md#trace_id-parent_id-and-traceparent) header for each outgoing network request associated with a test during every monitor execution.
vigneshshanmugam marked this conversation as resolved.
Show resolved Hide resolved

- `trace.id` and `parent.id`
- outgoing requests that are being explicity traced by the synthetics agent
will have the `parent.id` and `trace.id` as part of the trace context.
- must be unique for each step for a browser monitor
- must be unique for a http monitor
- `sampled` Flag
- used to control the sampling decision for all the downstream services.
- 100% sampling when tracing is enabled

These correlation values would be applicable even if the downstream services are traced by
OpenTelemetry(OTEL)-based agents.

### Identifying Synthetics trace

Synthetics monitor executions creates `rootless traces` as these traces are not
reported to the APM server. To overcome this limitation on the APM UI, we need
vigneshshanmugam marked this conversation as resolved.
Show resolved Hide resolved
to identify the synthetics traces and explicity link them to the Synthetics
waterfall view.

- `http.headers.user-agent`:
vigneshshanmugam marked this conversation as resolved.
Show resolved Hide resolved
- Contains `Elastic/Synthetics` for all outgoing requests from Synthetis based monitors.
felixbarny marked this conversation as resolved.
Show resolved Hide resolved

When a trace is confirmed to be originated from Synthetics-based monitors, the
Trace Explorer view can be linked back to the Synthetics waterfall view.

- `/app/synthetics/link-to/<trace.id>`
vigneshshanmugam marked this conversation as resolved.
Show resolved Hide resolved
- used to link back the explicit browser waterfall step on the Synthetics UI.