Skip to content

Add observability documentation.#3055

Open
Malith-19 wants to merge 1 commit into
thunder-id:mainfrom
Malith-19:update-observability-docs
Open

Add observability documentation.#3055
Malith-19 wants to merge 1 commit into
thunder-id:mainfrom
Malith-19:update-observability-docs

Conversation

@Malith-19
Copy link
Copy Markdown
Member

@Malith-19 Malith-19 commented May 28, 2026

Purpose

Adds and expands observability documentation across the project. This covers three areas:

  • Operators guide — new pages explaining how to enable and configure observability output backends (console, file, OpenTelemetry) and a step-by-step guide for connecting to Jaeger, Grafana Tempo, or an OTel Collector.
  • Configuration reference — expands the observability section in the configuration reference with per-backend settings tables, the new failure_mode setting, event categories reference, and a full example snippet.
  • Contributing guide — updates the backend observability guide to reflect the current API: corrected import paths (internal/system/observability), updated event type constant naming convention (event.EventTypeX), added component constants, full event type and data key reference tables, and event categories.

Approach

The documentation is split by persona:

  • The deployment-patterns observability pages target operators configuring a ThunderID deployment.
  • The configuration reference page serves as the canonical settings reference, now with complete per-backend tables.
  • The contributing guide targets backend developers adding instrumentation to new components — updated to match the current package layout and API surface.

The sidebar is updated to register the new pages under the existing deployment patterns section.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided.
    • Ran Vale and fixed all errors and warnings
  • Tests provided.
    • Unit Tests
    • Integration Tests
  • Breaking changes.
    • Breaking changes section filled.
    • breaking change label added.

Security checks

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive Observability guide: event emission, Console/File/OpenTelemetry outputs, OTLP setup, and verification.
    • Expanded Observability configuration: top-level enablement, failure_mode handling, per-backend enablement/formatting, file paths, event category filtering, OTLP exporter settings, and a deployment example.
    • Updated contributing docs with revised integration examples, standardized event types, and expanded event anatomy reference.
    • Updated docs navigation to include the new Observability guide.
  • Style
    • Added accepted vocabulary terms: Grafana, Jaeger’s?, Tempo.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 24d93b83-f8f8-4fa5-b807-c6cdc6f6b9e6

📥 Commits

Reviewing files that changed from the base of the PR and between 1c514b3 and 7003293.

📒 Files selected for processing (5)
  • .vale/styles/config/vocabularies/vocab/accept.txt
  • docs/content/community/contributing/contributing-code/backend-development/observability.mdx
  • docs/content/guides/deployment-patterns/observability.mdx
  • docs/content/guides/getting-started/configuration.mdx
  • docs/sidebars.ts
✅ Files skipped from review due to trivial changes (3)
  • .vale/styles/config/vocabularies/vocab/accept.txt
  • docs/content/guides/deployment-patterns/observability.mdx
  • docs/content/guides/getting-started/configuration.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/content/community/contributing/contributing-code/backend-development/observability.mdx

📝 Walkthrough

Walkthrough

Documentation standardizes observability import paths and event constants, expands Event Anatomy and DataKey catalog, adds observability configuration (Console/File/OTel) and deployment/OTel setup guides, updates sidebar navigation, and extends Vale vocabulary for observability tooling.

Changes

Observability Documentation and Configuration

Layer / File(s) Summary
Backend observability development guide update
docs/content/community/contributing/contributing-code/backend-development/observability.mdx
Import paths updated to internal/system/observability and internal/system/observability/event; event examples now use predefined event constants; "Event Anatomy" rewritten with categories and a comprehensive event.DataKey catalog; tracing examples and subscriber/repo paths updated.
Getting-started configuration expansion
docs/content/guides/getting-started/configuration.mdx
"Observability Configuration" expanded: top-level enabled and failure_mode; Console/File/OpenTelemetry blocks (formats, file path, OTLP endpoint, sampling, insecure TLS); Event Categories reference and full deployment.yaml example.
Deployment pattern guide for observability
docs/content/guides/deployment-patterns/observability.mdx
New guide describing structured observability event routing, OTLP gRPC exporter setup, Collector/Jaeger/Tempo deployment examples, optional span/category filtering, and verification steps.
Navigation and vocabulary updates
docs/sidebars.ts, .vale/styles/config/vocabularies/vocab/accept.txt
Added "Observability" to Deployment Patterns sidebar; Vale accept list adds Grafana, Jaeger's?, and Tempo.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • thunder-id/thunderid#1459: Introduces the internal/system/observability package layout and predefined event/component constants that this PR's documentation examples standardize around.

Suggested labels

Type/Docs

Suggested reviewers

  • ThaminduDilshan
  • rajithacharith
  • darshanasbg
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change — adding observability documentation across multiple areas of the project.
Description check ✅ Passed The description is comprehensive, addressing Purpose, Approach, Related Issues, and completing most checklist items; documentation and manual testing were performed with Vale fixes applied.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/content/community/contributing/contributing-code/backend-development/observability.mdx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

