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

DOCS-8916 Add Using LLM Observability and APM Guide #25352

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions content/en/llm_observability/guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ cascade:
{{< whatsnext desc="LLM Observability Guides:" >}}
{{< nextlink href="/llm_observability/quickstart" >}}Trace an LLM Application{{< /nextlink >}}
{{< nextlink href="/llm_observability/submit_evaluations" >}}Submit Evaluations{{< /nextlink >}}
{{< nextlink href="/llm_observability/guide/llm_observability_and_apm" >}}Using LLM Observability and APM{{< /nextlink >}}
{{< /whatsnext >}}
59 changes: 59 additions & 0 deletions content/en/llm_observability/guide/llm_observability_and_apm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: Using LLM Observability and APM
description: Learn how to navigate between LLM Observability spans and APM spans so you can gain insights into LLM-specific operations and your broader application ecosystem.
further_reading:
- link: "/llm_observability/terms/"
tag: "Documentation"
text: "Learn about LLM Observability Spans"
- link: "/glossary/#span/"
tag: "Documentation"
text: "Learn about APM Spans"
---

## Overview

The LLM Observability SDK is built on APM's `dd-tracer`. This allows you to use LLM Observability with [Application Performance Monitoring (APM)][7]. By instrumenting your LLM-specific operations with LLM Observability and your broader application with APM, LLM Observability and APM [spans][6] are linked in Datadog.
alai97 marked this conversation as resolved.
Show resolved Hide resolved

This integration allows you to accomplish the following:
rtrieu marked this conversation as resolved.
Show resolved Hide resolved

* Understand end-to-end visibility: Explore upstream and downstream requests of your LLM applications within the context of your entire application.
* Dive deeper from APM to LLM Observability to investigate whether or not an issue with your application is specific to LLM-specific applications, such as a call to OpenAI.
alai97 marked this conversation as resolved.
Show resolved Hide resolved

## Setup

rtrieu marked this conversation as resolved.
Show resolved Hide resolved
rtrieu marked this conversation as resolved.
Show resolved Hide resolved
If you are using the [LLM Observability SDK for Python][1] along with APM's [`dd-tracer`][2], you can navigate between spans in Datadog APM and LLM Observability without any additional setup.
alai97 marked this conversation as resolved.
Show resolved Hide resolved

If you are using the [LLM Observability API][3] with `dd-tracer` for APM:

1. Use the appropriate method to obtain the span ID from the tracer (for example, using `span.Context().SpanID()` for the Go tracer).
1. Include the captured span IDs in all of the LLM Observability API requests. This links APM and LLM Observability spans in Datadog.

## Navigate between spans

By using this integration, you can correlate data across your application stack and understand how your LLM applications interact with other components. You can also resolve issues more quickly and optimize your application's performance.

{{< img src="llm_observability/guides/apm/end_to_end_tracing.mp4" alt="This video demonstrates the ability to navigate between LLM Observability spans and APM spans in Datadog" style="width:100%" video=true >}}

### From LLM Observability to APM

To understand the broader context of your LLM operations within your application ecosystem, select an LLM Observability span in the [LLM Observability Explorer][4] and click **APM span** to navigate to the relevant APM span.

{{< img src="llm_observability/guides/apm/llm_span.png" alt="An LLM Observability span with a related APM span that you can navigate to from the Traces page in LLM Observability" style="width:100%;" >}}

### From APM to LLM Observability

To access LLM-specific insights, select an APM span in the [Trace Explorer][5] and click **View Span** in the LLM Observability section on the **Info** tab to navigate to the corresponding LLM Observability span.

{{< img src="llm_observability/guides/apm/apm_span.png" alt="An APM span with a related LLM Observability span that you can navigate to from the Traces page in APM" style="width:100%;" >}}

## Further Reading

{{< partial name="whats-next/whats-next.html" >}}

[1]: /llm_observability/setup/sdk/
[2]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/
[3]: /llm_observability/setup/api/
[4]: https://app.datadoghq.com/llm/traces
[5]: https://app.datadoghq.com/apm/traces
[6]: /llm_observability/terms/#spans
[7]: /tracing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading