-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📖 Add API documentation for metrics endpoint (#380)
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
- Loading branch information
Showing
7 changed files
with
335 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package api | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus/promhttp" | ||
"net/http" | ||
) | ||
|
||
// MetricsHandler godoc | ||
// @summary Get Prometheus metrics. | ||
// @description Get Prometheus metrics. | ||
// @description Wrapper for Prometheus-supplied handler. | ||
// @description Served on port defined by METRICS_PORT environment variable. | ||
// @tags metrics | ||
// @produce text/plain | ||
// @success 200 | ||
// @router /metrics [get] | ||
func MetricsHandler() http.Handler { | ||
return promhttp.Handler() | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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