-
-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for custom labels in Prometheus metrics
- Add a `Labels` field to the `Config` struct to include additional labels for metrics - Add a `Labels` field to the `Endpoint` struct to include key-value pairs for endpoint metrics - Inline the `CheckSSHBanner` call in the `call` function of the `Endpoint` struct - Import the `metrics` package in `main.go` and initialize Prometheus metrics - Modify `initializePrometheusMetrics` to accept a `Config` parameter and include labels in metric definitions - Update `PublishMetricsForEndpoint` to handle labels and include them in metric values - Update `metrics_test.go` to initialize Prometheus metrics with a `Config` and pass labels to `PublishMetricsForEndpoint` - Pass labels to the `monitor` and `execute` functions in `watchdog.go` and use them in metric publishing Signed-off-by: appleboy <[email protected]>
- Loading branch information
Showing
6 changed files
with
53 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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