-
Notifications
You must be signed in to change notification settings - Fork 306
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
Human-friendly Duration serialization is not backwards-compatible #257
Comments
Can you explain what this broke in Prometheus itself? I don't think we ever read back in these values, so this shouldn't be an issue. |
I don't believe anything broke specifically within Prometheus. In our case, we use cortextool, which uses this library for parsing durations returned by a Prometheus/Cortex rules API. If Prometheus/Cortex is on a version with the new duration format and returns a mixed-unit duration, cortextool is unable to parse them. At this point, cortextool has been updated, so it's not directly an issue for us anymore. I'm not sure how many other projects will have this issue, or whether compatibility for projects outside of the prometheus org is even a concern for this library. Regardless, I think it's important to at least file this issue for discoverability in case someone else encounters this behavior. |
Thanks for your input. As it looks like there is no issue within Prometheus I'll close this. It does not seem the right repo for a placeholder issue like this, and cortex has released since. |
This adds `Flush()` to the `middleware.badResponseLoggingWriter`, making it implement `http.Flusher` if the wrapped `http.ResponseWriter` does.
Recently, there have been changes to
Duration
to allow mixed units, e.g.1h30m
. When durations are serialized, they will include mixed units. This change will break older clients which do not know how to deserialize mixed unit durations. They will get an error that looks likenot a valid duration string: "1h30m"
.I think it would be a better implementation to serialize durations in a way that uses a single unit. This maintains backwards compatibility.
The text was updated successfully, but these errors were encountered: