-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
receive: Enable exemplars ingestion and querying #4292
Conversation
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.
I've done a review but it's not on the technical part but more 'usability' part :) Really looking forward to this feature 👍
@@ -104,6 +135,18 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq *prompb.WriteR | |||
level.Warn(r.logger).Log("msg", "Error on ingesting samples that are too old or are too far into the future", "numDropped", numOutOfBounds) | |||
errs.Add(errors.Wrapf(storage.ErrOutOfBounds, "add %d samples", numOutOfBounds)) | |||
} | |||
if numExemplarsOutOfOrder > 0 { | |||
level.Warn(r.logger).Log("msg", "Error on ingesting out-of-order exemplars", "numDropped", numExemplarsOutOfOrder) |
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.
It's a level warn, but the logger msg says it's an error. I would make the message more generic and let log level handle the prefix, like: "warn: exemplars out of order" or something like that.
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.
I was following what we do for samples. I'd like other's opinion here as well to either switch to level.Error
, remove Error
from message, or keep it as it.
I think the message was there to indicate there is an error, but it's not fatal maybe?
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.
I think we are not too strict here, so it's fine to say error if it's only a warning about the not serious error.
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.
If we handle the returned error on upper levels (this could be logging as well), we don't need to log/handle it twice. I see that you've just followed the existing structure so it seems ok for now.
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.
hm.. what I don't like is duplicate error handling. We both add error and warn error... Wonder if we could just handle that on caller side instead. 🤔
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.
Yeah, this is a bit icky but as Kemal noted I was just following the existing structure we use for sample. I think I can try refactoring this in a follow up PR if that's ok.
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.
I don't see the code of forwarding exemplars. I assume only timeserieses are forwarded. Do you want to include the exemplars part in this pr?
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.
Really awesome work! Thanks for your patience.
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.
Nice! LGTM
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.
LGTM 🚀
@@ -104,6 +135,18 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq *prompb.WriteR | |||
level.Warn(r.logger).Log("msg", "Error on ingesting samples that are too old or are too far into the future", "numDropped", numOutOfBounds) | |||
errs.Add(errors.Wrapf(storage.ErrOutOfBounds, "add %d samples", numOutOfBounds)) | |||
} | |||
if numExemplarsOutOfOrder > 0 { | |||
level.Warn(r.logger).Log("msg", "Error on ingesting out-of-order exemplars", "numDropped", numExemplarsOutOfOrder) |
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.
If we handle the returned error on upper levels (this could be logging as well), we don't need to log/handle it twice. I see that you've just followed the existing structure so it seems ok for now.
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.
This is epic!!! LGTM 💪🏽
From when @onprem you are full-pledge backend engineer with so much skill for high quality work like this? 😱
@@ -104,6 +135,18 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq *prompb.WriteR | |||
level.Warn(r.logger).Log("msg", "Error on ingesting samples that are too old or are too far into the future", "numDropped", numOutOfBounds) | |||
errs.Add(errors.Wrapf(storage.ErrOutOfBounds, "add %d samples", numOutOfBounds)) | |||
} | |||
if numExemplarsOutOfOrder > 0 { | |||
level.Warn(r.logger).Log("msg", "Error on ingesting out-of-order exemplars", "numDropped", numExemplarsOutOfOrder) |
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.
hm.. what I don't like is duplicate error handling. We both add error and warn error... Wonder if we could just handle that on caller side instead. 🤔
Let's rebase and merge this |
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
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.
Solid work 😱
LGTM!
Changes
Fixes #4235
Verification