-
Notifications
You must be signed in to change notification settings - Fork 2
added metrics for the crucial operations #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 Prometheus metrics instrumentation to track the performance and reliability of the deployment tracker's crucial operations. The changes enable monitoring of event processing and deployment record posting operations.
Key Changes:
- Introduces Prometheus metrics for event processing and API posting operations
- Adds a metrics HTTP server endpoint exposing metrics at
:9090/metrics - Instruments critical code paths with timing and status tracking
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/metrics/prom.go |
Defines Prometheus metric collectors for events and deployment record operations |
pkg/deploymentrecord/client.go |
Instruments HTTP POST operations with metrics and enhanced logging |
internal/controller/controller.go |
Adds metrics tracking for event processing duration and outcomes |
go.mod |
Adds Prometheus client library dependency (v1.23.2) and updates transitive dependencies |
cmd/deployment-tracker/main.go |
Starts metrics HTTP server and adds metrics port configuration flag |
README.md |
Documents new metrics endpoint, available metrics, and command-line flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this 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 Prometheus metrics instrumentation to track the performance and health of crucial operations in the deployment tracker, including Kubernetes event processing and deployment record API calls.
Key Changes:
- Added comprehensive Prometheus metrics for event processing and API operations
- Instrumented the controller to track event processing duration and success/failure rates
- Enhanced API client with metrics for deployment record posts and retry behavior
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/metrics/prom.go |
Defines Prometheus metrics for tracking event processing and API operations |
pkg/deploymentrecord/client.go |
Adds timing and success/failure metrics to the POST operation with enhanced logging |
internal/controller/controller.go |
Instruments event processing with duration and outcome metrics |
go.mod |
Adds prometheus client library dependency with version 1.23.2 |
cmd/deployment-tracker/main.go |
Starts HTTP server on port 9090 to expose Prometheus metrics |
README.md |
Documents the new metrics endpoint, available metrics, and command-line flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this 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 Prometheus metrics instrumentation to track the health and performance of the deployment tracker's crucial operations, including Kubernetes event processing and deployment record API posting.
Key changes:
- Introduces Prometheus metrics for event processing success/failure rates and durations
- Adds metrics for deployment record API operations including success, soft failures, and hard failures
- Exposes metrics via HTTP endpoint on port 9090 (configurable)
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/metrics/prom.go | Defines Prometheus metrics for event processing and deployment record posting operations |
| pkg/deploymentrecord/client.go | Instruments the PostOne method with timing metrics and failure counters |
| internal/controller/controller.go | Adds metrics collection for event processing duration and success/failure counts |
| go.mod | Adds prometheus/client_golang dependency and updates transitive dependencies |
| cmd/deployment-tracker/main.go | Starts HTTP server to expose Prometheus metrics endpoint |
| README.md | Documents the new metrics endpoint and available metrics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this 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 Prometheus metrics instrumentation to track the performance and reliability of crucial operations in the deployment tracker. The changes enable monitoring of event processing from the Kubernetes API and HTTP POST operations to GitHub's API.
Key changes:
- Introduced Prometheus metrics for tracking event processing success/failure rates and durations
- Added metrics for monitoring deployment record upload operations (success, soft failures, hard failures, and latency)
- Set up a metrics HTTP server endpoint on port 9090 (configurable)
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/metrics/prom.go | Defines Prometheus metric collectors for event processing and deployment record operations |
| pkg/deploymentrecord/client.go | Instruments the PostOne method with metrics and logging for tracking upload attempts and outcomes |
| internal/controller/controller.go | Adds timing and status metrics to event processing pipeline |
| go.mod | Adds prometheus client library dependency and updates transitive dependencies |
| cmd/deployment-tracker/main.go | Starts HTTP server for exposing Prometheus metrics endpoint |
| README.md | Documents the new metrics endpoint, available metrics, and command-line flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| github.com/prometheus/procfs v0.16.1 // indirect | ||
| github.com/spf13/pflag v1.0.6 // indirect | ||
| github.com/x448/float16 v0.8.4 // indirect | ||
| go.yaml.in/yaml/v2 v2.4.2 // indirect |
Closes https://github.com/github/package-security/issues/3985