From da38baac0083b5356cec08e2b38d5023fa505429 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Wed, 3 Nov 2021 14:21:32 +0100 Subject: [PATCH] ref(appconnect): Another metric to count projects I have no idea how the counter works, if at all. Hopefully the gauge should work better. --- src/sentry/tasks/app_store_connect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sentry/tasks/app_store_connect.py b/src/sentry/tasks/app_store_connect.py index b1674d96bb47a2..49ce30fef98d34 100644 --- a/src/sentry/tasks/app_store_connect.py +++ b/src/sentry/tasks/app_store_connect.py @@ -200,6 +200,7 @@ def inner_refresh_all_builds() -> None: # objects. But that would miss projects that have a valid AppStore Connect # setup, but have not yet published any kind of build to AppStore. options = ProjectOption.objects.filter(key=appconnect.SYMBOL_SOURCES_PROP_NAME) + count = 0 for option in options: with sdk.push_scope() as scope: scope.set_tag("project", option.project_id) @@ -226,6 +227,8 @@ def inner_refresh_all_builds() -> None: "config_id": source_id, } ) + count += 1 metrics.incr("sentry.tasks.app_store_connect.refresh_count", sample_rate=1) except Exception: logger.exception("Failed to refresh AppStoreConnect builds") + metrics.gauge("tasks.app_store_connect.refreshed", count, sample_rate=1)