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

Chore: Use runtimeconfig from dskit #4227

Merged
merged 3 commits into from
Aug 31, 2021
Merged

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Aug 27, 2021

What this PR does / why we need it:
Use the runtimeconfig package from dskit.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated

@aknuds1 aknuds1 requested a review from a team as a code owner August 27, 2021 16:07
@aknuds1 aknuds1 force-pushed the chore/use-dskit-runtimeconfig branch from 3c3b53a to 5b08d87 Compare August 27, 2021 16:13
Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. You should probably rebase to drop the commit with flagext changes now that #4225 is merged.

@aknuds1
Copy link
Contributor Author

aknuds1 commented Aug 28, 2021

LGTM. You should probably rebase to drop the commit with flagext changes now that #4225 is merged.

@56quarters OK, can do that.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 force-pushed the chore/use-dskit-runtimeconfig branch from 5b08d87 to 62809c6 Compare August 28, 2021 07:52
@@ -149,7 +149,7 @@ func (t *Loki) initRuntimeConfig() (services.Service, error) {
validation.SetDefaultLimitsForYAMLUnmarshalling(t.Cfg.LimitsConfig)

var err error
t.runtimeConfig, err = runtimeconfig.NewRuntimeConfigManager(t.Cfg.RuntimeConfig, prometheus.DefaultRegisterer)
t.runtimeConfig, err = runtimeconfig.New(t.Cfg.RuntimeConfig, prometheus.DefaultRegisterer, util_log.Logger)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that dskit's runtimeconfig has metrics without "cortex_" prefix. If prefix is not used, metrics rename is worth mentioning somewhere. Loki project may also prefer to use "loki_" prefix instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pstibrany oh yeah, good catch. Thanks! @slim-bean WDYT?

Copy link
Collaborator

@kavirajk kavirajk Aug 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for having ability to choose prefix for runtime metrics!.

btw, Q: Looks like previously it was named with prefix cortex_ and now without prefix.

Won't that break some stuff in deployment_tools?

ksonnet/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/alerts/alerts.libsonnet
124:            cortex_runtime_config_last_reload_successful == 0

ksonnet/lib/tempo-cloud-mixin/alerts.libsonnet
36:                cortex_runtime_config_last_reload_successful{namespace=~"%s"} == 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kavirajk I can add back the cortex_ prefix. Omitted it by mistake 🤦‍♂️ If we have to keep the cortex_ prefix, I can add it back here (in the PR).

Does the deployment_tools snippet you pasted relate also to Loki? I.e., Loki has to keep the cortex_ prefix on metrics?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aknuds1 :) I quickly checked in deployment tools repo and looks like Loki doesn't use this metric in any dashboards or alerts. The ones I pasted are from Cortex and Tempo.

I see two options:

  1. keep cortex_ prefix as default and have ability to change the prefix when needed.
  2. No default, just accept prefix as argument.

In case 2, we should careful when Tempo or Cortex uses this change in their releases. (they should update the alerts accordingly)

Both options are fine IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix the PR to add back the cortex_ prefix.

Copy link
Contributor Author

@aknuds1 aknuds1 Aug 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back cortex_ prefix. I will leave it to Loki team to decide if they want to change the prefix to e.g. loki_ :)

@aknuds1 aknuds1 requested a review from kavirajk August 31, 2021 12:54
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants