-
-
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
ref(releasehealth): Implement get_project_sessions_count on metrics backend [INGEST-249] #29148
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.
Looks good! Feel free to ignore the nits.
src/sentry/release_health/metrics.py
Outdated
|
||
query = Query( | ||
dataset=Dataset.Metrics.value, | ||
match=Entity("metrics_counters"), |
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.
nit: I think we have the EntityKey
enum for this now, we might as well use it.
@@ -90,6 +91,21 @@ def filter_releases_by_project_release( | |||
) | |||
|
|||
|
|||
def _model_environment_ids_to_environment_names( |
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.
nit: Will this function be used anywhere else? If not, I wonder if we could simplify to
def _get_environment_name(environment_id: int) -> Optional[str]:
try:
return Environment.objects.get(id=environment_id).name or None
except Environment.DoesNotExist:
return None
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.
Yes, I thought about just getting one environment and then changed my mind... maybe will inline when we are done.
src/sentry/release_health/metrics.py
Outdated
@@ -90,6 +91,21 @@ def filter_releases_by_project_release( | |||
) | |||
|
|||
|
|||
def _model_environment_ids_to_environment_names( | |||
metric_ids: Sequence[int], |
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.
Should we call this environment_ids
instead of metric_ids
?
Like in #28598, port get_project_sessions_count from sentry.snuba.sessions to metrics.
INGEST-249