Skip to content
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

refactor: remove disablemetrics for enablemetrics #554

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,9 @@ chartmuseum --debug --port=8080 \

## Prometheus Metrics

ChartMuseum exposes its [Prometheus metrics](https://prometheus.io/docs/concepts/metric_types/) at the `/metrics` route on the main port. This can be disabled with the `--disable-metrics` command-line flag or the `DISABLE_METRICS` environment variable.
ChartMuseum exposes its [Prometheus metrics](https://prometheus.io/docs/concepts/metric_types/) at the `/metrics` route on the main port. This can be enabled with the `--enable-metrics` command-line flag or the `ENABLE_METRICS` environment variable.

> Note that the Kubernetes chart currently disables metrics by default (`DISABLE_METRICS=true` is set in the chart).
> Note that the Kubernetes chart currently disables metrics by default (`ENABLE_METRICS=false` is set in the chart). The `--disable-metrics` command-line flag has be deprecated and will only be available in `v0.14.0` and prior.

Below are the current application metrics exposed. Note that there is a per tenant (repo) label. The repo label corresponds to the depth parameter, so a depth=2 as the example above would
have repo labels named `org1/repoa` and `org2/repob`.
Expand Down
2 changes: 1 addition & 1 deletion cmd/chartmuseum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func cliHandler(c *cli.Context) {
UseStatefiles: !conf.GetBool("disablestatefiles"),
AllowOverwrite: conf.GetBool("allowoverwrite"),
AllowForceOverwrite: !conf.GetBool("disableforceoverwrite"),
EnableMetrics: !conf.GetBool("disablemetrics"),
EnableMetrics: conf.GetBool("enablemetrics"),
AnonymousGet: conf.GetBool("authanonymousget"),
GenIndex: conf.GetBool("genindex"),
MaxStorageObjects: conf.GetInt("maxstorageobjects"),
Expand Down
12 changes: 11 additions & 1 deletion pkg/config/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,19 @@ var configVars = map[string]configVar{
Default: false,
CLIFlag: cli.BoolFlag{
Name: "disable-metrics",
Usage: "disable Prometheus metrics",
Usage: "(deprecated) disable Prometheus metrics",
EnvVar: "DISABLE_METRICS",
},
Deprecated: true,
},
"enablemetrics": {
Type: boolType,
Default: false,
CLIFlag: cli.BoolFlag{
Name: "enable-metrics",
Usage: "enable Prometheus metrics",
EnvVar: "ENABLE_METRICS",
},
},
"disableapi": {
Type: boolType,
Expand Down