Skip to content

feat: API monitoring#43

Closed
wylited wants to merge 14 commits intomainfrom
feat/monitoring
Closed

feat: API monitoring#43
wylited wants to merge 14 commits intomainfrom
feat/monitoring

Conversation

@wylited
Copy link
Copy Markdown
Member

@wylited wylited commented Jan 7, 2026

How this monitoring system will work is that each API service will expose a fastify-metrics endpoint at /metrics.
this is a Prometheus scrapable endpoint for our monitoring platform.

Furthermore, if provided, it will fastify will log automatically to a Loki logging server using pino-loki.

The rest of the setup for monitoring will be done on the server.

@wylited wylited self-assigned this Jan 7, 2026
@wylited wylited added the enhancement New feature or request label Jan 7, 2026
@wylited wylited requested a review from Copilot January 7, 2026 16:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive API monitoring capabilities to the Fastify-based template service by integrating Prometheus metrics collection and optional Loki logging.

Key Changes:

  • Adds fastify-metrics plugin to expose a /metrics endpoint for Prometheus scraping with default metrics enabled
  • Integrates pino-loki transport for optional centralized logging to a Loki server
  • Introduces optional LOKI_HOST environment variable for conditional logging configuration

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
yarn.lock Adds dependency resolutions for fastify-metrics (v12.1.0), pino-loki (v3.0.0), prom-client (v15.1.3), and their transitive dependencies
package.json Adds fastify-metrics and pino-loki as runtime dependencies
src/app.ts Configures metrics endpoint registration and conditional Loki logging transport based on LOKI_HOST environment variable
.env.example Documents the optional LOKI_HOST environment variable with example configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app.ts Outdated
Comment thread src/app.ts Outdated
Comment thread src/app.ts
Comment thread src/app.ts
Comment thread src/app.ts Outdated
@wylited wylited added this to the 26-early-spring milestone Jan 7, 2026
@wylited wylited marked this pull request as draft January 10, 2026 09:11
@wylited wylited marked this pull request as ready for review January 10, 2026 17:50
@wylited wylited requested a review from Copilot January 10, 2026 17:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Comment thread src/plugins/metrics.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app.ts
Comment thread test/routes/metrics.test.ts
Comment thread src/app.ts
Comment thread test/routes/metrics.test.ts
Comment thread src/app.ts Outdated
Comment thread src/app.ts Outdated
Comment thread .env.example
Comment thread src/app.ts
Comment thread src/app.ts
Comment thread src/app.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@FlandiaYingman
Copy link
Copy Markdown
Member

Fix the linter errors and this can be merged!

@wylited wylited marked this pull request as draft January 20, 2026 11:23
@wylited
Copy link
Copy Markdown
Member Author

wylited commented Jan 20, 2026

Switched to a draft momentarily until I can do more testing.

@wylited wylited marked this pull request as ready for review January 20, 2026 16:00
@wylited wylited closed this Jan 20, 2026
@FlandiaYingman
Copy link
Copy Markdown
Member

Let me know if you need any help

@polyipseity polyipseity deleted the feat/monitoring branch February 11, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants