-
Notifications
You must be signed in to change notification settings - Fork 107
tags/findSeries - add lastts-json format #1580
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.
LGTM
Update http docs please |
3fa24a7
to
6ffc099
Compare
I just added a commit that will return partial results if the query is too large. I think this is ok for the |
d7e5513
to
d24b2bc
Compare
api/graphite.go
Outdated
} | ||
} | ||
} | ||
seriesVals = append(seriesVals, models.SeriesLastUpdate{Series: serie.Pattern, Ts: lastUpdate}) |
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'm a bit confused here. doesn't this only include the series name (without tags) ? I thought you wanted it broken down by tags.
also, it looks like this doesn't include meta tags.
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 returns the same string that is currently returned (i.e. the series-json
format), which is formatted like name;tag1=val1;tag2=val2
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.
@replay shouldn't we expand the name here to include meta tags?
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 can't think of a good reason why it would be necessary to include meta tags here, except for consistency so that whoever uses the endpoint also gets to see the meta tags.
Note that in order to include meta tags in this result the index/find_by_tags
endpoint and the MemoryIdx.FindByTag()
method would all have to be modified to include meta tags in the returned results, which would slow finds down because those results would need to be enriched. So if we want to enable the user to also retrieve the meta tags on this endpoint we should make this an optional feature of the index/find_by_tags
endpoint which by default is off.
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, I would say including meta tags here would be a separate feature.
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.
Actually, I just looked at the related code again, and the series returned by clusterFindByTag
already have the meta tags if the feature is enabled. They're in the .MetaTags
property. So if that's wanted, it would be easy to also add them.
this.
shortly we'll start doing the same for render requests too. see grafana/grafana#6448 |
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.
needs a few tweaks as discussed
That's what I was thinking, but I can't really change the existing (and graphite compatible) |
perhaps it should also take a "meta" flag like render responses, which is basically an opt-in to get our "enhanced" response format dictionary which can contain warnings. |
It seems like that would be confusing, since for |
So, we can do:
I think consistency across our different endpoints is important. It'd be really nice and clean if all endpoints had a "meta" flag which meant the same everywhere (enable metadata and richer response). Though it's annoying to have to opt-in to the better experience (if lastts-json were to default to meta=false), it'd be nicer if enabled by default. But that precludes backwards compatibility (if series-json had meta=true). We can do a comprise, and pick a different meta default based on the format variable. Which seems perhaps a bit strange, but the tradeoff seems worth it. Proposal 2 is simple, but is different from /render and conflates orthogonal concerns (whether to include metadata/warnings with the formatting of the actual data and its encoding). The data formatting is already conflated with encoding, E.g. What if graphite adds another output format, should we then provide an alternative metadata-enabled format string for that too (and another one when we implement another serialization function)? So, I have a preference for option 1, but you can probably sway me to 2 :) |
True. I think we really have 2 questions answered in various ways by different parameters:
For the render API, there is a For this endpoint, we envision that there are multiple possible sets of information that would be useful to return (this PR adds 1 of them). The format parameter is answering both questions, and the meta parameter would "enhance" the decision from the first. I'm not sure in what scenario |
yes if it weren't for graphite compatibility, we'd always have the rich response and no need for a meta parameter. I've stated my conclusion. What's yours? |
Sound good? |
so basically it's proposal 1 with the tweak that the meta flag only applies to series-json (and "" means series-json); all other formats simply include the metadata. sounds good |
Excellent, because that's what I just implemented |
I think I was able to simplify the wording a bit. |
@Dieterbe - I pulled in your wording changes and cleaned up the little funkiness around limit checks |
This is to support efficient querying for missing data.
Fix #1570