Skip to content

Conversation

pstibrany
Copy link
Contributor

@pstibrany pstibrany commented Jan 22, 2020

This PR exposes metrics from TSDB's compactor "syncer" component. In Cortex, we instantiate multiple syncers, new one for each sync operation. Because of this, approach used to gather metrics is different from previous TSDB metrics work.

Here we register fixed set of metrics that are exported, and we update them when syncer has done its job, via defer c.syncerMetrics.gatherThanosSyncerMetrics(reg) in compactUser method.

Since tsdb.Compactor is reused between compactUser calls, we don't need to handle those metrics (they are expored with their original prometheus_tsdb_compactions prefix)

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
@pstibrany pstibrany marked this pull request as ready for review January 22, 2020 16:03
Copy link
Contributor

@thorfour thorfour left a comment

Choose a reason for hiding this comment

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

LGTM Thanks!

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Amazing job! ❤️ The new metrics helper design is way better and more flexible. It takes a bit of time to get into, but looks worth the effort to me.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@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.

LGTM

Co-Authored-By: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
@pracucci pracucci merged commit d68d3ab into cortexproject:master Jan 27, 2020
@pstibrany pstibrany deleted the tsdb-compactor-metrics branch January 28, 2020 11:49
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.

4 participants