Skip to content

Commit

Permalink
Added dashboard_version to telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
johc committed Apr 25, 2024
1 parent 61ed69b commit a2c5eb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flask_monitoringdashboard/core/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from flask_monitoringdashboard import telemetry_config
from flask_monitoringdashboard.core.config import TelemetryConfig
from flask_monitoringdashboard.core.blueprints import get_blueprint
from flask_monitoringdashboard.core.utils import get_details
from flask_monitoringdashboard.database import TelemetryUser, Endpoint


Expand Down Expand Up @@ -50,13 +51,18 @@ def collect_general_telemetry_data(session, telemetry_user):
level_twos_count = counts_dict.get(2, 0)
level_threes_count = counts_dict.get(3, 0)

# Get details including the dashboard version
details = get_details(session)
dashboard_version = details['dashboard-version']

data = {'endpoints': no_of_endpoints,
'blueprints': no_of_blueprints,
'time_initialized': telemetry_user.last_initialized.strftime('%Y-%m-%d %H:%M:%S'),
'monitoring_0': level_zeros_count,
'monitoring_1': level_ones_count,
'monitoring_2': level_twos_count,
'monitoring_3': level_threes_count,
'dashboard_version': dashboard_version,
}

# post user data
Expand Down Expand Up @@ -149,3 +155,4 @@ def post_to_back_if_telemetry_enabled(class_name='Endpoints', **kwargs):
except requests.exceptions.ConnectionError as e:
return None


0 comments on commit a2c5eb4

Please sign in to comment.