-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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): Update EAP dataset and entity key for discover builders #78967
feat(discover): Update EAP dataset and entity key for discover builders #78967
Conversation
…ilder logic to get eap dataset and entity name
1d77d7c
to
6e7b059
Compare
6e7b059
to
4e188f2
Compare
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #78967 +/- ##
===========================================
+ Coverage 51.13% 78.27% +27.13%
===========================================
Files 7095 7128 +33
Lines 312363 313797 +1434
Branches 50997 51227 +230
===========================================
+ Hits 159729 245616 +85887
+ Misses 151590 61757 -89833
- Partials 1044 6424 +5380 |
def _get_entity_name(self) -> str: | ||
if self.dataset in DATASET_TO_ENTITY_MAP: | ||
return DATASET_TO_ENTITY_MAP[self.dataset].value |
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 considered adding DATASET_TO_ENTITY_MAP
to snuba/dataset.py
, but this feels more like a discover detail to me. The relationship between dataset to entity isn't actually 1:1 and the dataset name is not always equal to the entity name either. I think this is good enough for now, but we probably want to refactor this part of the builder in the future.
…rs (#78967) Updates EAP dataset to correctly be `events_analytics_platform` and add entity key for `eap_spans`. Also updates discover builders to stop using `_get_dataset_name` and start using `_get_entity_name` instead. This is needed because the AlertRule model obtains and stores it's `dataset` from the UI via POST api call. We need to use the proper `events_analytics_platform` dataset string so we can pass validation when creating the snuba subscription. With these changes, we will also be able to pass any discover builder validation when creating the query from the AlertRule.
Updates EAP dataset to correctly be
events_analytics_platform
and add entity key foreap_spans
.Also updates discover builders to stop using
_get_dataset_name
and start using_get_entity_name
instead.This is needed because the AlertRule model obtains and stores it's
dataset
from the UI via POST api call. We need to use the properevents_analytics_platform
dataset string so we can pass validation when creating the snuba subscription. With these changes, we will also be able to pass any discover builder validation when creating the query from the AlertRule.