-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: updates for tsdb blocks handling #1928
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
base: main
Are you sure you want to change the base?
Conversation
kakkoyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering these issues slipped through the cracks, I would really appreciate if you could add more comprehensive tests so that we prevent similar future issues.
Thanks in advance 🙏
|
That's fair, I can expand tests. Ideally, it would be simpler to just import prometheus itself as a library and use the types already defined for these in prometheus. That would obviously help to keep things in sync and benefit from existing testing there. It becomes a bit awkward though, since prometheus itself also imports the client_golang library (mostly for implementing metrics) and so we'd be importing ourselves and nearing a circular import. It would also blow up dependencies, and I know this library is already heavily used/strictly watched for deps. Perhaps this is a situation where a little bit of copying is better than a little bit of dependency? |
Two small fixes: - I forgot the implementation for `*apiClientImpl.Do()` already extracts the response content from the enveloped `data` field in the response, so the wrapper struct isn't needed here. - The `compaction` section of a block has an optional `parents` field for tracking block lineage in deeper compaction levels. This slipped my mind during implementation because I was looking at the example API response on the API docs, which use a mock response with a single block that is uncompacted. I noticed these while working on tjhop/prometheus-mcp-server#77 Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
we've been bit by missing fields and bad parity already, so this drammatically expands test coverage for the tsdb blocks endpoint to more ocmprehensively handle optional fields, unset fields, etc etc. Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
60bdf9b to
d78b175
Compare
My commit hook didn't run it seems. Oops. Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
|
Both of the checks that are failing are for @kakkoyun sorry it's been a bit -- if you get some more time, I'd appreciate some fresh eyes please! |
Two small fixes:
*apiClientImpl.Do()already extractsthe response content from the enveloped
datafield in the response,so the wrapper struct isn't needed here.
compactionsection of a block has an optionalparentsfieldfor tracking block lineage in deeper compaction levels. This slipped
my mind during implementation because I was looking at the example API
response on the API docs, which use a mock response with a single block
that is uncompacted.
I noticed these while working on tjhop/prometheus-mcp-server#77
Signed-off-by: TJ Hoplock t.hoplock@gmail.com