Skip to content

Commit 5edcd0c

Browse files
authored
fix: broken Data Pipeline link and Send Data sidebar labels (opensearch-project#99)
1 parent f5337ae commit 5edcd0c

15 files changed

Lines changed: 244 additions & 18 deletions

File tree

AGENTS.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,42 @@ helm uninstall observability-stack-test
826826
- Provide both quick start and detailed explanations
827827
- Include troubleshooting sections
828828

829+
### Docs Site Development Workflow
830+
831+
The docs site is built with [Starlight](https://starlight.astro.build/) (Astro). Source files are in `docs/starlight-docs/`.
832+
833+
**Required workflow for all docs changes:**
834+
835+
1. **Build** — validates internal links via `starlight-links-validator` plugin. The build will fail if any internal links are broken. Never skip this step.
836+
```bash
837+
cd docs/starlight-docs && npm install && npm run build
838+
```
839+
840+
2. **Preview** — start a local preview server and visually verify changes.
841+
```bash
842+
bash docs/starlight-docs/test/preview.sh # start server
843+
# Open http://localhost:4321/docs in browser
844+
bash docs/starlight-docs/test/preview.sh --stop # stop server
845+
```
846+
847+
3. **Rebuild after changes** — if you make further edits, rebuild before previewing:
848+
```bash
849+
bash docs/starlight-docs/test/preview.sh --stop
850+
bash docs/starlight-docs/test/preview.sh --build
851+
bash docs/starlight-docs/test/preview.sh
852+
```
853+
854+
**Critical rules:**
855+
- **Never start the astro server directly** (e.g. `npx astro preview`, `nohup`, `npm run preview`). Always use `test/preview.sh` — it handles background process management correctly. Direct invocations will block the terminal.
856+
- **Always build before previewing.** The link validator only runs during build. Previewing without building first will show stale output.
857+
- **Never use `grep -P` (Perl regex)** — macOS does not support it. Use `sed` or `grep -E` instead.
858+
- **Verify the server is responding** after starting preview by checking `curl -s http://localhost:4321/docs` returns 200 before telling the user it's ready.
859+
860+
**Sidebar configuration:**
861+
- Sidebar labels and ordering are configured in `docs/starlight-docs/astro.config.mjs` — this is the single source of truth.
862+
- **Do not use frontmatter `sidebar.label` or `sidebar.order` to control group/section headings.** Frontmatter only controls individual page labels, not the group name shown in the sidebar for a directory. Use explicit `items` with `label` in `astro.config.mjs` instead (see "Send Data" and "Get Started" sections as examples).
863+
- Sections using `autogenerate` derive group labels from directory names (lowercase). Replace `autogenerate` with explicit `items` when proper casing or custom ordering is needed.
864+
829865
### Icons
830866

831867
Use OpenSearch UI (OUI) icons for documentation components. Browse the full set at https://oui.opensearch.org/1.23/#/display/icons. SVG sources are at https://github.com/opensearch-project/oui/tree/main/src/components/icon/assets. Prefer 32x32 icons over 16x16 for consistent sizing.

docs/starlight-docs/astro.config.mjs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { defineConfig } from 'astro/config';
33
import starlight from '@astrojs/starlight';
44
import mermaid from 'astro-mermaid';
5+
import starlightLinksValidator from 'starlight-links-validator';
56

67
// https://astro.build/config
78
export default defineConfig({
@@ -16,6 +17,9 @@ export default defineConfig({
1617
}),
1718
starlight({
1819
title: 'OpenSearch - Observability Stack',
20+
plugins: [starlightLinksValidator({
21+
errorOnLocalLinks: false,
22+
})],
1923
logo: {
2024
src: './src/assets/opensearch-logo-darkmode.svg',
2125
},
@@ -54,7 +58,25 @@ export default defineConfig({
5458
{
5559
label: 'Send Data',
5660
collapsed: true,
57-
autogenerate: { directory: 'send-data' },
61+
items: [
62+
{ label: 'Overview', link: '/send-data/' },
63+
{
64+
label: 'OpenTelemetry',
65+
autogenerate: { directory: 'send-data/opentelemetry' },
66+
},
67+
{
68+
label: 'Applications',
69+
autogenerate: { directory: 'send-data/applications' },
70+
},
71+
{
72+
label: 'Infrastructure',
73+
autogenerate: { directory: 'send-data/infrastructure' },
74+
},
75+
{
76+
label: 'Data Pipeline',
77+
autogenerate: { directory: 'send-data/data-pipeline' },
78+
},
79+
],
5880
},
5981
{
6082
label: 'Investigate',

docs/starlight-docs/package-lock.json

Lines changed: 138 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/starlight-docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"astro": "^5.6.1",
1515
"astro-mermaid": "^1.3.1",
1616
"mermaid": "^11.12.3",
17-
"sharp": "^0.34.2"
17+
"sharp": "^0.34.2",
18+
"starlight-links-validator": "^0.19.2"
1819
}
1920
}

docs/starlight-docs/src/content/docs/get-started/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ To fully remove, delete the repository directory.
103103

104104
- [Platform Overview](/docs/get-started/overview/) — architecture and data flow
105105
- [Core Concepts](/docs/get-started/core-concepts/) — key terms and ideas
106-
- [Quickstart](/docs/get-started/quickstart/) — send your first traces
106+
- [Quickstart](/docs/get-started/quickstart/first-traces/) — send your first traces

docs/starlight-docs/src/content/docs/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ OpenSearch Observability Stack is an **open-source, OpenTelemetry-native observa
2323
## Quickstarts
2424

2525
<LinkCard title="Install & Explore" href="/docs/get-started/installation/" description="Install the stack and explore traces already flowing from the built-in example services." />
26-
<LinkCard title="Send Your First Traces" href="/docs/get-started/quickstart/" description="Instrument an app with OpenTelemetry and see traces in dashboards." />
26+
<LinkCard title="Send Your First Traces" href="/docs/get-started/quickstart/first-traces/" description="Instrument an app with OpenTelemetry and see traces in dashboards." />
2727
<LinkCard title="Trace an AI Agent" href="/docs/ai-observability/agent-tracing/" description="Instrument an AI agent with GenAI semantic conventions and visualize the execution graph." />
2828

2929
<Aside type="tip">
@@ -41,4 +41,4 @@ The stack optionally ships with [example services](https://github.com/opensearch
4141
## Community
4242

4343
- [GitHub](https://github.com/opensearch-project/observability-stack) — issues, PRs, and discussions
44-
- [Contributing guide](/docs/contributing/) — how to contribute
44+
- [Contributing guide](https://github.com/opensearch-project/observability-stack/blob/main/CONTRIBUTING.md) — how to contribute

docs/starlight-docs/src/content/docs/sdks/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ The SDK configures a `BatchSpanProcessor` that exports in the background — you
4141

4242
## Related links
4343

44-
- [Agent Traces](/docs/apm/agent-traces/) — viewing traces in OpenSearch Dashboards
44+
- [Agent Traces](/docs/investigate/discover-traces/) — viewing traces in OpenSearch Dashboards
4545
- [Send Data](/docs/send-data/) — OTLP pipeline setup and collector configuration
4646
- [GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) — the OTel spec the SDKs follow

docs/starlight-docs/src/content/docs/sdks/javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ register({ autoInstrument: false });
259259
## Related links
260260

261261
- [Python SDK](/docs/sdks/python/) — Python equivalent
262-
- [Agent Traces](/docs/apm/agent-traces/) — viewing traces in OpenSearch Dashboards
262+
- [Agent Traces](/docs/investigate/discover-traces/) — viewing traces in OpenSearch Dashboards
263263
- [Send Data](/docs/send-data/) — OTLP pipeline and collector setup
264264
- [FAQ](/docs/sdks/faq/) — common questions
265265
- [npm](https://www.npmjs.com/package/opensearch-genai-sdk) — package page

docs/starlight-docs/src/content/docs/sdks/python.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ register(auto_instrument=False)
428428
## Related links
429429

430430
- [JavaScript SDK](/docs/sdks/javascript/) — TypeScript/Node.js equivalent
431-
- [Agent Traces](/docs/apm/agent-traces/) — viewing traces in OpenSearch Dashboards
431+
- [Agent Traces](/docs/investigate/discover-traces/) — viewing traces in OpenSearch Dashboards
432432
- [Send Data](/docs/send-data/) — OTLP pipeline and collector setup
433433
- [FAQ](/docs/sdks/faq/) — common questions
434434
- [GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) — OTel spec reference

docs/starlight-docs/src/content/docs/send-data/applications/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,6 @@ with tracer.start_as_current_span("llm.chat") as span:
264264
- [Applications overview](/docs/send-data/applications/)
265265
- [Auto-instrumentation](/docs/send-data/opentelemetry/auto-instrumentation/)
266266
- [Manual instrumentation](/docs/send-data/opentelemetry/manual-instrumentation/)
267-
- [Agent traces](/docs/apm/agent-traces/)
267+
- [Agent traces](/docs/investigate/discover-traces/)
268268
- [OpenTelemetry Python documentation](https://opentelemetry.io/docs/languages/python/) -- Official OTel Python SDK reference
269269
- [Python instrumentation libraries](https://opentelemetry.io/ecosystem/registry/?language=python&component=instrumentation) -- Available auto-instrumentation packages

0 commit comments

Comments
 (0)