Skip to content
Merged
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
6 changes: 6 additions & 0 deletions content/en/llm_observability/instrumentation/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,10 @@

## Enriching spans

<div class="alert alert-info">
The <code>metrics</code> parameter here refers to numeric values attached as attributes on individual spans — not <a href="/llm_observability/monitoring/metrics/">Datadog platform metrics</a>. For certain recognized keys such as <code>input_tokens</code>, <code>output_tokens</code>, and <code>total_tokens</code>, Datadog uses these span attributes to generate corresponding platform metrics (such as <code>ml_obs.span.llm.input.tokens</code>) for use in dashboards and monitors.

Check warning on line 1256 in content/en/llm_observability/instrumentation/sdk.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.dashes

Don't put a space before or after a dash.
</div>

{{< tabs >}}
{{% tab "Python" %}}
The SDK provides the method `LLMObs.annotate()` to enrich spans with inputs, outputs, and metadata.
Expand Down Expand Up @@ -1923,6 +1927,8 @@

If you're using automatic instrumentation, token and cost metrics appear on your spans automatically. If you're instrumenting manually, follow the guidance below.

<div class="alert alert-info">In this context, "token metrics" and "cost metrics" refer to numeric key-value pairs you attach to spans through the <code>metrics</code> parameter of the <code>LLMObs.annotate()</code> method. These are distinct from <a href="/llm_observability/monitoring/metrics/">Datadog platform LLM Observability metrics</a>. For recognized keys such as <code>input_tokens</code>, <code>output_tokens</code>, <code>input_cost</code>, and <code>output_cost</code>, Datadog uses these span attributes to generate corresponding platform metrics (such as <code>ml_obs.span.llm.input.cost</code>) for use in dashboards and monitors.</div>

Check warning on line 1930 in content/en/llm_observability/instrumentation/sdk.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words_case_insensitive

Use 'see', 'read', or 'follow' instead of 'refer to'.

{{< tabs >}}
{{% tab "Python" %}}

Expand Down
Loading