Commit 316591c
authored
feat(metrics): More metrics and docs (#4)
* feat(metrics): Add user metrics and update handling for /me endpoint data
- Introduced new gauges for user information, activity status, password presence, and email preferences.
- Implemented `update_user_metrics` function to process data from the /me endpoint and update corresponding metrics.
- Enhanced metrics collection logic to handle missing workspace IDs gracefully.
* feat(metrics): Enhance project and client metrics collection
- Added new gauges for individual project and client information, including attributes such as project name, client ID, and status flags.
- Updated `update_aggregate_metrics` function to clear previous metrics and handle fetching of clients and projects more robustly.
- Improved error handling with informative print statements for failed API calls when fetching clients and projects.
* feat(metrics): Add new performance metrics for time entries
- Introduced gauges for average duration, billable ratio, distinct days with entries, and untagged entries metrics.
- Updated the `update_time_entries_metrics` function to aggregate and set new performance metrics based on workspace data.
- Enhanced the exporter to clear and handle new metrics during collection.
- Modified the Grafana dashboard to reflect changes in titles and layout for better clarity and organization.
* feat(grafana): Add Grafana service and configuration for metrics visualization
- Introduced a new Grafana service in the Docker Compose setup, configured to run on port 3000.
- Added datasource and dashboard configuration files for Prometheus integration.
- Updated README to include Grafana access instructions and service details.
- Modified existing Grafana dashboard JSON expressions for proper syntax.
* fix(grafana): Correct syntax in dashboard JSON expressions
- Updated Prometheus query expressions in the Grafana dashboard JSON to use correct string formatting, replacing escaped quotes with standard quotes for improved readability and functionality.
* feat(grafana): Update dashboard JSON for enhanced metrics visualization
- Set dashboard ID to 1 and updated plugin version to 11.6.0.
- Added new configuration options for percent change color mode, thresholds, and layout settings.
- Enhanced panel configurations with mappings and thresholds for better data representation.
- Adjusted the structure of the dashboard to include new panels for API error rates and GC metrics.
- Updated schema version to 41 and improved overall organization for clarity.
* feat(grafana): Revise dashboard JSON and enhance metrics integration
- Adjusted grid positions and widths for several panels to optimize layout.
- Introduced a new panel for "Timer Status History" with Prometheus data source.
- Updated existing panels to reflect new metrics, including "Total Clients" and "Total Tags."
- Modified the "Avg Entry Duration (24h)" and "Billable Ratio (24h)" panels to use updated Prometheus queries.
- Enhanced the overall organization of the dashboard for improved clarity and usability.
- Updated schema version to 7.
* feat(docs): Enhance README and Grafana dashboard integration
- Added images for Toggl and Grafana to the README for better visualization.
- Included a pre-configured Grafana dashboard in `grafana/dashboard.json` for improved metrics visualization.
- Updated Grafana dashboard queries to support dynamic timeframe selection for metrics.
- Modified exporter to handle multiple lookback periods for time entries, enhancing flexibility in metrics collection.
- Updated tests to validate new functionality for handling multiple lookback hours.
* refactor(metrics): Simplify time entry metrics processing and enhance readability
- Refactored the `update_time_entries_metrics` function to utilize helper functions for better organization and clarity.
- Introduced new helper functions for fetching workspace mappings, processing entry aggregates, and setting metrics.
- Improved error handling and logging for fetching time entries and workspace data.
- Updated type hints for better code clarity and maintainability.
- Enhanced the handling of metrics aggregation and clearing for performance metrics.1 parent 3ac8628 commit 316591c
File tree
9 files changed
+1688
-295
lines changed- docs/images
- grafana
- prometheus_toggl_track_exporter
- tests
9 files changed
+1688
-295
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
37 | 53 | | |
38 | 54 | | |
39 | 55 | | |
| 56 | + | |
Loading
0 commit comments