From 3ae817cdf959c629e37d0b0b72ee73552770a855 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 6 Jan 2025 16:45:21 +0100 Subject: [PATCH 1/3] Fix apm fingerprinting documentation --- content/en/error_tracking/troubleshooting.md | 44 +------------------- content/en/tracing/error_tracking/_index.md | 2 +- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/content/en/error_tracking/troubleshooting.md b/content/en/error_tracking/troubleshooting.md index 6aa5415582e8c..2bd101e3f022c 100644 --- a/content/en/error_tracking/troubleshooting.md +++ b/content/en/error_tracking/troubleshooting.md @@ -6,7 +6,7 @@ If you experience unexpected behavior with Error Tracking, the troubleshooting s Datadog recommends regularly updating to the latest version of the Datadog tracing libraries, mobile SDKs, and web SDKs, as each release contains improvements and fixes. -## Errors are not found in Error Tracking +## Errors are not found in Error Tracking ### Logs @@ -17,53 +17,15 @@ This [example query][3] searches for logs meeting the criteria for inclusion in ### APM To be processed by Error Tracking, a span must have these attributes: + - `error.type` - `error.message` - `error.stack` **Note**: The stack must have at least two lines and one *meaningful* frame (a frame with a function name and a filename in most languages). -Only errors from service entry spans (the uppermost service spans) are processed by Error Tracking. Error Tracking primarily captures unhandled exceptions, and this behavior is in place to avoid capturing errors handled internally by the service. - This [example query][5] searches for spans meeting the criteria for inclusion in Error Tracking. -#### Workarounds for bubbling up child span errors to service entry span - -Some tracers provide a way to access the root span and bubble up the error from child to root. - -{{< tabs >}} -{{% tab "Java" %}} - -```java -final Span span = GlobalTracer.get().activeSpan(); -if (span != null && (span instanceof MutableSpan)) { - MutableSpan localRootSpan = ((MutableSpan) span).getLocalRootSpan(); - // do stuff with root span - localRootSpan.setTag("", ""); -} -``` - -{{% /tab %}} -{{% tab "Python" %}} - -```python -context = tracer.get_call_context() -root_span = context.get_current_root_span() -root_span.set_tag('', '') -``` - -{{% /tab %}} -{{% tab "Ruby" %}} - -```ruby -current_root_span = Datadog.tracer.active_root_span -current_root_span.set_tag('', '') unless current_root_span.nil? -``` - -{{% /tab %}} - -{{< /tabs >}} - ### RUM Error Tracking only processes errors that are sent with the source set to `custom`, `source`, `report`, `network` or `console`, and contain a stack trace. @@ -81,8 +43,6 @@ Spans associated with the error need to be retained with a custom retention filt [1]: /help/ [2]: /logs/error_tracking/backend/?tab=serilog#attributes-for-error-tracking [3]: https://app.datadoghq.com/logs?query=status%3A%28emergency%20OR%20alert%20OR%20critical%20OR%20error%29%20AND%20%28%40error.stack%3A%2A%20OR%20%40error.kind%3A%2A%29%20 -[4]: /tracing/error_tracking/#use-span-tags-to-track-error-spans [5]: https://app.datadoghq.com/apm/traces?query=%40_top_level%3A1%20%40error.stack%3A%2A%20AND%20%40error.message%3A%2A%20AND%20error.type%3A%2A%20AND%20%40_top_level%3A1%20 [6]: https://app.datadoghq.com/rum/sessions?query=%40type%3Aerror%20%40error.stack%3A%2A [7]: https://app.datadoghq.com/error-tracking/settings -[8]: /tracing/trace_collection/custom_instrumentation/java/dd-api/#set-tags--errors-on-a-root-span-from-a-child-span diff --git a/content/en/tracing/error_tracking/_index.md b/content/en/tracing/error_tracking/_index.md index 767480881ab28..1c79a9ab4b38b 100644 --- a/content/en/tracing/error_tracking/_index.md +++ b/content/en/tracing/error_tracking/_index.md @@ -36,7 +36,7 @@ To get started with configuring your repository, see the [Source Code Integratio ## Use span attributes to track error spans -The Datadog tracers collect errors through integrations and the manual instrumentation of your backend services' source code. Error spans within a trace are processed by Error Tracking **if the error is located in a service entry span** (the uppermost service span). This span must also contain the `error.stack`, `error.message`, and `error.type` [span attributes][1] to be tracked. +The Datadog tracers collect errors through integrations and the manual instrumentation of your backend services' source code. Error spans within a trace are processed by Error Tracking if they are service top-level errors, whether or not they are located in service entry spans. This span must also contain the `error.stack`, `error.message`, and `error.type` [span attributes][1] to be tracked. {{< img src="tracing/error_tracking/flamegraph_with_errors.png" alt="Flame graph with errors" style="width:100%;" >}} From f1a588a2a1202998c0a2af4726b3ec9b43a44ff5 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 6 Jan 2025 16:51:35 +0100 Subject: [PATCH 2/3] Fix query --- content/en/error_tracking/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/error_tracking/troubleshooting.md b/content/en/error_tracking/troubleshooting.md index 2bd101e3f022c..ac7c9df109856 100644 --- a/content/en/error_tracking/troubleshooting.md +++ b/content/en/error_tracking/troubleshooting.md @@ -43,6 +43,6 @@ Spans associated with the error need to be retained with a custom retention filt [1]: /help/ [2]: /logs/error_tracking/backend/?tab=serilog#attributes-for-error-tracking [3]: https://app.datadoghq.com/logs?query=status%3A%28emergency%20OR%20alert%20OR%20critical%20OR%20error%29%20AND%20%28%40error.stack%3A%2A%20OR%20%40error.kind%3A%2A%29%20 -[5]: https://app.datadoghq.com/apm/traces?query=%40_top_level%3A1%20%40error.stack%3A%2A%20AND%20%40error.message%3A%2A%20AND%20error.type%3A%2A%20AND%20%40_top_level%3A1%20 +[5]: https://app.datadoghq.com/apm/traces?query=%40_top_level%3A1%20%40error.stack%3A%2A%20AND%20%40error.message%3A%2A%20AND%20error.type%3A%2A%20 [6]: https://app.datadoghq.com/rum/sessions?query=%40type%3Aerror%20%40error.stack%3A%2A [7]: https://app.datadoghq.com/error-tracking/settings From a86e4c33a6afeb603d6e409b42e6b20627dff8b3 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Tue, 7 Jan 2025 15:54:19 +0100 Subject: [PATCH 3/3] apply review Co-authored-by: Brett Blue <84536271+brett0000FF@users.noreply.github.com> --- content/en/tracing/error_tracking/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/tracing/error_tracking/_index.md b/content/en/tracing/error_tracking/_index.md index 1c79a9ab4b38b..501ed85f93980 100644 --- a/content/en/tracing/error_tracking/_index.md +++ b/content/en/tracing/error_tracking/_index.md @@ -36,7 +36,7 @@ To get started with configuring your repository, see the [Source Code Integratio ## Use span attributes to track error spans -The Datadog tracers collect errors through integrations and the manual instrumentation of your backend services' source code. Error spans within a trace are processed by Error Tracking if they are service top-level errors, whether or not they are located in service entry spans. This span must also contain the `error.stack`, `error.message`, and `error.type` [span attributes][1] to be tracked. +The Datadog tracers collect errors through integrations and the manual instrumentation of your backend services' source code. Error Tracking processes error spans within a trace if they occur at the service level, regardless of whether they are located in service entry spans. This span must also contain the `error.stack`, `error.message`, and `error.type` [span attributes][1] to be tracked. {{< img src="tracing/error_tracking/flamegraph_with_errors.png" alt="Flame graph with errors" style="width:100%;" >}}