Skip to content

Commit 00ac85f

Browse files
anirudhaclaude
andauthored
docs: add PPL language reference with data-grounded examples (opensearch-project#143)
Add comprehensive PPL (Piped Processing Language) documentation section targeting Splunk SREs evaluating PPL for OpenSearch observability. New pages: - PPL overview with comparison to KQL and EQL - Command reference summary (50+ commands) - 27 individual command pages with Description, Syntax, Arguments, Usage notes, Basic/Extended examples, and See also - Function reference (200+ functions across 13 categories) - Observability examples with live playground links for OTel data - Masterclass pipelines (service health scorecard, GenAI cost analysis, Envoy log parsing, error pattern discovery, cross-signal correlation) All examples use real OTel data from logs-otel-v1* and otel-v1-apm-span-* indices. Text extraction patterns (grok, rex, parse, spath) verified against actual Envoy access logs and Kafka broker logs. Updated sidebar, main page, investigate page, and README to highlight PPL. Signed-off-by: Anirudha Jadhav <anirudha@nyu.edu> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5d6beb0 commit 00ac85f

73 files changed

Lines changed: 6835 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Observability Stack is an open-source stack designed for modern distributed syst
1515
- **OpenSearch**: Stores and indexes logs and traces for search and analysis
1616
- **Prometheus**: Stores time-series metrics data
1717
- **OpenSearch Dashboards**: Provides web-based visualization and exploration
18+
- **PPL (Piped Processing Language)**: Native query language for logs and traces — pipe-based, human-readable, 50+ commands
1819

1920
## See it in action
2021

@@ -441,8 +442,22 @@ The current configuration includes a custom OpenSearch Dockerfile (`docker-compo
441442

442443
Track progress: [OpenSearch 3.5.0 Release](https://github.com/opensearch-project/OpenSearch/releases)
443444

445+
## Query Language: PPL
446+
447+
The Observability Stack uses **Piped Processing Language (PPL)** as its native query language for logs and traces. PPL is a pipe-based language designed for the way operators actually investigate data:
448+
449+
```
450+
source = logs-otel-v1*
451+
| where severityNumber >= 17
452+
| stats count() as errors by `resource.attributes.service.name`
453+
| sort - errors
454+
```
455+
456+
PPL provides 50+ commands and 200+ functions covering search, aggregation, pattern discovery, machine learning, joins, and more. See the [PPL documentation](https://observability.opensearch.org/docs/ppl/) for the full reference with live playground examples.
457+
444458
## Documentation
445459

460+
- [PPL Language Reference](https://observability.opensearch.org/docs/ppl/) - Query language documentation with live examples
446461
- [AGENTS.md](AGENTS.md) - AI-optimized repository documentation
447462
- [CONTRIBUTING.md](CONTRIBUTING.md) - Development workflow and contribution guidelines
448463
- [examples/](examples/) - Language-specific instrumentation examples

docs/starlight-docs/astro.config.mjs

Lines changed: 105 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,6 @@ export default defineConfig({
6363
},
6464
],
6565
},
66-
{
67-
label: 'Agent Observability',
68-
collapsed: true,
69-
items: [
70-
{ label: 'Overview', link: '/ai-observability/' },
71-
{ label: 'Getting Started', link: '/ai-observability/getting-started/' },
72-
{ label: 'Framework Integrations', link: '/send-data/ai-agents/integrations/' },
73-
{ label: 'Agent Tracing', link: '/ai-observability/agent-tracing/' },
74-
{ label: 'Agent Graph & Path', link: '/ai-observability/agent-tracing/graph/' },
75-
{ label: 'Evaluation & Scoring', link: '/ai-observability/evaluation/' },
76-
{ label: 'Evaluation Integrations', link: '/ai-observability/evaluation-integrations/' },
77-
],
78-
},
79-
{
80-
label: 'Agent Health',
81-
collapsed: true,
82-
autogenerate: { directory: 'agent-health' },
83-
},
8466
{
8567
label: 'Send Data',
8668
collapsed: true,
@@ -104,11 +86,109 @@ export default defineConfig({
10486
},
10587
],
10688
},
89+
{
90+
label: 'PPL - Query Language',
91+
collapsed: true,
92+
items: [
93+
{ label: 'Overview', link: '/ppl/' },
94+
{ label: 'Command Reference', link: '/ppl/commands/' },
95+
{
96+
label: 'Search & Filter',
97+
collapsed: true,
98+
items: [
99+
{ label: 'search', link: '/ppl/commands/search/' },
100+
{ label: 'where', link: '/ppl/commands/where/' },
101+
],
102+
},
103+
{
104+
label: 'Fields & Transformation',
105+
collapsed: true,
106+
items: [
107+
{ label: 'fields', link: '/ppl/commands/fields/' },
108+
{ label: 'eval', link: '/ppl/commands/eval/' },
109+
{ label: 'rename', link: '/ppl/commands/rename/' },
110+
{ label: 'fillnull', link: '/ppl/commands/fillnull/' },
111+
{ label: 'expand', link: '/ppl/commands/expand/' },
112+
{ label: 'flatten', link: '/ppl/commands/flatten/' },
113+
],
114+
},
115+
{
116+
label: 'Aggregation & Statistics',
117+
collapsed: true,
118+
items: [
119+
{ label: 'stats', link: '/ppl/commands/stats/' },
120+
{ label: 'eventstats', link: '/ppl/commands/eventstats/' },
121+
{ label: 'streamstats', link: '/ppl/commands/streamstats/' },
122+
{ label: 'timechart', link: '/ppl/commands/timechart/' },
123+
{ label: 'trendline', link: '/ppl/commands/trendline/' },
124+
],
125+
},
126+
{
127+
label: 'Sorting & Limiting',
128+
collapsed: true,
129+
items: [
130+
{ label: 'sort', link: '/ppl/commands/sort/' },
131+
{ label: 'head', link: '/ppl/commands/head/' },
132+
{ label: 'dedup', link: '/ppl/commands/dedup/' },
133+
{ label: 'top', link: '/ppl/commands/top/' },
134+
{ label: 'rare', link: '/ppl/commands/rare/' },
135+
],
136+
},
137+
{
138+
label: 'Text Extraction',
139+
collapsed: true,
140+
items: [
141+
{ label: 'parse', link: '/ppl/commands/parse/' },
142+
{ label: 'grok', link: '/ppl/commands/grok/' },
143+
{ label: 'rex', link: '/ppl/commands/rex/' },
144+
{ label: 'patterns', link: '/ppl/commands/patterns/' },
145+
{ label: 'spath', link: '/ppl/commands/spath/' },
146+
],
147+
},
148+
{
149+
label: 'Data Combination',
150+
collapsed: true,
151+
items: [
152+
{ label: 'join', link: '/ppl/commands/join/' },
153+
{ label: 'lookup', link: '/ppl/commands/lookup/' },
154+
],
155+
},
156+
{
157+
label: 'Machine Learning',
158+
collapsed: true,
159+
items: [
160+
{ label: 'ml', link: '/ppl/commands/ml/' },
161+
],
162+
},
163+
{
164+
label: 'Metadata',
165+
collapsed: true,
166+
items: [
167+
{ label: 'describe', link: '/ppl/commands/describe/' },
168+
],
169+
},
170+
{ label: 'Function Reference', link: '/ppl/functions/' },
171+
{ label: 'Observability Examples', link: '/ppl/examples/' },
172+
],
173+
},
107174
{
108175
label: 'Discover',
109176
collapsed: true,
110177
autogenerate: { directory: 'investigate' },
111178
},
179+
{
180+
label: 'Agent Observability',
181+
collapsed: true,
182+
items: [
183+
{ label: 'Overview', link: '/ai-observability/' },
184+
{ label: 'Getting Started', link: '/ai-observability/getting-started/' },
185+
{ label: 'Framework Integrations', link: '/send-data/ai-agents/integrations/' },
186+
{ label: 'Agent Tracing', link: '/ai-observability/agent-tracing/' },
187+
{ label: 'Agent Graph & Path', link: '/ai-observability/agent-tracing/graph/' },
188+
{ label: 'Evaluation & Scoring', link: '/ai-observability/evaluation/' },
189+
{ label: 'Evaluation Integrations', link: '/ai-observability/evaluation-integrations/' },
190+
],
191+
},
112192
{
113193
label: 'Application Monitoring',
114194
collapsed: true,
@@ -120,7 +200,7 @@ export default defineConfig({
120200
autogenerate: { directory: 'dashboards' },
121201
},
122202
{
123-
label: 'Alerting & Detection',
203+
label: 'Alerting',
124204
collapsed: true,
125205
items: [
126206
{ label: 'Alerting', link: '/alerting/' },
@@ -129,7 +209,12 @@ export default defineConfig({
129209
],
130210
},
131211
{
132-
label: 'Reference',
212+
label: 'Agent Health',
213+
collapsed: true,
214+
autogenerate: { directory: 'agent-health' },
215+
},
216+
{
217+
label: 'SDKs, MCP & Clients',
133218
collapsed: true,
134219
items: [
135220
{ label: 'Python SDK', link: '/send-data/ai-agents/python/' },

docs/starlight-docs/src/content/docs/agent-health/cli.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ agent-health [serve] [options]
2828
|--------|-------------|---------|
2929
| `-p, --port <n>` | Server port | `4001` |
3030
| `-e, --env-file <path>` | Load env file | `.env` |
31-
| `--no-browser` | Skip auto-open browser | |
31+
| `--no-browser` | Skip auto-open browser | - |
3232

3333
```bash
3434
agent-health --port 8080 --env-file prod.env
@@ -94,14 +94,14 @@ agent-health benchmark [options]
9494

9595
| Option | Description | Default |
9696
|--------|-------------|---------|
97-
| `-n, --name <name>` | Benchmark name or ID | |
98-
| `-f, --file <path>` | JSON file of test cases to import and benchmark | |
97+
| `-n, --name <name>` | Benchmark name or ID | - |
98+
| `-f, --file <path>` | JSON file of test cases to import and benchmark | - |
9999
| `-a, --agent <key>` | Agent key (repeatable) | First enabled agent |
100100
| `-m, --model <id>` | Model override | Agent default |
101101
| `-o, --output <fmt>` | Output: `table`, `json` | `table` |
102-
| `--export <path>` | Export results to file | |
102+
| `--export <path>` | Export results to file | - |
103103
| `--format <type>` | Report format for `--export`: `json`, `html`, `pdf` | `json` |
104-
| `-v, --verbose` | Show per-test-case results and errors | |
104+
| `-v, --verbose` | Show per-test-case results and errors | - |
105105
| `--stop-server` | Stop the server after benchmark completes | Keep running |
106106

107107
**Modes:**
@@ -149,11 +149,11 @@ agent-health report -b <benchmark> [options]
149149

150150
| Option | Description | Default |
151151
|--------|-------------|---------|
152-
| `-b, --benchmark <id>` | Benchmark name or ID **(required)** | |
152+
| `-b, --benchmark <id>` | Benchmark name or ID **(required)** | - |
153153
| `-r, --runs <ids>` | Comma-separated run IDs | All runs |
154154
| `-f, --format <type>` | Report format: `json`, `html`, `pdf` | `html` |
155155
| `-o, --output <file>` | Output file path | Auto-generated |
156-
| `--stdout` | Write to stdout (JSON format only) | |
156+
| `--stdout` | Write to stdout (JSON format only) | - |
157157

158158
```bash
159159
agent-health report -b "Baseline" # HTML report (all runs)

docs/starlight-docs/src/content/docs/agent-health/configuration/index.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Settings are loaded in this order (later overrides earlier):
2929
|
3030
2. Environment variables (.env file)
3131
|
32-
3. JSON config file (agent-health.config.json) auto-created
32+
3. JSON config file (agent-health.config.json) - auto-created
3333
|
34-
4. TypeScript config file (agent-health.config.ts) optional, for custom agents/connectors
34+
4. TypeScript config file (agent-health.config.ts) - optional, for custom agents/connectors
3535
```
3636

3737
## JSON config file
@@ -138,19 +138,19 @@ Required for the Bedrock LLM judge and Claude Code agent.
138138
|----------|-------------|---------|
139139
| `AWS_PROFILE` | AWS profile to use | `default` |
140140
| `AWS_REGION` | AWS region | `us-west-2` |
141-
| `AWS_ACCESS_KEY_ID` | Explicit access key (alternative to profile) | |
142-
| `AWS_SECRET_ACCESS_KEY` | Explicit secret key | |
143-
| `AWS_SESSION_TOKEN` | Session token (for temporary credentials) | |
141+
| `AWS_ACCESS_KEY_ID` | Explicit access key (alternative to profile) | - |
142+
| `AWS_SECRET_ACCESS_KEY` | Explicit secret key | - |
143+
| `AWS_SESSION_TOKEN` | Session token (for temporary credentials) | - |
144144

145145
### OpenSearch Storage (optional)
146146

147147
Override the default file-based storage with an OpenSearch cluster.
148148

149149
| Variable | Description | Default |
150150
|----------|-------------|---------|
151-
| `OPENSEARCH_STORAGE_ENDPOINT` | Storage cluster URL | |
152-
| `OPENSEARCH_STORAGE_USERNAME` | Username | |
153-
| `OPENSEARCH_STORAGE_PASSWORD` | Password | |
151+
| `OPENSEARCH_STORAGE_ENDPOINT` | Storage cluster URL | - |
152+
| `OPENSEARCH_STORAGE_USERNAME` | Username | - |
153+
| `OPENSEARCH_STORAGE_PASSWORD` | Password | - |
154154
| `OPENSEARCH_STORAGE_TLS_SKIP_VERIFY` | Skip TLS verification | `false` |
155155

156156
### OpenSearch Observability (optional)
@@ -159,9 +159,9 @@ For viewing agent traces and logs.
159159

160160
| Variable | Description | Default |
161161
|----------|-------------|---------|
162-
| `OPENSEARCH_LOGS_ENDPOINT` | Logs cluster URL | |
163-
| `OPENSEARCH_LOGS_USERNAME` | Username | |
164-
| `OPENSEARCH_LOGS_PASSWORD` | Password | |
162+
| `OPENSEARCH_LOGS_ENDPOINT` | Logs cluster URL | - |
163+
| `OPENSEARCH_LOGS_USERNAME` | Username | - |
164+
| `OPENSEARCH_LOGS_PASSWORD` | Password | - |
165165
| `OPENSEARCH_LOGS_TRACES_INDEX` | Traces index pattern | `otel-v1-apm-span-*` |
166166
| `OPENSEARCH_LOGS_INDEX` | Logs index pattern | `ml-commons-logs-*` |
167167

@@ -191,5 +191,5 @@ $ agent-health doctor
191191

192192
## Next steps
193193

194-
- [Connectors](/docs/agent-health/configuration/connectors/) create custom connectors for your agent type
195-
- [CLI Reference](/docs/agent-health/cli/) all commands and options
194+
- [Connectors](/docs/agent-health/configuration/connectors/) - create custom connectors for your agent type
195+
- [CLI Reference](/docs/agent-health/cli/) - all commands and options

docs/starlight-docs/src/content/docs/agent-health/evaluations/experiments.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ To compare agents, run the same experiment multiple times with different agent/m
3131
## Running experiments from the CLI
3232

3333
```bash
34-
# Quick mode auto-creates a benchmark from all stored test cases
34+
# Quick mode - auto-creates a benchmark from all stored test cases
3535
npx @opensearch-project/agent-health benchmark
3636

37-
# Named mode runs a specific existing benchmark
37+
# Named mode - runs a specific existing benchmark
3838
npx @opensearch-project/agent-health benchmark -n "Baseline" -a my-agent
3939

40-
# File mode imports test cases from JSON and runs them
40+
# File mode - imports test cases from JSON and runs them
4141
npx @opensearch-project/agent-health benchmark -f ./test-cases.json -a my-agent
4242

43-
# With export save results to file
43+
# With export - save results to file
4444
npx @opensearch-project/agent-health benchmark -f ./test-cases.json -n "My Run" -a my-agent --export results.json
4545
```
4646

docs/starlight-docs/src/content/docs/agent-health/evaluations/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ A "Golden Path" is the expected trajectory an agent should follow to successfull
3232
- What reasoning steps are expected
3333
- What the final response should contain
3434

35-
The LLM judge doesn't require an exact match it evaluates whether the agent's actual trajectory achieves the expected outcomes through reasonable steps, even if the specific path differs.
35+
The LLM judge doesn't require an exact match - it evaluates whether the agent's actual trajectory achieves the expected outcomes through reasonable steps, even if the specific path differs.
3636

3737
## LLM Judge output
3838

@@ -64,5 +64,5 @@ AWS_SECRET_ACCESS_KEY=your_secret
6464

6565
## Next steps
6666

67-
- [Test Cases](/docs/agent-health/evaluations/test-cases/) create and manage evaluation scenarios
68-
- [Experiments](/docs/agent-health/evaluations/experiments/) run batch evaluations and compare results
67+
- [Test Cases](/docs/agent-health/evaluations/test-cases/) - create and manage evaluation scenarios
68+
- [Experiments](/docs/agent-health/evaluations/experiments/) - run batch evaluations and compare results

docs/starlight-docs/src/content/docs/agent-health/evaluations/test-cases.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ npx @opensearch-project/agent-health benchmark -f test-cases.json -a another-age
7676

7777
## Tips for good test cases
7878

79-
- **Make prompts specific and unambiguous** avoid vague instructions
80-
- **Include all necessary context data** the agent shouldn't need to guess
81-
- **Define clear, measurable expected outcomes** the judge needs concrete criteria
82-
- **Start with simple cases, add complexity gradually** build confidence before testing edge cases
83-
- **Use labels for organization** filter and group test cases by category, difficulty, or domain
79+
- **Make prompts specific and unambiguous** - avoid vague instructions
80+
- **Include all necessary context data** - the agent shouldn't need to guess
81+
- **Define clear, measurable expected outcomes** - the judge needs concrete criteria
82+
- **Start with simple cases, add complexity gradually** - build confidence before testing edge cases
83+
- **Use labels for organization** - filter and group test cases by category, difficulty, or domain

docs/starlight-docs/src/content/docs/agent-health/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This guide walks you through using Agent Health to evaluate AI agents. The appli
1010
## Prerequisites
1111

1212
**Required:**
13-
- **Node.js 18+** [download here](https://nodejs.org/)
13+
- **Node.js 18+** - [download here](https://nodejs.org/)
1414
- **npm** (comes with Node.js)
1515

1616
**Optional (for production use):**
@@ -51,7 +51,7 @@ Agent Health includes a built-in Travel Planner multi-agent demo, along with a D
5151

5252
- Simulates a multi-agent Travel Planner system with realistic trajectories
5353
- Agent types: Travel Coordinator, Weather Agent, Events Agent, Booking Agent, Budget Agent
54-
- No external endpoint required select "Demo Agent" in the agent dropdown
54+
- No external endpoint required - select "Demo Agent" in the agent dropdown
5555

5656
### Demo Judge
5757

@@ -125,7 +125,7 @@ Each step shows timestamp, duration, tool arguments (for actions), full tool out
125125

126126
## Next steps
127127

128-
- [Connect your own agent](/docs/agent-health/configuration/) configure Agent Health for your agent
129-
- [Create custom test cases](/docs/agent-health/evaluations/test-cases/) build test cases for your domain
130-
- [Run experiments](/docs/agent-health/evaluations/experiments/) batch evaluate across agents and models
131-
- [View traces](/docs/agent-health/traces/) visualize OpenTelemetry traces from your agent
128+
- [Connect your own agent](/docs/agent-health/configuration/) - configure Agent Health for your agent
129+
- [Create custom test cases](/docs/agent-health/evaluations/test-cases/) - build test cases for your domain
130+
- [Run experiments](/docs/agent-health/evaluations/experiments/) - batch evaluate across agents and models
131+
- [View traces](/docs/agent-health/traces/) - visualize OpenTelemetry traces from your agent

docs/starlight-docs/src/content/docs/agent-health/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
hidden: true
66
---
77

8-
Agent Health is an evaluation and observability framework for AI agents. It helps you measure agent performance through "Golden Path" trajectory comparison where an LLM judge evaluates agent actions against expected outcomes. Check out the [GitHub repository](https://github.com/opensearch-project/agent-health) for source code and contributions.
8+
Agent Health is an evaluation and observability framework for AI agents. It helps you measure agent performance through "Golden Path" trajectory comparison - where an LLM judge evaluates agent actions against expected outcomes. Check out the [GitHub repository](https://github.com/opensearch-project/agent-health) for source code and contributions.
99

1010
## Quick start
1111

@@ -50,8 +50,8 @@ For creating custom connectors, see [Connectors](/docs/agent-health/configuratio
5050

5151
## Next steps
5252

53-
- [Getting Started](/docs/agent-health/getting-started/) step-by-step walkthrough from install to first evaluation
54-
- [Evaluations](/docs/agent-health/evaluations/) how evaluations, test cases, and experiments work
55-
- [Trace Visualization](/docs/agent-health/traces/) real-time trace monitoring and comparison
56-
- [Configuration](/docs/agent-health/configuration/) connect your own agent and configure the environment
57-
- [CLI Reference](/docs/agent-health/cli/) all CLI commands and options
53+
- [Getting Started](/docs/agent-health/getting-started/) - step-by-step walkthrough from install to first evaluation
54+
- [Evaluations](/docs/agent-health/evaluations/) - how evaluations, test cases, and experiments work
55+
- [Trace Visualization](/docs/agent-health/traces/) - real-time trace monitoring and comparison
56+
- [Configuration](/docs/agent-health/configuration/) - connect your own agent and configure the environment
57+
- [CLI Reference](/docs/agent-health/cli/) - all CLI commands and options

0 commit comments

Comments
 (0)