Skip to content

Added documentation of the Routing Metrics & Observability features in fluent bit 4.2 to router docs. Fixes #2205.#2206

Merged
eschabell merged 2 commits intofluent:masterfrom
eschabell:erics_routing_metrics_o11y
Nov 25, 2025
Merged

Added documentation of the Routing Metrics & Observability features in fluent bit 4.2 to router docs. Fixes #2205.#2206
eschabell merged 2 commits intofluent:masterfrom
eschabell:erics_routing_metrics_o11y

Conversation

@eschabell
Copy link
Collaborator

@eschabell eschabell commented Nov 25, 2025

Added documentation of the Routing Metrics & Observability features in fluent bit 4.2 to router docs. Fixes #2205.

Summary by CodeRabbit

  • Documentation
    • Expanded routing docs with a new "Context types" section listing available context fields for condition rules (body, metadata, group metadata/attributes, and OpenTelemetry-related attributes) and examples.
    • Added a "Routing metrics" section describing Prometheus-format metrics, label meanings, how to enable/access them via the HTTP endpoint, configuration snippets, and sample outputs.

✏️ Tip: You can customize this high-level summary in your review settings.

…n fluent bit 4.2 to router docs. Fixes #2205.

Signed-off-by: Eric D. Schabell <eric@schabell.org>
@eschabell eschabell self-assigned this Nov 25, 2025
@eschabell eschabell requested review from a team as code owners November 25, 2025 16:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

Updated pipeline/router.md to add a "Context types" section enumerating available context fields for condition evaluation and a "Routing metrics" section documenting Prometheus-format routing metrics, labels, and how to access them via the HTTP server.

Changes

Cohort / File(s) Change Summary
Router documentation
pipeline/router.md
Added a "Context types" section listing body, metadata, group_metadata, group_attributes, otel_resource_attributes, otel_scope_attributes, otel_scope_metadata with descriptions; updated condition rule context reference to point to the new section; added "Routing metrics" section describing Prometheus-format metrics, labels, example outputs, and HTTP /metrics access instructions with config snippets.

Sequence Diagram(s)

sequenceDiagram
  %% Styling for readability
  participant Event as Event (log)
  participant Router as Router
  participant Eval as Condition Evaluator\n(using Context types)
  participant Route as Route Decision
  participant Metrics as Metrics Exporter\n(/metrics)

  rect rgb(230, 247, 255)
    Event->>Router: incoming event
    Router->>Eval: evaluate conditions\n(context: body/metadata/group_*/otel_*)
    Eval-->>Router: match / no-match
    Router->>Route: forward to matched route(s)
  end

  rect rgb(255, 247, 230)
    Router->>Metrics: increment routing metrics\n(e.g., routed_total, unmatched_total, dropped_total)
    Metrics-->>/metrics: exposed via HTTP endpoint
  end

  note over Metrics: Metrics use Prometheus format with labels\n(service, pipeline, route, reason)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check accuracy of listed context keys and descriptions against implementation.
  • Verify Prometheus metric names, label names, and example output match code that exposes /metrics.
  • Confirm HTTP server config snippets and example endpoints are correct.

Possibly related PRs

Poem

🐰 In tunnels of docs I quietly hop,
I plant context seeds and watch metrics pop.
Routes hum with counters, labels in tune,
Docs bloom like clover beneath the moon. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding documentation for Routing Metrics & Observability features to router docs, and references the linked issue.
Linked Issues check ✅ Passed The PR addresses all three coding-related requirements from issue #2205: Routing Metrics documentation, Metrics Export via /metrics endpoint, and Context-based Routing with updated router.md sections.
Out of Scope Changes check ✅ Passed All changes are within scope—only router.md documentation was modified to add Context types and Routing metrics sections as specified in the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9440e2 and a273e87.

📒 Files selected for processing (1)
  • pipeline/router.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pipeline/router.md

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.

Copy link
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: 1

🧹 Nitpick comments (1)
pipeline/router.md (1)

250-250: Address the style guide violation flagged by Vale on the use of "below".

Line 250 uses "See context types below," which triggers a style guide warning. Consider rephrasing to avoid directional language, such as "See the Context types section" or "See Context types for details."

-| `context` | Optional. Specifies where to look for the field. See context types below. Defaults to `body`. |
+| `context` | Optional. Specifies where to look for the field. See the Context types section. Defaults to `body`. |
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60a2d7f and a9440e2.

📒 Files selected for processing (1)
  • pipeline/router.md (2 hunks)
🧰 Additional context used
🪛 GitHub Check: runner / vale
pipeline/router.md

[warning] 250-250:
[vale] reported by reviewdog 🐶
[FluentBit.Directional] Verify your use of 'below' with the Style Guide.

Raw Output:
{"message": "[FluentBit.Directional] Verify your use of 'below' with the Style Guide.", "location": {"path": "pipeline/router.md", "range": {"start": {"line": 250, "column": 82}}}, "severity": "INFO"}

🔇 Additional comments (1)
pipeline/router.md (1)

252-264: Context types section is well-documented and addresses PR objectives.

The new "Context types" section clearly documents the seven supported context options with concise descriptions. This directly addresses the PR objective to document context-based routing for dynamic routing decisions. The table format is consistent with existing documentation patterns.

Signed-off-by: Eric D. Schabell <eric@schabell.org>
@eschabell
Copy link
Collaborator Author

AI review passed, merging.

@eschabell eschabell merged commit 8f61f66 into fluent:master Nov 25, 2025
8 checks passed
@eschabell eschabell deleted the erics_routing_metrics_o11y branch November 25, 2025 19:08
@eschabell eschabell added the 4.2 label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Feature 4.2 - Routing Metrics & Observability documentation needed.

1 participant