Add support for exemplars in the scrape appender#6844
Add support for exemplars in the scrape appender#6844shreyassrivatsan wants to merge 4 commits intoprometheus:masterfrom
Conversation
shreyassrivatsan
commented
Feb 18, 2020
- Create a new ExemplarAppender interface that is a superset of Appender along with exemplar specific methods
- Modify the scrape loop to check the appender type and call the appender methods if its the right type and exemplar does exist.
Signed-off-by: Shreyas Srivatsan <[email protected]>
Signed-off-by: Shreyas Srivatsan <[email protected]>
Signed-off-by: Shreyas Srivatsan <[email protected]>
e6b8b45 to
8c2317f
Compare
Signed-off-by: Shreyas Srivatsan <[email protected]>
9fae031 to
c91ed4c
Compare
|
The code itself looks okay, though I'm unsure about where exactly this is going. What are you planning on doing with this? |
So this change just extends the scrape loop to actually give a way to scrape and push the exemplars to an So a user can now build a custom This is separate from the other work around an exemplar store in prometheus and pushing exemplars through remote write (#6309), that was shelved till we have a better design.. |
The change is not complete, it's only adding dead code. Having two interfaces is also a bit weird, which is why I'd like to see the rest of the change. |
|
Hey @shreyassrivatsan, thanks for opening this PR. I think in general this change makes sense (alongside the rest of the code that would then store exemplars), but I think it might make more sense to have separate samples and exemplars I think we should probably coordinate between the two of us, or anyone else at Chronosphere who is doing exemplars work, to ensure we're not doing overlapping work. I only just pushed the change today, but in my WIP branch (pr here) I've got a very basic in memory implementation of a |
Yeah, I see the reasoning for not extending the But having separate interfaces even if they can be implemented by the same struct, makes it non-trivial to store exemplars along side the datapoint values if one wants to. I posted a comment on your diff describing the thought process a bit.. Let me know what you think.. |
|
Replying to your comments from both PR's here.
The argument against this is that Prometheus doesn't have any immediate plans to store exemplars alongside sample data, nor return samples and exemplars as part of the data for a single query. I think for now we'd probably want to avoid adding noop's to TSDB but that's just my opinion.
This is a good argument for your interface, assuming the TSDB maintainers aren't against those noop's. I don't have a strong opinion either way; I personally would go with two separate interfaces as they're, in my mind, different data sets that need to be handled differently. Lets see if we can get opinions from anyone else on this. |
It depends on how the rest of the code looks really. For example if the exemplar stuff was a wrapper on top of storage it'd make sense. If it's a completely different interface, it wouldn't.
The proposal in this PR isn't two separate interfaces, it's a sub and super interface - which feels weird. As I said we need to see where this is going, this PR is incomplete. |
You can see my proposed interface/implementation, which I linked to earlier, here. In that PR I have separate interfaces for samples ( |
That appears as a valid approach to me. |
Makes sense. Based on the above and the remaining comments on the PR I am going to go ahead and close this. |