Skip to content

Add Node.js experiment setup instructions - #39963

Closed
mehulsonowal wants to merge 5 commits into
masterfrom
docs/nodejs-experiments-setup-signed
Closed

mehulsonowal wants to merge 5 commits into
masterfrom
docs/nodejs-experiments-setup-signed

Conversation

@mehulsonowal

Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Update the Agent Observability Experiments documentation to include Node.js instructions alongside Python and organize the setup content under Guides.

  • Add Python/Node.js selectors for setup and experiment code snippets.
  • Document Node.js tracer initialization, datasets, tasks, evaluators, summary evaluators, OpenTelemetry spans, and experiment runs.
  • Move the setup and Experiment topic pages into the Guides section.
  • Update navigation, links, and legacy aliases.

Merge readiness

  • Ready for merge

Testing

  • git diff --check
  • Local Hugo preview verified for the updated routes.

AI assistance

Additional notes

@mehulsonowal
mehulsonowal requested a review from a team as a code owner September 15, 2026 16:49
@github-actions github-actions Bot added Architecture Everything related to the Doc backend Guide Content impacting a guide labels Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

New or renamed files

Removed or renamed files (these should redirect)

Renamed files

Modified Files

@buraizu buraizu added the editorial review Waiting on a more in-depth review label Sep 15, 2026 — with ddtool CLI

buraizu commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Created DOCS-15714 for the editorial review.

@domalessi domalessi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some feedback! Let me know when this is ready for another look.

Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated

@domalessi domalessi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit more tweaking and then we should be good to go!


{{< tabs >}}
{{% tab "Python" %}}
Supply both a Datadog API key and application key. Pass `api_key` and `app_key` to `LLMObs.enable()`, or set the `DD_API_KEY` and `DD_APP_KEY` environment variables:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Supply both a Datadog API key and application key. Pass `api_key` and `app_key` to `LLMObs.enable()`, or set the `DD_API_KEY` and `DD_APP_KEY` environment variables:
Pass `api_key` and `app_key` to `LLMObs.enable()`, or set the `DD_API_KEY` and `DD_APP_KEY` environment variables:

{{% /tab %}}

{{% tab "Node.js" %}}
Set `DD_API_KEY` and `DD_APP_KEY` in your environment, then initialize `dd-trace` in your application entrypoint. The Experiments client uses these environment variables for authentication:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set `DD_API_KEY` and `DD_APP_KEY` in your environment, then initialize `dd-trace` in your application entrypoint. The Experiments client uses these environment variables for authentication:
Set `DD_API_KEY` and `DD_APP_KEY` in your environment. The Experiments client uses these variables for authentication. Then choose one of the following initialization methods.
**In-code initialization**
Initialize `dd-trace` in your application entrypoint:

- `projectName` identifies the project that contains your datasets and experiments. If omitted, it defaults to `default-project`.
- `mlApp` identifies the LLM application used for Agent Observability traces. Neither `mlApp` nor `service` determines the Experiments project name.

For command-line setup, include both your API key and application key:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For command-line setup, include both your API key and application key:
**Command-line initialization**
Alternatively, initialize `dd-trace` from the command line instead of calling `require('dd-trace').init(...)` in your application. Set the configuration and authentication environment variables when starting your application:


{{< tabs >}}
{{% tab "Python" %}}
Set `agentless_enabled` to `False` (the default) to enable APM trace correlation:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set `agentless_enabled` to `False` (the default) to enable APM trace correlation:
APM trace correlation requires `agentless_enabled=False`, which is the default:

{{% /tab %}}

{{% tab "Node.js" %}}
Set `agentlessEnabled` to `false` (the default) to enable APM trace correlation:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set `agentlessEnabled` to `false` (the default) to enable APM trace correlation:
APM trace correlation requires `agentlessEnabled: false`, which is the default. If you used the in-code initialization example in the setup section, change `agentlessEnabled` from `true` to `false`:


Datadog supports the following evaluator return types:

- **Boolean**: returns true or false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Boolean**: returns true or false
- **Boolean**: Returns true or false

Comment on lines +570 to +571
For the class-based approach using `BaseSummaryEvaluator`, see the [Evaluation Developer Guide](/llm_observability/investigate/evaluations/evaluation_developer_guide).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this reference under the Class-based summary evaluators heading, as suggested there.

Suggested change
For the class-based approach using `BaseSummaryEvaluator`, see the [Evaluation Developer Guide](/llm_observability/investigate/evaluations/evaluation_developer_guide).


Summary evaluator functions can take a list of any non-null type as `inputs` (string, number, Boolean, object, or array); `outputs` and `expected_outputs` can be lists of any type. `evaluators_results` is a dictionary of lists of results from evaluators, keyed by the name of the evaluator function.

#### Class-based summary evaluators

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Class-based summary evaluators
#### Class-based summary evaluators
For details on implementing `BaseSummaryEvaluator`, see the [Evaluation Developer Guide](/llm_observability/investigate/evaluations/evaluation_developer_guide/).


{{< tabs >}}
{{% tab "Python" %}}
For custom tracing, use the [Python tracing decorators](/llm_observability/instrument/custom_instrumentation?tab=decorators#trace-an-llm-application). For automatic instrumentation, see the [supported Python frameworks](/llm_observability/instrument/auto_instrumentation?tab=python).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom_instrumentation URL redirects to the SDK page, where the trace-an-llm-application anchor no longer exists. Use reference-style links with both definitions inside this Python tab.

Suggested change
For custom tracing, use the [Python tracing decorators](/llm_observability/instrument/custom_instrumentation?tab=decorators#trace-an-llm-application). For automatic instrumentation, see the [supported Python frameworks](/llm_observability/instrument/auto_instrumentation?tab=python).
For custom tracing, use the [Python tracing decorators][2]. For automatic instrumentation, see the [supported Python frameworks][3].
[2]: /llm_observability/instrument/sdk/?tab=python#manual-instrumentation
[3]: /llm_observability/instrument/auto_instrumentation?tab=python


1. Install the Agent Observability SDK:

{{< tabs >}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nest the setup tabs inside their numbered steps.

Comment thread hugo/content/en/llm_observability/guide/experiments.md Outdated
Comment thread hugo/content/en/llm_observability/guide/experiments.md
@mehulsonowal

Copy link
Copy Markdown
Contributor Author

Superseded by #40594. The replacement PR contains the finalized documentation changes in a single GitHub-verified commit authored and signed as mehulsonowal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend editorial review Waiting on a more in-depth review Guide Content impacting a guide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants