Skip to content

Runnable monitoring example#814

Open
dahlia wants to merge 5 commits into
fedify-dev:mainfrom
dahlia:examples/monitoring
Open

Runnable monitoring example#814
dahlia wants to merge 5 commits into
fedify-dev:mainfrom
dahlia:examples/monitoring

Conversation

@dahlia

@dahlia dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member

Closes #745.

This adds a local monitoring example under examples/monitoring/. The example gives operators a stack they can run before connecting a real Fedify application: an OpenTelemetry Collector receives OTLP metrics, Prometheus scrapes the Collector and loads starter alert rules, Grafana provisions a Prometheus data source and the Fedify overview dashboard, and a small Deno process emits synthetic Fedify-shaped metrics so the dashboard has data immediately.

The Compose stack binds host ports to 127.0.0.1, since Grafana anonymous viewer access is enabled for this local example.

What changed

  • Added examples/monitoring/compose.yaml, OpenTelemetry Collector configuration, Prometheus configuration, Grafana provisioning, dashboard JSON, alert rules, and promtool rule tests.
  • Added examples/monitoring/sample-metrics.ts to emit sample series with bounded labels that match the metrics documented in docs/manual/opentelemetry.md.
  • Added examples/monitoring/validate.ts and mise run test:monitoring to check the Deno scripts, Compose config, Prometheus config/rules/rule tests, and Collector config.
  • Linked the example from examples/README.md, docs/manual/monitoring.md, and docs/manual/opentelemetry.md.

How to try it

From the repository root:

docker compose -f examples/monitoring/compose.yaml up

Then open:

examples/monitoring/README.md explains how to point a Deno, Node.js, Bun, or custom OpenTelemetry setup at the Collector.

Validation

  • mise run check
  • mise run test:monitoring

AI usage

This PR was prepared with assistance from Codex.

Add a runnable Docker Compose monitoring stack with an OpenTelemetry
Collector, Prometheus scrape and alert configuration, Grafana provisioning,
a Fedify overview dashboard, and synthetic sample metrics.

Wire the example into the workspace and example test list, add a dedicated
validation task, and link the manual pages to the runnable setup.

Fixes fedify-dev#745

Assisted-by: Codex:gpt-5.5
@netlify

netlify Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema ready!

Name Link
🔨 Latest commit 1b5546d
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a3805a7b489a40008be6c71
😎 Deploy Preview https://deploy-preview-814--fedify-json-schema.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

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: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 219b9ac6-0d32-41c0-ad66-4a2e50ecd778

📥 Commits

Reviewing files that changed from the base of the PR and between 7f4c58b and 1b5546d.

📒 Files selected for processing (1)
  • examples/monitoring/validate.ts

📝 Walkthrough

Walkthrough

Adds examples/monitoring/, a complete local observability stack for Fedify using Docker Compose, OpenTelemetry Collector, Prometheus, and Grafana. Includes a synthetic sample-metrics Deno script, Prometheus alert rules with unit tests, a Grafana overview dashboard JSON with provisioning, a validate.ts orchestration script, a test:monitoring mise task, and cross-links in the manual documentation.

Changes

Fedify monitoring example

Layer / File(s) Summary
Workspace registration and documentation cross-links
deno.json, examples/README.md, docs/manual/monitoring.md, docs/manual/opentelemetry.md
Registers ./examples/monitoring in the Deno workspace, adds a bullet for the monitoring example in the examples index, and appends a "runnable monitoring example" sentence with reference links in both manual pages.
Docker Compose stack and infrastructure configs
examples/monitoring/compose.yaml, examples/monitoring/otel-collector.yaml, examples/monitoring/prometheus.yaml, examples/monitoring/grafana/provisioning/dashboards/dashboards.yaml, examples/monitoring/grafana/provisioning/datasources/datasources.yaml, examples/monitoring/deno.json
Defines four Compose services (otel-collector, prometheus, grafana, sample-metrics), the OTel Collector pipeline (OTLP gRPC/HTTP → batch processor → Prometheus exporter on :9464), Prometheus scrape/global config with 5s intervals, and Grafana datasource/dashboard provisioning YAMLs. Adds the @opentelemetry/api import map for the sample-metrics service.
Synthetic sample-metrics generator
examples/monitoring/sample-metrics.ts
Declares all OTel metric instruments (counters, histograms, up-down counters, observable gauge) for HTTP, queue, activity, delivery, signature, lookup, and discovery metrics, plus CPU/memory. Emits synthetic metrics every 1s via OTLP with deterministic wave-based variability, observable callbacks for queue depth per role/state, and SIGTERM cleanup.
Prometheus alert rules and unit tests
examples/monitoring/prometheus-rules.yaml, examples/monitoring/prometheus-rules.test.yaml
Adds nine fedify.rules alerting rules (target down, missing Fedify metrics, queue backlog, delivery failures, 404/410 spikes, inbox processing latency, signature verification failures, discovery failures, and key lookup failures) with PromQL expressions, durations, severity labels, and annotated guidance. Includes three unit-test scenarios validating alert firing for outbound delivery and actor/WebFinger discovery failures.
Grafana fedify-overview dashboard JSON
examples/monitoring/grafana/dashboards/fedify-overview.json
Adds a 1321-line Grafana dashboard (UID fedify-overview, schema v41) with stat and timeseries panels covering HTTP throughput/p95 latency by endpoint, collector scrape health, queue backlog/in-flight/rates by role, inbox/queue task p95 latency, outbound delivery success/failure/permanent failure by status, signature verification/key fetch p95 latency and failure outcomes, WebFinger/actor discovery outcomes and latency, inbox/outbox activity rates, document/key lookup outcomes, and process CPU/memory context. Auto-refresh every 10s with 15-minute time window.
Validation and smoke-test orchestration
examples/monitoring/validate.ts
Implements comprehensive static checks (Deno typecheck, Docker Compose config, promtool config/rules/test validation, OTel Collector config), readiness polling with timeout and last-error capture, HTTP/JSON fetch with abort timeout, recursive Grafana dashboard PromQL expression extraction and validation against Prometheus endpoint, and an optional --smoke end-to-end integration test that orchestrates Compose stack startup, verifies Prometheus/Grafana/Collector health, validates dashboard provisioning (UID fedify-overview), checks required Prometheus sample metrics queryable, and ensures clean stack teardown via signal handlers.
CI task, test skip registration, and monitoring README
mise.toml, examples/test-examples/mod.ts, examples/monitoring/README.md
Adds the test:monitoring mise task running deno run -A examples/monitoring/validate.ts, registers monitoring in SKIPPED_EXAMPLES with a reason pointing to that task, and provides a comprehensive 229-line README covering Docker Compose startup/shutdown, Grafana/Prometheus/Collector endpoint links, validation commands, Fedify app metric export wiring (Deno OTLP env vars and Compose service hostname override), metric label cardinality constraints, dashboard panel coverage (HTTP, queue, inbox/outbox, delivery, signature, discovery, document/key lookup, process context), Fedify-specific alert rule symptom categories with threshold notes and paging/investigation guidance, and troubleshooting steps for empty dashboards, missing queue depth, port conflicts, and Prometheus metric naming differences.

Sequence Diagram(s)

sequenceDiagram
    participant FedifyApp as Fedify App
    participant SampleMetrics as sample-metrics (Deno)
    participant OtelCollector as OTel Collector :4317/:4318
    participant Prometheus as Prometheus :9090
    participant Grafana as Grafana :3000

    rect rgba(100, 149, 237, 0.5)
        Note over FedifyApp,OtelCollector: Metrics ingestion
        FedifyApp->>OtelCollector: OTLP/gRPC or HTTP metrics
        SampleMetrics->>OtelCollector: OTLP/HTTP synthetic metrics (every 1s)
    end

    rect rgba(144, 238, 144, 0.5)
        Note over OtelCollector,Prometheus: Scrape pipeline
        Prometheus->>OtelCollector: scrape :9464 (every 5s)
        Prometheus->>Prometheus: evaluate fedify.rules
    end

    rect rgba(255, 165, 0, 0.5)
        Note over Prometheus,Grafana: Visualization and provisioning
        Grafana->>Prometheus: PromQL queries (fedify-overview dashboard)
        Grafana->>Grafana: render panels (stat, timeseries)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • Example Grafana dashboard and Prometheus alert rules for Fedify metrics #745 — This PR directly implements issue #745: adds examples/monitoring/ with Docker Compose, OTel Collector config, Prometheus config and alert rules, Grafana provisioning, a Grafana overview dashboard, and a sample-metrics generator, satisfying all acceptance criteria including static validation, runnable stack, dashboard panels, and alert rules with testing.
  • Production monitoring dashboards and alerting guide #743 — The documentation cross-links added in docs/manual/monitoring.md and docs/manual/opentelemetry.md integrate the runnable monitoring example into the production monitoring guide, fulfilling issue #743's requirement to link example files from the guide.
  • Comprehensive OpenTelemetry metrics collection #316 — The monitoring example infrastructure and sample metrics align with the OpenTelemetry metrics collection proposal, providing demonstration and validation tooling for the metrics outlined in that issue.

Possibly related PRs

  • fedify-dev/fedify#813: Both PRs modify the docs/manual/monitoring.md and docs/manual/opentelemetry.md documentation to reference and cross-link the runnable monitoring example as part of the production monitoring guidance.

Suggested labels

type/documentation, component/otel

Suggested reviewers

  • sij411
  • 2chanhaeng
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Runnable monitoring example' clearly and concisely summarizes the main change: addition of an executable monitoring example with Docker Compose, Grafana, Prometheus, and sample metrics.
Description check ✅ Passed The description thoroughly explains the monitoring example implementation, references issue #745, outlines the components added (compose stack, sample metrics, validation tooling, documentation links), and provides usage instructions.
Linked Issues check ✅ Passed The PR fully addresses issue #745's acceptance criteria: includes runnable monitoring stack, Grafana dashboard JSON, Prometheus alert rules, OpenTelemetry Collector/Prometheus configuration, automatic dashboard provisioning, comprehensive dashboard panels, bounded labels without unbounded cardinality, alert annotations with guidance, example README, monitoring guide links, and validation tooling.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #745: monitoring example files, documentation updates linking to the example, test configuration updates (skipping examples/monitoring from general test suite), and build task additions for validation.

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

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

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new runnable monitoring example for Fedify, including configurations for OpenTelemetry Collector, Prometheus, Grafana, and a sample metrics generator. The review feedback identifies several critical issues with hallucinated, non-existent version numbers for Deno, Prometheus, Grafana, and the OTel Collector across the Docker Compose, datasource, validation, and dashboard files, which must be updated to valid stable versions to avoid deployment failures. Additionally, the reviewer suggests registering signal listeners in the validation script to ensure the Docker Compose stack is properly cleaned up when interrupted.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/grafana/dashboards/fedify-overview.json
Comment thread examples/monitoring/validate.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@examples/monitoring/compose.yaml`:
- Around line 30-33: In the Grafana service configuration, the
GF_AUTH_ANONYMOUS_ORG_ROLE environment variable is currently set to "Admin",
which grants full administrative privileges to unauthenticated users. Change
this value from "Admin" to "Viewer" to reduce unnecessary exposure while
maintaining the anonymous access functionality needed for the example stack.

In `@examples/monitoring/README.md`:
- Around line 30-33: Convert the three inline autolinks for Grafana, Prometheus,
and Collector Prometheus endpoint from their current inline format
(http://localhost:3000/d/fedify-overview/fedify-overview,
http://localhost:9090/, and http://localhost:9464/metrics) to reference-style
links. Replace each inline autolink with a reference like [Grafana][1],
[Prometheus][2], and [Collector Prometheus endpoint][3], then add the
corresponding link definitions at the end of the section using the format [1]:
http://localhost:3000/d/fedify-overview/fedify-overview, etc. Apply the same
conversion pattern to the URLs mentioned in lines 203-207.

In `@examples/monitoring/validate.ts`:
- Around line 152-158: The `fetchJson` function lacks request-level timeouts on
its fetch call, which can cause the validation to hang indefinitely instead of
failing fast. Add a timeout mechanism using AbortController to bound each HTTP
request with a short timeout duration (e.g., a few seconds). Create an
AbortController, set a timeout that aborts the request if it exceeds the limit,
and pass the abort signal to the fetch options. Apply this same timeout pattern
to all fetch calls in the file, including the readiness probe check referenced
at the end of the comment.
🪄 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: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1fa5ef77-1bd1-40f6-8197-c3fd3fbea057

📥 Commits

Reviewing files that changed from the base of the PR and between 6152d3d and c7332f8.

⛔ Files ignored due to path filters (1)
  • deno.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • deno.json
  • docs/manual/monitoring.md
  • docs/manual/opentelemetry.md
  • examples/README.md
  • examples/monitoring/README.md
  • examples/monitoring/compose.yaml
  • examples/monitoring/deno.json
  • examples/monitoring/grafana/dashboards/fedify-overview.json
  • examples/monitoring/grafana/provisioning/dashboards/dashboards.yaml
  • examples/monitoring/grafana/provisioning/datasources/datasources.yaml
  • examples/monitoring/otel-collector.yaml
  • examples/monitoring/prometheus-rules.test.yaml
  • examples/monitoring/prometheus-rules.yaml
  • examples/monitoring/prometheus.yaml
  • examples/monitoring/sample-metrics.ts
  • examples/monitoring/validate.ts
  • examples/test-examples/mod.ts
  • mise.toml

Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/README.md Outdated
Comment thread examples/monitoring/validate.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: c7332f8330

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Reduce anonymous Grafana access to viewer permissions, use reference-style
links in the monitoring README, and bound smoke-test HTTP probes with request
timeouts.  Also clean up the smoke Compose stack when validation is interrupted
by SIGINT or SIGTERM.

fedify-dev#814 (comment)
fedify-dev#814 (comment)
fedify-dev#814 (comment)
fedify-dev#814 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a local monitoring stack example for Fedify OpenTelemetry metrics, including a Docker Compose configuration, Grafana dashboards, Prometheus rules, a synthetic metrics generator, and a validation script. The code review identified critical issues where several non-existent versions of Docker images (OpenTelemetry Collector Contrib, Prometheus, Grafana, and Deno) were specified in the Compose file, datasource configuration, and validation script. Additionally, the documentation incorrectly references Deno 2.4 instead of Deno 2.0 or later for built-in OpenTelemetry support. Actionable suggestions were provided to update these to valid, stable versions to ensure the monitoring stack runs successfully.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/compose.yaml
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@examples/monitoring/README.md`:
- Around line 34-35: The documentation in README.md incorrectly states that
Grafana anonymous admin access is enabled, but the actual configuration in
compose.yaml sets GF_AUTH_ANONYMOUS_ORG_ROLE to Viewer. Update the text in the
warning statement (around line 34-35) to accurately reflect that anonymous
Viewer access (not admin access) is enabled for the local example, ensuring the
documentation matches the actual runtime configuration.
🪄 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: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9e6a3a6b-71e2-4d4a-b618-1da2a6da0b3f

📥 Commits

Reviewing files that changed from the base of the PR and between c7332f8 and 1e51083.

