diff --git a/allianceauth/analytics/tasks.py b/allianceauth/analytics/tasks.py index cc9ef160..56d025bf 100644 --- a/allianceauth/analytics/tasks.py +++ b/allianceauth/analytics/tasks.py @@ -5,6 +5,7 @@ from django.apps import apps from celery import shared_task from .models import AnalyticsTokens, AnalyticsIdentifier from .utils import ( + existence_baremetal_or_docker, install_stat_addons, install_stat_tokens, install_stat_users) @@ -77,6 +78,7 @@ def analytics_daily_stats(): users = install_stat_users() tokens = install_stat_tokens() addons = install_stat_addons() + existence_type = existence_baremetal_or_docker() logger.debug("Running Daily Analytics Upload") analytics_event(namespace='allianceauth.analytics', @@ -84,6 +86,11 @@ def analytics_daily_stats(): label='existence', value=1, event_type='Stats') + analytics_event(namespace='allianceauth.analytics', + task='send_install_stats', + label=existence_type, + value=1, + event_type='Stats') analytics_event(namespace='allianceauth.analytics', task='send_install_stats', label='users', diff --git a/allianceauth/analytics/utils.py b/allianceauth/analytics/utils.py index e8c57927..a5e186e5 100644 --- a/allianceauth/analytics/utils.py +++ b/allianceauth/analytics/utils.py @@ -34,3 +34,16 @@ def install_stat_addons() -> int: The Number of Installed Apps""" addons = len(list(apps.get_app_configs())) return addons + + +def existence_baremetal_or_docker() -> str: + """Checks the Installation Type of an install + + Returns + ------- + str + existence_baremetal or existence_docker""" + docker_tag = os.getenv('AA_DOCKER_TAG') + if docker_tag: + return "existence_docker" + return "existence_baremetal" diff --git a/docs/features/core/analytics.md b/docs/features/core/analytics.md index d610edb6..d04c47a3 100644 --- a/docs/features/core/analytics.md +++ b/docs/features/core/analytics.md @@ -27,6 +27,7 @@ Analytics comes preloaded with our Google Analytics token, and the three types o Our Daily Stats contain the following: - A phone-in task to identify a server's existence +- A phone-in task to identify if a server is Bare-Metal or Dockerized - A task to send the Number of User models - A task to send the Number of Token Models - A task to send the Number of Installed Apps