Skip to content
Open
Show file tree
Hide file tree
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
41 changes: 30 additions & 11 deletions src/langsmith/dashboards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Monitor agents with dashboards
sidebarTitle: Monitor agents with dashboards
---

import FilteringExperienceNote from '/snippets/langsmith/filtering-experience-note.mdx';

Dashboards summarize your [trace](/langsmith/observability-concepts#traces) data so you can spot trends and monitor the health of your agents. In the [LangSmith UI](https://smith.langchain.com), find prebuilt dashboards on the **Analytics** tab of the **Monitoring** page, and custom dashboards on the **Dashboards** page under **Workspace** in the sidebar.

LangSmith offers two dashboard types:
Expand Down Expand Up @@ -98,19 +100,11 @@ For filtering with multiple metrics, read the following [Filter and group](#filt

Refine what data appears on the chart with filters, and split it into multiple series with a group.

Where **filters** appear depends on how many metrics your chart has:

- **Single metric**: one **+ Filter** in the **Filter & group** panel (the `where` slot). It applies to that metric.
- **Multiple metrics or a ratio**: each metric (or ratio) gets its own **+ Filter** inline in its card under **Pick a metric**. There is no separate chart-wide filter.

When you add a filter, it defaults to filtering at the [run](/langsmith/observability-concepts#runs) level. To broaden the scope, open the filter picker, then the **Advanced** submenu at the bottom, and choose:

- **Trace filter**: filters at the [trace](/langsmith/observability-concepts#traces) (root-run) level.
- **Tree filter**: includes the entire trace tree if any run in it matches the condition.
<FilteringExperienceNote />

The active scope appears as a suffix on the **Advanced** item (for example, **Advanced Tree Filter**). Click the **X** next to it to reset back to a plain run filter.
In the chart editor, the search bar experience shows **Traces** and **Runs** tabs in each metric card. The search bar itself stays hidden behind **+ Filter** until the metric has a filter. For chart-specific steps, refer to [Filter with the search bar](#filter-with-the-search-bar) or [Filter with filter chips](#filter-with-filter-chips).

Dataset sources do not expose run/trace/tree filters. Data is scoped by the selected dataset. For filter syntax, refer to [filtering traces (ClickHouse)](/langsmith/filter-traces-in-application).
Dataset sources do not support filters in either experience. Data is scoped by the selected dataset.

**Grouping** creates multiple series on the same chart in one of two ways:

Expand All @@ -121,6 +115,31 @@ Dataset sources do not expose run/trace/tree filters. Data is scoped by the sele
Group by and multi-metric are mutually exclusive on a single chart. Only one group-by attribute is allowed. Donut, ranked bar, and table charts do not support multiple data series (extras are dropped or blocked).
</Note>

#### Filter with the search bar

Chart filters use the same search bar and query syntax as the runs table of an agent environment. Each metric card holds its own filter, so the section below **Pick a metric** reads **Group by** rather than **Filter & group**. Table charts have no metric cards and keep a single filter in the **Filter & group** section.

The filter appears in a metric card once you choose a metric:

- **Traces** and **Runs**: Choose what the metric counts. **Traces**, the default for a new metric, matches root runs only. **Runs** matches any run, including child runs.
- **Filter**: Opens the search bar. The scope selector sets which runs a query matches: **Traces** offers the **Root run** and **Any run** scopes, and **Runs** adds the **Single run** scope. For the query syntax and the fields you can filter on, refer to [Query syntax](/langsmith/filter-traces#query-syntax) and [Fields](/langsmith/filter-traces#fields). For what each scope matches, refer to [Choose what a filter matches](/langsmith/filter-traces#choose-what-a-filter-matches).
- **Saved filters**: Lists the [saved filters](/langsmith/filter-traces#save-a-filter) of each selected agent environment, grouped by environment. Selecting one replaces the metric's filter and its **Traces** or **Runs** selection. Only run-level saved filters that a chart can use are listed.
- **Clear**: Removes the metric's filter.

For a ratio metric, the filter on the metric card applies to both the numerator and the denominator. The **Numerator** and **Denominator** each also take their own filter, which matches individual runs.

Charts saved with chip filters open with those filters translated to the search bar syntax. If a filter cannot be translated, the editor shows an error and leaves the saved chart unchanged.

#### Filter with filter chips

Where the filter appears depends on how many metrics the chart has:

- **Single metric**: One **+ Add Filter** in the **Filter & group** section. It applies to that metric.
- **Multiple metrics**: Each metric gets its own **+ Add Filter** inline in its card under **Pick a metric**. There is no separate chart-wide filter.
- **Ratio**: The **Numerator** and **Denominator** each also take their own **+ Filter**.

A new filter matches at the [run](/langsmith/observability-concepts#runs) level. To broaden it, open the **Advanced** submenu at the bottom of the filter picker and choose **Trace**, which matches at the [trace](/langsmith/observability-concepts#traces) (root-run) level, or **Tree**, which includes the entire trace tree if any run in it matches. The **Advanced** item then names the active scope, for example **Advanced Tree Filter**. Click the **X** next to it to reset to a run filter. Numerator and denominator filters have no **Advanced** submenu and always match at the run level. For filter syntax, refer to [Filter traces (ClickHouse)](/langsmith/filter-traces-in-application).

#### Choose visualization

Choose a visualization type:
Expand Down
18 changes: 15 additions & 3 deletions src/langsmith/evaluators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,25 @@ To chain a second evaluator onto a first:

1. Create or open the second evaluator and expand its filter. For more information, see [Apply a filter to runs that trigger the evaluator](/langsmith/online-evaluations-llm-as-judge#apply-a-filter-to-runs-that-trigger-the-evaluator) for LLM-as-a-judge evaluators or [Create a filter](/langsmith/online-evaluations-code#3-create-a-filter) for code evaluators.
1. Filter on the first evaluator's feedback key. The filter matches on the key rather than the evaluator that produced it, so feedback from any source with that key triggers the second evaluator, including [user feedback](/langsmith/attach-user-feedback). Use a key that only the first evaluator produces.
- To trigger on every run the first evaluator scored, filter on the key alone:
- To trigger on every run the first evaluator scored, filter on the key alone. In the search bar, use:

```text
feedback.correctness:*
```

In the filter builder, use:

```text
eq(feedback_key, "correctness")
```

- To trigger only when the score meets a condition, combine the key with a `feedback_score` comparison. For example, to trigger only when `correctness` is below `0.5`:
- To trigger only when the score meets a condition, compare the key's score. For example, to trigger only when `correctness` is below `0.5`, use the following in the search bar:

```text
feedback.correctness.score:<0.5
```

In the filter builder, combine the key with a `feedback_score` comparison:

```text
and(eq(feedback_key, "correctness"), lt(feedback_score, 0.5))
Expand All @@ -286,7 +298,7 @@ To chain a second evaluator onto a first:
1. If the second evaluator reads the first score, [include extended stats](#include-extended-stats). LLM-as-a-judge evaluators require it, and code evaluators use it to read the score reliably. For more information, see [Read the first score](#read-the-first-score).
1. Save the evaluator.

The second evaluator picks up a run only after the first evaluator's score is attached to it, so the order in which the evaluators run does not matter. For the full filter syntax, see [Trace query syntax](/langsmith/trace-query-syntax).
The second evaluator picks up a run only after the first evaluator's score is attached to it, so the order in which the evaluators run does not matter. For the full filter syntax, see [Filter on feedback](/langsmith/filter-traces#filter-on-feedback) for the search bar or [Trace query syntax](/langsmith/trace-query-syntax) for the filter builder.

### Read the first score

Expand Down
8 changes: 8 additions & 0 deletions src/langsmith/llm-gateway-traces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: Find LLM Gateway traces, read their policy and cost metadata, triag
---

import LLMGatewayBetaNote from '/snippets/langsmith/llm-gateway-beta-note.mdx';
import FilteringExperienceNote from '/snippets/langsmith/filtering-experience-note.mdx';

<LLMGatewayBetaNote />

Expand Down Expand Up @@ -68,6 +69,13 @@ The root run and provider LLM runs record who made the request. The keys below a
- **`gateway.user_id`**: The user who made the request. Set only for personal access tokens, so service-key requests have no user.
- **`gateway.<name>`**: Each `X-Gateway-*` request header. For how names are normalized, see [Matchable headers](/langsmith/llm-gateway-header-policies#matchable-headers).

<FilteringExperienceNote />

On the **Traces** tab:

- **With the search bar**: Filter on these keys with a `metadata` clause, as described in [Match a JSON key](/langsmith/filter-traces#match-a-json-key), and choose [what the query matches](/langsmith/filter-traces#choose-what-a-filter-matches). Select **Traces** to list one row per request, or **Runs** to include child runs. To reuse a filter, [save it as a view](/langsmith/filter-traces#save-a-filter).
- **With filter chips**: Click **Add filter** and filter on the metadata key and value.

## Restrict trace visibility

Gateway traces are runs in a workspace project, so the same permissions govern them as other runs in the workspace. Any user with `runs:read` (and `projects:read` to see the project itself) on the workspace can view traces in that workspace's gateway project. The built-in Workspace Admin, Workspace Editor, and Workspace Viewer [roles](/langsmith/rbac#workspace-roles) all include both permissions by default.
Expand Down
9 changes: 6 additions & 3 deletions src/langsmith/online-evaluations-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Set up online code evaluators
sidebarTitle: Code evaluators
---

import FilteringExperienceNote from '/snippets/langsmith/filtering-experience-note.mdx';
import OnlineEvaluatorRetentionNote from '/snippets/langsmith/online-evaluator-retention-note.mdx';

[Online evaluations](/langsmith/evaluation-concepts#online-evaluations) provide real-time feedback on your production [traces](/langsmith/observability-concepts#traces). This is useful to continuously monitor the performance of your application: identify issues, measure improvements, and ensure consistent quality over time.
Expand Down Expand Up @@ -36,9 +37,11 @@ For example, you may want to apply specific evaluators based on:
- Runs that invoke a specific tool call. See [filtering for tool calls](/langsmith/filter-traces-in-application#example-filtering-for-tool-calls) for more information.
- Runs that match a particular piece of metadata (e.g. if you log traces with a `plan_type` and only want to run evaluations on traces from your enterprise customers). See [adding metadata to your traces](/langsmith/add-metadata-tags) for more information.

Evaluators use the filter builder, with the same fields and operators described in [Filter traces (ClickHouse)](/langsmith/filter-traces-in-application).
<FilteringExperienceNote />

To process feedback from an earlier evaluator, filter this evaluator for the feedback key, then read the score from `run["feedback"]`, or [include extended stats](/langsmith/evaluators#include-extended-stats) to read it from `run["feedback_stats"]`. For example, use `eq(feedback_key, "answer_usefulness")` to run when the `answer_usefulness` feedback exists. The filter is based on the feedback key, not the evaluator that produced it, so feedback from any source with that key triggers the code evaluator. For more information, see [Chain evaluators](/langsmith/evaluators#chain-evaluators).
In the evaluator panel, the search bar sits under **Trigger On**: select **Traces** or **Runs**, click **Filter**, and write a query. **Threads** appears only for [advanced code evaluators](/langsmith/advanced-code-evaluators#evaluate-threads). For the steps, refer to [Filter with the search bar](/langsmith/online-evaluations-llm-as-judge#filter-with-the-search-bar). The filter builder sits under **Filters**.

To process feedback from an earlier evaluator, filter this evaluator for the feedback key, then read the score from `run["feedback"]`, or [include extended stats](/langsmith/evaluators#include-extended-stats) to read it from `run["feedback_stats"]`. For example, to run when the `answer_usefulness` feedback exists, use `feedback.answer_usefulness:*` in the search bar or `eq(feedback_key, "answer_usefulness")` in the filter builder. The filter is based on the feedback key, not the evaluator that produced it, so feedback from any source with that key triggers the code evaluator. For more information, see [Chain evaluators](/langsmith/evaluators#chain-evaluators).

<Tip>
It's often helpful to inspect runs as you're creating a filter for your evaluator. With the evaluator configuration panel open, you can inspect runs and apply filters to them. Any filters you apply to the runs table will automatically be reflected in filters on your evaluator.
Expand All @@ -50,7 +53,7 @@ Configure a sampling rate to control the percentage of filtered runs that trigge

### 5. (Optional) Apply rule to past runs

Apply rule to past runs by toggling the **Apply to past runs** and entering a "Backfill from" date. This is only possible upon rule creation. Note: the backfill is processed as a background job, so you will not see the results immediately.
To apply the rule to past runs, expand **Advanced**, select **Apply to past runs from date...** under **Backfill**, then enter a date. This is only possible upon rule creation. Note: the backfill is processed as a background job, so you will not see the results immediately.

To track the backfill's progress, open the agent environment's **Online Evaluators** tab on the **Tracing** page and click **Logs** in your evaluator's row. Online evaluator logs are similar to [automation rule logs](/langsmith/rules#view-logs-for-your-automations).

Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/online-evaluations-decision-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To add a decision model online evaluator:
1. Click **+ Evaluator** to open the **Configure Evaluator** panel.
1. Under **Create from scratch**, select **Decision Model Evaluator**, then name your evaluator.
1. Select a decision model, map run or thread variables into the **State**, and add questions. For each setting, see [How to define a decision model evaluator](/langsmith/decision-model-evaluator).
1. (Optional) Apply a [filter](/langsmith/online-evaluations-llm-as-judge#apply-a-filter-to-runs-that-trigger-the-evaluator), set a [sampling rate](/langsmith/online-evaluations-llm-as-judge#configure-a-sampling-rate), or [apply the rule to past runs or threads](/langsmith/online-evaluations-llm-as-judge#apply-a-rule-to-past-runs-or-threads). These settings work the same way as for LLM-as-a-judge online evaluators.
1. (Optional) Apply a [filter](/langsmith/online-evaluations-llm-as-judge#apply-a-filter-to-runs-that-trigger-the-evaluator), set a [sampling rate](/langsmith/online-evaluations-llm-as-judge#configure-a-sampling-rate), or [apply the rule to past runs or threads](/langsmith/online-evaluations-llm-as-judge#apply-a-rule-to-past-runs-or-threads). These settings work the same way as for LLM-as-a-judge online evaluators, except that a decision model evaluator that runs on threads cannot save a [search bar](/langsmith/online-evaluations-llm-as-judge#filter-with-the-search-bar) filter.
1. To save the evaluator, click **Create** or **Save**.

The evaluator checks each new run or thread that matches its filter. Each question's answer appears under its own feedback key.
Expand Down
Loading
Loading