docs/content/guides/deployment-patterns/observability.mdx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

docs/content/guides/getting-started/configuration.mdx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 1 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Malith-19 Malith-19 added documentation Improvements or additions to documentation skip-changelog Skip generating changelog for a particular PR labels May 28, 2026
@Malith-19 Malith-19 self-assigned this May 28, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/sidebars.ts (1)

643-643: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Sidebar label hardcodes the brand name.

Is this hardcoded brand name intentional? Replace 'Contribute to ThunderID' with a config-derived string (for example, `Contribute to ${productConfig.project.name}`).

As per coding guidelines, **/*.ts and docs/** must not hardcode Thunder/ThunderID; use config-driven product naming.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/sidebars.ts` at line 643, The sidebar entry currently hardcodes the
brand in the label ({type: 'doc', id: 'community/contributing/overview', label:
'Contribute to ThunderID'}); update this to use the product name from
configuration (e.g., build the label string from productConfig.project.name) so
it becomes config-driven rather than hardcoded; locate the sidebar entry in
docs/sidebars.ts and replace the literal label with a template that reads the
product name from the existing productConfig (or import productConfig if not
present) and formats it like "Contribute to ${productConfig.project.name}".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/guides/deployment-patterns/observability/index.mdx`:
- Line 5: The frontmatter description contains a hardcoded product name
"ThunderID"; update the frontmatter key `description` so that the value uses the
placeholder `{{ProductName}}` instead of the literal "ThunderID" (e.g., change
the string that currently mentions ThunderID to use {{ProductName}}) to comply
with docs frontmatter guidelines.
- Line 54: Replace the hardcoded brand string "ThunderID" in the "[Set Up
OpenTelemetry] — Connect ThunderID to Jaeger, Grafana Tempo, or an OpenTelemetry
Collector." bullet with the JSX component <ProductName /> so the line reads
"[Set Up OpenTelemetry] — Connect <ProductName /> to Jaeger, Grafana Tempo, or
an OpenTelemetry Collector.", ensuring you use the MDX component syntax (not a
plain string).
- Line 10: Replace the hardcoded brand string "ThunderID" in the paragraph that
begins "ThunderID emits structured events for key identity operations — token
issuance, authentication flow execution, and authorization decisions." with the
JSX token <ProductName /> so the sentence reads "<ProductName /> emits
structured events..." to comply with the docs MDX guideline.

In `@docs/content/guides/deployment-patterns/observability/opentelemetry.mdx`:
- Around line 22-57: Replace hardcoded "ThunderID" occurrences in the
opentelemetry.mdx doc with the product component <ProductName />: update the
prerequisites bullet ("A running ThunderID instance..."), the list item that
mentions "ThunderID server", the YAML example value for service_name
("thunderid-iam") if intended to be the product identifier, and the restart note
("ThunderID must be restarted...") so all prose and example values use
<ProductName /> where the brand is referenced; ensure the JSX tag is used
verbatim in the markdown and that surrounding punctuation/quoting in the YAML
example remains valid.
- Around line 64-113: Replace all hardcoded "ThunderID" occurrences in the shown
MDX content with the MDX component <ProductName /> (e.g., "receives spans from
<ProductName />", "Run the Collector alongside <ProductName />", "Point
<ProductName /> directly..."). Update only the prose (not code blocks unless the
product name is inside plaintext), ensure the self-closing component syntax
(<ProductName />) is used with surrounding punctuation preserved, and verify the
file continues to build as MDX after the replacements.
- Around line 188-203: This section hardcodes the product name ("ThunderID");
replace every occurrence of the literal "ThunderID" in this
OpenTelemetry/observability section with the MDX component <ProductName />
(e.g., change "After restarting ThunderID" -> "After restarting <ProductName
/>") and ensure the <ProductName /> component is imported at the top of the MDX
file if it isn’t already; keep all other wording intact and preserve MDX syntax
for inline component usage.
- Line 5: The frontmatter description currently hardcodes the product name
("description: Export ThunderID observability events..."); update that
frontmatter value to use the template variable by replacing "ThunderID" with
"{{ProductName}}" so the description reads like "description: Export
{{ProductName}} observability events as OpenTelemetry traces to backends such as
Jaeger or Grafana Tempo." Ensure the change is made only in the frontmatter
`description` field.
- Around line 10-16: Replace every hardcoded "ThunderID" in the shown intro
paragraph with the JSX component <ProductName /> so the MDX uses the product
placeholder; update the lines that mention spans/traces and the export sentence
(the occurrences within the functions "How It Works" and the initial description
block) to use <ProductName /> instead of the literal brand string, ensuring the
file continues to be valid MDX (keep existing punctuation and formatting
intact).

In `@docs/content/guides/getting-started/configuration.mdx`:
- Line 475: Replace the hardcoded brand string "ThunderID" in the MDX prose with
the product component tag <ProductName />; locate the sentence containing
"ThunderID supports three output backends — console, file, and OpenTelemetry
(OTel) — and you can enable any combination of them independently." and swap
"ThunderID" for <ProductName /> so the documentation uses the reusable component
instead of a literal brand name.

---

Outside diff comments:
In `@docs/sidebars.ts`:
- Line 643: The sidebar entry currently hardcodes the brand in the label ({type:
'doc', id: 'community/contributing/overview', label: 'Contribute to
ThunderID'}); update this to use the product name from configuration (e.g.,
build the label string from productConfig.project.name) so it becomes
config-driven rather than hardcoded; locate the sidebar entry in
docs/sidebars.ts and replace the literal label with a template that reads the
product name from the existing productConfig (or import productConfig if not
present) and formats it like "Contribute to ${productConfig.project.name}".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 79887dcd-7ae9-45eb-ac86-0d195e446169

📥 Commits

Reviewing files that changed from the base of the PR and between 090d450 and b58abd5.

📒 Files selected for processing (5)
  • docs/content/community/contributing/contributing-code/backend-development/observability.mdx
  • docs/content/guides/deployment-patterns/observability/index.mdx
  • docs/content/guides/deployment-patterns/observability/opentelemetry.mdx
  • docs/content/guides/getting-started/configuration.mdx
  • docs/sidebars.ts

Comment thread docs/content/guides/deployment-patterns/observability/index.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/index.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/index.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/opentelemetry.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/opentelemetry.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/opentelemetry.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/opentelemetry.mdx Outdated
Comment thread docs/content/guides/deployment-patterns/observability/opentelemetry.mdx Outdated
Comment thread docs/content/guides/getting-started/configuration.mdx Outdated
@Malith-19 Malith-19 force-pushed the update-observability-docs branch 2 times, most recently from b823807 to e7494ff Compare May 28, 2026 08:34
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

sahandilshan
sahandilshan previously approved these changes May 28, 2026
Comment thread docs/content/guides/deployment-patterns/observability/index.mdx Outdated
@Malith-19 Malith-19 force-pushed the update-observability-docs branch 3 times, most recently from 1c514b3 to 576f650 Compare May 29, 2026 08:47
@Malith-19
Copy link
Copy Markdown
Member Author

@coderabbitai review

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/sidebars.ts (1)

758-758: ⚡ Quick win

Is this hardcoded brand name intentional?

The label contains a hardcoded "ThunderID" string literal. For consistency with the rest of this file (lines 73, 78), consider using the product name from config:

📝 Proposed fix
-        {type: 'doc', id: 'community/contributing/overview', label: 'Contribute to ThunderID'},
+        {type: 'doc', id: 'community/contributing/overview', label: `Contribute to ${productConfig.project.name}`},

As per coding guidelines, **/*.ts files should avoid hardcoded "Thunder" or "ThunderID" literals and instead read the value from the app's config system.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/sidebars.ts` at line 758, The sidebar entry currently hardcodes the
label 'Contribute to ThunderID'; replace that string with the shared
product-name value used elsewhere in this file by importing and using the same
config export (the product name constant/selector used on lines with other
labels) instead of a literal, and add the corresponding import at the top of
docs/sidebars.ts so the menu object uses the config-derived product name for its
label.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/sidebars.ts`:
- Line 758: The sidebar entry currently hardcodes the label 'Contribute to
ThunderID'; replace that string with the shared product-name value used
elsewhere in this file by importing and using the same config export (the
product name constant/selector used on lines with other labels) instead of a
literal, and add the corresponding import at the top of docs/sidebars.ts so the
menu object uses the config-derived product name for its label.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 88bf3c77-00f9-4a24-9152-abfb44a1e0bc

📥 Commits

Reviewing files that changed from the base of the PR and between fc02ba3 and 1c514b3.

📒 Files selected for processing (5)
  • .vale/styles/config/vocabularies/vocab/accept.txt
  • docs/content/community/contributing/contributing-code/backend-development/observability.mdx
  • docs/content/guides/deployment-patterns/observability.mdx
  • docs/content/guides/getting-started/configuration.mdx
  • docs/sidebars.ts
✅ Files skipped from review due to trivial changes (4)
  • docs/content/guides/deployment-patterns/observability.mdx
  • .vale/styles/config/vocabularies/vocab/accept.txt
  • docs/content/guides/getting-started/configuration.mdx
  • docs/content/community/contributing/contributing-code/backend-development/observability.mdx

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Malith-19 Malith-19 force-pushed the update-observability-docs branch from 576f650 to 96e38d2 Compare May 29, 2026 08:51
@Malith-19 Malith-19 force-pushed the update-observability-docs branch from 96e38d2 to 7003293 Compare May 29, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skip-changelog Skip generating changelog for a particular PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants