Add self-monitoring metrics on separate port 8081#1382
Merged
Conversation
7b55606 to
aafb5a0
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive self-monitoring capabilities to the SLURM exporter by introducing a dedicated monitoring endpoint on port 8081. The changes enable tracking of the exporter's own health and performance metrics separately from SLURM business metrics.
- Introduces 5 self-monitoring Prometheus metrics with
slurm_exporter_prefix for collection performance tracking - Adds separate HTTP server on port 8081 for operational metrics isolation
- Updates Kubernetes PodMonitor to scrape both business and operational metrics endpoints
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/exporter/monitoring.go |
New monitoring metrics implementation with 5 self-tracking metrics |
internal/exporter/exporter.go |
Added monitoring server and instrumented metrics handler |
internal/exporter/collector.go |
Integrated monitoring metrics into collection lifecycle |
internal/render/exporter/pod_monitor.go |
Added second endpoint for monitoring metrics scraping |
internal/render/exporter/container.go |
Added monitoring port to container specification |
internal/consts/container.go |
Added monitoring endpoint constants |
cmd/exporter/main.go |
Added monitoring bind address flag |
docs/slurm-exporter.md |
Comprehensive documentation for self-monitoring features |
Comments suppressed due to low confidence (1)
internal/exporter/monitoring_test.go:125
- The getMetricValue helper function is defined but never used in the test file. This creates dead code that should either be utilized in tests or removed.
func getMetricValue(families []*dto.MetricFamily, name string, metricType string) float64 {
Implements Phase 2 of issue 1369 by adding comprehensive self-monitoring capabilities: - New monitoring server on port 8081 with 5 Prometheus metrics (slurm_exporter_ prefix) - Collection performance tracking: duration, attempts, failures, request counts - Separate HTTP endpoint to isolate operational metrics from business metrics - Single PodMonitor with dual endpoints for efficient Kubernetes resource usage - Added --monitoring-bind-address flag and comprehensive documentation Main metrics: collection_duration_seconds, collection_attempts_total, collection_failures_total, metrics_requests_total, metrics_exported
aafb5a0 to
f1d6648
Compare
Uburro
approved these changes
Aug 6, 2025
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.
Add self-monitoring capabilities:
slurm_exporter_prefix)--monitoring-bind-addressflag and comprehensive documentationThis enables monitoring of the exporter's own health and performance separate from SLURM business metrics.