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

Reuse FetcherMetrics from Thanos #3892

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented Mar 1, 2021

What this PR does:
In the PR #3625 I had to duplicate some internal Thanos code to track metadata fetcher metrics. I then submit a couple of Thanos PRs (thanos-io/thanos#3660 and thanos-io/thanos#3842) to expose it and in this PR I'm upgrading Thanos to reuse it.

Which issue(s) this PR fixes:
N/A

Checklist

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

Signed-off-by: Marco Pracucci <marco@pracucci.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

}
}

// Fetch implements metadata.MetadataFetcher.
func (f *BucketIndexMetadataFetcher) Fetch(ctx context.Context) (metas map[ulid.ULID]*metadata.Meta, partial map[ulid.ULID]error, err error) {
f.metrics.resetTx()
f.metrics.ResetTx()
Copy link
Contributor

Choose a reason for hiding this comment

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

thought(non-blocking): The upstream ResetTx function is not goroutine safe. Would it make sense to propagate that warning here with a comment indicating the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole MetadataFetcher.Fetch() is not required to be goroutine-safe (in Thanos it's not implemented in a goroutine-safe way too). I've updated the function comment.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci merged commit d7d8b9c into cortexproject:master Mar 2, 2021
@pracucci pracucci deleted the use-thanos-fetcher-metrics branch March 2, 2021 14:06
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.

3 participants