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

Make the cortex-mixin work on non-k8s deployments. #43

Merged
merged 10 commits into from
Apr 21, 2020
Merged

Conversation

tomwilkie
Copy link
Contributor

@tomwilkie tomwilkie commented Apr 19, 2020

But first, a bunch of refactoring to tidy the dashboards up:

  • Put all the mixin config in one place.
  • Make dashboardWithTagsAndLinks just an override on the dashboard constructor.
  • Factor out the helper functions.
  • Move the dashboards to separate files and namespace them off so they only have access to the config.
  • Add a AddRowIf helper to massively rationalise the inclusion / exclusion of rows.
  • Alter how we conditionally include dashboards themselves.
  • Use set-style selector for bigtable/cassandra/dynamodb.
  • Make the mixin by default not need any config, and generate dashboards for all possible permutations of tsdb, chunks, bigtable, dynamodb, cassandra, gcs, s3 etc.

- Put all the mixin config in one place.
- Make dashboardWithTagsAndLinks just an override on the dashboard constructor.
- Factor out the helper functions.

Signed-off-by: Tom Wilkie <tom@grafana.com>
- Move the dashboards to separate files and namespace them off so they only have access to the config.
- Add a AddRowIf helper to massively rationalise the inclusion / exclusion of rates.
- Alter how we conditionally include dashboards themselves.

Should be a no-op change to the dashboards themselve.

Signed-off-by: Tom Wilkie <tom@grafana.com>
Signed-off-by: Tom Wilkie <tom@grafana.com>
…le process mode.

Signed-off-by: Tom Wilkie <tom@grafana.com>
…ary.

Signed-off-by: Tom Wilkie <tom@grafana.com>
Signed-off-by: Tom Wilkie <tom@grafana.com>
Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

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

I took a quick look and had a few questions. I noticed some dashboards and the recording rules still have cluster hardcoded but I assume that will come later.

I really like the new style of using functions to generate these things.

cortex-mixin/config.libsonnet Outdated Show resolved Hide resolved
cortex-mixin/config.libsonnet Outdated Show resolved Hide resolved

// The ,ixin allow specialism of the job selector depending on if its a single binary
// deployment or a namespaced one.
jobMatcher(job)::
Copy link
Contributor

Choose a reason for hiding this comment

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

How are you going differentiate the metrics from each module using a Job? Is it going to be magic in the scrape config or are we going to allow cortex to run with component specific registries upstream?

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'm not sure this is actually much of a problem - redundant metrics exported by jobs (ie ingester metrics from the distributor) don't influence the final results (ie qps or latency). For almost all cases, we can target specific eg methods to get the qps/latency of a specific component. In some cases (kv stores) the metrics aren't broken out like that yet[1], but for eg caches they are. So I think we'll be okay.

Do you have a specific case in mind?

[1]cortexproject/cortex#2484

Co-Authored-By: Jacob Lisi <jacob.t.lisi@gmail.com>
@tomwilkie
Copy link
Contributor Author

Thanks for the feedback Jacob!

I noticed some dashboards and the recording rules still have cluster hardcoded but I assume that will come later.

I think we can get away with still having the cluster label in recording rules, even when the underlying metric doesn't have a cluster label. Its basically just ignored, and I prefer having consistent recording rules across deployments. We might even have multiple clusters of single process Cortex, and re-introduce the cluster label...

Signed-off-by: Tom Wilkie <tom@grafana.com>
@tomwilkie tomwilkie marked this pull request as ready for review April 19, 2020 20:13
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Result looks good to me, new organization makes lot of sense. I don't appreciate monster PR – these changes would be easy to split into smaller PRs.

Also, in my Grafana I have datasources pointing to single-binary Cortex and multi-service Cortex as well. Do you think it would be possible to handle such deployments by your dashboards somehow?

cortex-mixin/dashboard-utils.libsonnet Show resolved Hide resolved
Signed-off-by: Tom Wilkie <tom@grafana.com>
Signed-off-by: Tom Wilkie <tom@grafana.com>
@tomwilkie tomwilkie merged commit b6263cd into master Apr 21, 2020
@tomwilkie tomwilkie deleted the optional-k8s branch April 21, 2020 11:47
@pracucci pracucci mentioned this pull request May 6, 2020
simonswine pushed a commit to grafana/mimir that referenced this pull request Oct 18, 2021
Make the cortex-mixin work on non-k8s deployments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants