-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(discover): allow querying for cache.item_size
and cache.hit
#68788
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
feat(discover): allow querying for cache.item_size
and cache.hit
#68788
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #68788 +/- ##
===========================================
+ Coverage 42.52% 79.72% +37.20%
===========================================
Files 5435 6419 +984
Lines 228486 284522 +56036
Branches 39297 49001 +9704
===========================================
+ Hits 97158 226843 +129685
+ Misses 130430 57312 -73118
+ Partials 898 367 -531
|
…che-item-size-to-metrics
cache.item_size
cache.item_size
and cache.hit
It seems like this is failing because we can't modify strings.py https://github.com/getsentry/sentry/actions/runs/8711767062/job/23896615105#step:4:1542 Without the strings.py entry here We get the following error when trying query for |
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 not too up on the latest with metrics but won't the item size be much too high cardinality?
@wedamija item_size is just a metric, and we don't tag on item_size so it should be okay for cardinality. (Kinda like we have a span.duration metrics, but we don't tag metrics with We do tag metrics with |
This is confusing to me, I didn't realize you could query metrics in discover, since discover is an event store. That being said, there shouldn't be any need to add anything to strings.py. That error means that the metric/tag key has never been seen before, which shouldn't be happening. I would add the |
Yeah, we pretty much use the discover api (which I believe the api has some translation layer to get the right metrics if they aren't in the discover dataset). We use the api exclusively to query for metrics in all the performance UIs
Unfortunately the tests still fail :(, seems like something under the hood in discover that requires the |
This suggest we're querying the indexer first to know if it's a registered tag before we consider querying for it. Since we removed the need to register a tag, this check needs to go away. The consequence of this is we could potentially query a tag that has no data associated with it. I think I'm fine with this. |
There is a bit of a misunderstanding here I think. Something in discover requires that the string The |
if self.spans_metrics_builder: | ||
return UseCaseID.SPANS | ||
elif self.is_performance: | ||
return UseCaseID.TRANSACTIONS |
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.
@evanh turns out this was the problem, we were setting the wrong useCaseId, and the metric/tag index would fail to resolve when we queried for them, tests pass just fine now!
This PR complements the relay PR getsentry/relay#3371
It allows us to query for
cache.item_size
metric andcache.hit
field via discover api through spansMetrics dataset.