📒 Files selected for processing (3)
  • examples/monitoring/README.md
  • examples/monitoring/compose.yaml
  • examples/monitoring/validate.ts

Comment thread examples/monitoring/README.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e510832c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread examples/monitoring/compose.yaml
The local Grafana stack now grants anonymous Viewer access, so the
README should describe it that way.  The Deno 2.4+ command examples also
no longer need the obsolete OpenTelemetry unstable flag.

fedify-dev#814 (comment)
fedify-dev#814 (comment)
fedify-dev#814 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive local monitoring example stack for Fedify OpenTelemetry metrics, including a Docker Compose setup with Prometheus, Grafana, an OpenTelemetry Collector, and a synthetic metrics generator. It also adds Prometheus alerting rules, a pre-configured Grafana dashboard, and a validation script. The review feedback highlights several key improvements: guarding SIGTERM signal listeners to prevent runtime errors on Windows hosts, cancelling failed fetch response bodies to avoid resource leaks, and parallelizing Prometheus query evaluations during validation to improve performance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread examples/monitoring/sample-metrics.ts Outdated
Comment thread examples/monitoring/validate.ts Outdated
Comment thread examples/monitoring/validate.ts
Comment thread examples/monitoring/validate.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: ce7bf16bd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Guard SIGTERM listeners so the monitoring scripts can run on Windows,
release failed fetch response bodies, and validate independent Grafana
queries in parallel.

fedify-dev#814 (comment)
fedify-dev#814 (comment)
fedify-dev#814 (comment)
fedify-dev#814 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive, runnable monitoring example for Fedify. It packages an OpenTelemetry Collector, Prometheus, Grafana, alert rules, dashboard provisioning, and a synthetic metric generator into a Docker Compose stack. Additionally, the PR adds documentation links, integrates the example into the workspace, and implements a validation script with a corresponding test:monitoring task in mise.toml to perform static and smoke checks. No review comments were provided, so there is no further feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
examples/monitoring/validate.ts (1)

235-235: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider using the SmokeSignal type for consistency.

The cleanupAfterSignal function parameter uses an inline union type "SIGINT" | "SIGTERM" that duplicates the SmokeSignal type defined at line 208. Reusing the type would improve maintainability.

♻️ Suggested refactor
-  const cleanupAfterSignal = (signal: "SIGINT" | "SIGTERM", code: number) => {
+  const cleanupAfterSignal = (signal: SmokeSignal, code: number) => {
🤖 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 `@examples/monitoring/validate.ts` at line 235, The cleanupAfterSignal function
parameter uses an inline union type "SIGINT" | "SIGTERM" which duplicates the
SmokeSignal type already defined in the file. Replace the inline union type
annotation for the signal parameter with the SmokeSignal type to improve
consistency and maintainability across the codebase.
🤖 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.

Outside diff comments:
In `@examples/monitoring/validate.ts`:
- Line 235: The cleanupAfterSignal function parameter uses an inline union type
"SIGINT" | "SIGTERM" which duplicates the SmokeSignal type already defined in
the file. Replace the inline union type annotation for the signal parameter with
the SmokeSignal type to improve consistency and maintainability across the
codebase.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 53edca76-59ee-4b94-82da-083ca3041231

📥 Commits

Reviewing files that changed from the base of the PR and between ce7bf16 and 7f4c58b.

📒 Files selected for processing (2)
  • examples/monitoring/sample-metrics.ts
  • examples/monitoring/validate.ts

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 7f4c58b739

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Use the existing SmokeSignal alias for the smoke cleanup helper instead
of repeating the signal union inline.

fedify-dev#814

Assisted-by: Codex:gpt-5.5
@dahlia dahlia requested review from 2chanhaeng and sij411 June 21, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Example code related

Development

Successfully merging this pull request may close these issues.

Example Grafana dashboard and Prometheus alert rules for Fedify metrics

1 participant