Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/docs-metadata-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docs Metadata Guard

on:
pull_request:
paths:
- "data/docs/**"
- "next.config.js"
- "scripts/check-docs-metadata.js"
- "tests/docs-metadata.test.js"
- "tests/fixtures/**"
- "package.json"
- ".github/workflows/docs-metadata-guard.yml"

jobs:
check-metadata:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "20"

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive

- name: Run docs metadata tests
run: yarn test:docs-metadata

- name: Validate docs metadata
run: yarn check:docs-metadata
10 changes: 9 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
#!/usr/bin/env sh

set -e

echo 'husky (pre-commit): running lint-staged'
yarn lint-staged

STAGED_FILES=$(git diff --cached --name-only)

# Check for docs redirect changes
if printf '%s\n' "$STAGED_FILES" | grep -E '^(data/docs/.*\.mdx|next\.config\.js|scripts/check-doc-redirects\.js)$' >/dev/null; then
echo 'husky (pre-commit): verifying docs redirects'
yarn check:doc-redirects
else
echo 'husky (pre-commit): skipping docs redirect check (no relevant changes staged)'
fi

# Check for docs metadata
if printf '%s\n' "$STAGED_FILES" | grep -E '^data/docs/.*\.mdx$' >/dev/null; then
echo 'husky (pre-commit): validating docs metadata'
HUSKY_PRE_COMMIT=true yarn check:docs-metadata
else
echo 'husky (pre-commit): skipping docs metadata check (no documentation changes staged)'
fi
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ Thanks for helping improve SigNoz documentation. Clear, complete docs are critic
- Pre-commit behavior
- Runs `lint-staged` on staged files. ESLint and Prettier fix typical JS/TS/MD/MDX formatting and lint issues.
- When changes include docs or redirect-related files (`data/docs/**/*.mdx`, `next.config.js`, or `scripts/check-doc-redirects.js`), it runs `yarn check:doc-redirects` to ensure renamed/moved docs have permanent redirects.
- When changes include docs (`data/docs/**/*.mdx`), it runs `yarn check:docs-metadata` to ensure metadata such as date, description, tag, title is complete and correct.
- Fixing failures
- Lint/format: run `yarn lint` or re-stage after auto-fixes from Prettier/ESLint.
- Redirects: run `yarn check:doc-redirects` locally to see missing entries, then add a permanent redirect in `next.config.js` under `async redirects()`. Re-stage and commit.
- Metadata: run `yarn check:docs-metadata` locally to see missing/invalid entries, then update the metadata in the `.mdx` file. Re-stage and commit.
- Optional: `yarn test:doc-redirects` runs a small test for redirect rules.
- Hooks path
- The repo uses Husky v9 defaults (`core.hooksPath=.husky`). If your local Git still points elsewhere (e.g., `.husky/_` from older setups), run `git config core.hooksPath .husky` or re-run `yarn install` to refresh hooks.
Expand All @@ -54,6 +56,10 @@ Thanks for helping improve SigNoz documentation. Clear, complete docs are critic
- Triggers on PRs that touch `data/docs/**`, `next.config.js`, `scripts/check-doc-redirects.js`, tests, or `package.json`.
- Runs `yarn test:doc-redirects` and `yarn check:doc-redirects`.
- Fails if redirects are missing/invalid or tests fail. Fix by adding permanent redirects in `next.config.js` and re-running locally.
- Docs Metadata Guard
- Triggers on PRs that touch `data/docs/**`, `next.config.js`, `scripts/check-docs-metadata.js`, tests, or `package.json`.
- Runs `yarn test:docs-metadata` and `yarn check:docs-metadata`.
- Fails if title, date, description are missing/invalid, and warns if tags are missing from MDX files. Fix by adding relevant metadata in MDX file and re-running locally.
- Add to Onboarding (label-driven)
- When a PR is labeled `add-to-onboarding`, this job checks that the PR includes docs changes. If none are found, the job fails with a message.
- If docs are present, it auto-creates an onboarding issue listing changed docs and comments on the PR with a link.
Expand Down Expand Up @@ -163,6 +169,7 @@ Every doc should be skimmable and actionable.
```

- Use descriptive anchor text that makes the link destination clear. Avoid generic phrases like "here" or "link" and do not paste raw URLs into the body text.

- ✅ `Learn from the [Temporal Golang sample repository](https://github.com/SigNoz/temporal-golang-opentelemetry/tree/main)`
- ❌ `See (link)` or `Refer to https://github.com/...`

Expand Down
2 changes: 1 addition & 1 deletion data/docs/mastra-observability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ When you click on a trace in SigNoz, you'll see a detailed view of the trace, in

You can also check out our custom Mastra dashboard [here](https://signoz.io/docs/dashboards/dashboard-templates/mastra-dashboard/) which provides specialized visualizations for monitoring your Masrta usage in applications. The dashboard includes pre-built charts specifically tailored for LLM usage, along with import instructions to get started quickly.

<Figure src="/img/docs/llm/mastra/mastra-dashboard.webp" alt="Mastra Dashboard" caption="Mastra Dashboard Template" />
<Figure src="/img/docs/llm/mastra/mastra-dashboard.webp" alt="Mastra Dashboard" caption="Mastra Dashboard Template" />
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"lint": "next lint --fix --dir pages --dir app --dir components --dir lib --dir layouts --dir scripts",
"check:doc-redirects": "node scripts/check-doc-redirects.js",
"test:doc-redirects": "node --test tests/doc-redirects.test.js",
"check:docs-metadata": "node scripts/check-docs-metadata.js",
"test:docs-metadata": "node --test tests/docs-metadata.test.js",
"prepare": "husky"
},
"dependencies": {
Expand Down
Loading