-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add option to client_golang to *not* send the time on a Series() call #621
Comments
Could the zero value of |
My only concern is that prom's minTime is actually significantly before
So if you wanted to query a time before Zero time (since apparently thats valid?) it'd be a bit weird to have our "null" (don't send a value) be in the middle of that. |
Oh right, I now even remember that we had discussed this problem in a different context already (i.e. a valid Prometheus sample might happen to have the time.Time zero value as its actual timestamp). |
So yeah, disregard my comment, please. |
I just hit this on How about creating a constant with a value of minTime, that would be taken as "don't send a value"? |
Its been a while since this issue was touched last; but this came up again as an issue on promxy (jacksontj/promxy#528) -- I was wondering if we had any ideas/thoughts on fixing this? |
The "clearest" API change (IMO) would be to change from a |
I was looking to create a PR against this and noticed that the client already is VERY inconsistent. Some methods (such as Practically speaking |
Pointers to Adding a new method like I think I’d be fine with the zero time meaning “not set”, since that is obvious. I doubt there are many people who have data at that instant. (Note there is a bug with |
This is an updated PR of prometheus#615 -- based on discussion in prometheus#621 Fixes prometheus#621
This is an updated PR of prometheus#615 -- based on discussion in prometheus#621 Fixes prometheus#621 Signed-off-by: Thomas Jackson <[email protected]>
This is an updated PR of prometheus#615 -- based on discussion in prometheus#621 Fixes prometheus#621 Signed-off-by: Thomas Jackson <[email protected]>
Thanks everyone for great points. Another not tested idea: We could replace time.Time in arguments with interface that time.Time implements and then passing nil will work (!) and is detectable. I don't think that would break compatibility. (?) Also technically speaking we can break compatibility in Note that, if we aim for v2, I think we discussed API should be in form of OpenAPI spec, maintained outside of this repo - anybody could auto-generate code in their language. Any improvements ideally would go to OpenAPI client Go generator (last time I checked it wasn't great). For now, |
This is an updated PR of prometheus#615 -- based on discussion in prometheus#621 Fixes prometheus#621 Signed-off-by: Thomas Jackson <[email protected]>
@bwplotka if we wanted to change to another "interface" I would do something like this:
This way you aren't masking time.Time and it can be nil or something else entirely (more "go" as well, since those are the only 2 args we care about). That being said, given that one API endpoint already uses time.IsZero (and thats not an uncommon usage) I think the PR I have open doing that is the way to go #1238 |
Agree and thanks for checking (and fixing)! We can always move to interface if lack of the possibility to specify first millisecond of year 0001 becomes a problem (: |
The series call doesn't require a time, it would be nice if we had some mechanism in the go API to not set a time. I had opened #615 towards this, but I'm not sure this is a great approach, maybe we instead make the
time.Time
pointers?The text was updated successfully, but these errors were encountered: