Prom client#6
Merged
Merged
Conversation
Member
dantheuber
commented
Aug 17, 2025
- integrate prom-client for Prometheus metrics
- provide example http server utilizing pokeapi.co for a third party dependency
- added integration tests
- update readme to be more concise and remove emojis
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR integrates Prometheus metrics collection using prom-client library, adds comprehensive testing infrastructure, and provides a practical example server. The main enhancement allows dependency monitoring with standardized Prometheus metrics while maintaining backward compatibility.
- Replaced custom Prometheus format with industry-standard
prom-clientlibrary - Added integration testing with mock server and real HTTP dependencies
- Created example server demonstrating PokeAPI monitoring with metrics endpoint
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/monitor.test.ts | Added unit tests for prom-client integration and registry management |
| test/integration/mock-server.ts | New mock HTTP server for integration testing |
| test/integration/mock-server.integration.test.ts | Integration tests using mock server with DependencyMonitor |
| src/types/dependency-monitor-options.ts | Added registry and collectDefaultMetrics options |
| src/types/dependency-monitor-interface.ts | Added getPrometheusRegistry method to interface |
| src/monitor.ts | Major refactor to use prom-client instead of custom metrics formatting |
| package.json | Added prom-client dependency and version bump |
| example/server.js | Complete example HTTP server with PokeAPI monitoring |
| example/README.md | Documentation for the example server |
| README.md | Updated documentation to reflect new features and simplified structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.