Repository navigation
0.21.0
v0.21.0 (2025-12-12)
✨ Features
-
metrics: Set default values for api_key and host in PostHogConfig (
8cfd3c2) -
metrics: Add metrics disabled check in PostHogMetricsReporter to prevent sending metrics when disabled (
11e3cd3) -
config: Add metrics_enabled field to configuration for controlling metrics collection (
841cd9f) -
metrics: Add error metrics handling in metrics middleware for improved exception tracking (
7192e88) -
metrics: Implement error handling in send_error method for capturing exceptions (
49d227f) -
metrics: Add error handling for command failures in usage metrics sender (
364a731) -
metrics: Create class to store all data related to error event (
8174b3f) -
metrics: Add send_error method to metrics reporter for error handling (
c3e2cdb) -
metrics: Add ConfigSnapshotPrimitives type and to_primitives method (
eb28115) -
metrics: Add snapshot creator instance inside metrics middleware (
a7f4984) -
metrics: Add method to create unknown ConfigSnapshot and handle missing config file (
4e17a87) -
metrics: Implement method to be able to compare two snapshots (
ec00d47) -
metrics: Implement 'is_unknown' method in config snapshot class to determine if it has been properly read or not (
910c8d1) -
metrics: Implement use case to create a snapshot of the configuration file (
4ab1892) -
shared: Add 'for_metrics' method in config schema to be able to get only the data I need for metrics and not need to access all the internals of the class (
feb27b7) -
metrics: Inject config repository to snapshot creator to be able to read an existing configuration file (
e10e26c) -
metrics: Create config snapshot class to store all the data related to the config file that will be sent to metrics (
32db003) -
metrics: Integrate MetricsMiddleware into InstantPythonTyper for enhanced command execution metrics (
2b9db62) -
metrics: Add MetricsMiddleware to handle command execution and send usage metrics data after command execution has finished (
bdbbe00) -
metrics: Implement execute method in metrics sender use case to send usage metrics data (
2fbecb8) -
metrics: Validate distinct ID format when loading from metrics file (
007c9d2) -
metrics: Handle JSON decoding errors and missing distinct ID in metrics file (
c2e6be6) -
metrics: Retrieve distinct ID from metrics.json if it exists so an existing user does not generate a new id (
9b52f46) -
metrics: Store distinct ID in metrics.json on first execution (
da050c9) -
metrics: Add UserIdentityManager to generate distinct user IDs (
36ef740) -
metrics: Implement fire-and-forget strategy for metric sending (
6cc0761) -
metrics: Enable sync mode for PostHog client initialization (
51c52bc) -
metrics: Capture event to be sent to posthog using a temporary distinct_id (
db27119) -
metrics: Create posthog client inside reporter to be able to send metrics (
59aa393) -
metrics: Create post hog config class to handle env variables related with post hog (
95a4516) -
metrics: Create dataclass to store all data related to usage metrics that will be send to posthog (
0368a98)
⚙️ Build System
-
pyproject: Add platformdirs as production dependency as it's not built-in with all supported python versions (
ef5dcf3) -
pyproject: Update dependencies to remove vulnerability (
c858003) -
pyproject: Add vcr dependency to run posthog integration test without affecting current project (
ccc11f0) -
pyproject: Add pydantic settings dependency to handle env variables gracefully (
0b8b19f)
♻️ Refactoring
-
metrics: Streamline success metrics handling in metrics middleware (
65962b6) -
metrics: Update send_error method to include error parameter (
61210ac) -
metrics: Rename send method to send_success in metrics reporter (
462db4c) -
metrics: Rename execute method to execute_on_success (
ac34809) -
metrics: Modify metrics middleware to take config snapshots to avoid errors when init command finished its execution and config file is moved (
0716f62) -
metrics: Enhance UsageMetricsEvent with dependency_manager and adjust built_in_features initialization (
0281909) -
metrics: Update execute method to accept config_snapshot parameter and not need to read configuration file (
ee03fc9) -
metrics: Rename UsageMetricsData to UsageMetricsEvent for clarity (
24a47ab) -
metrics: Simplify UsageMetricsSender initialization by removing repository parameter (
e5d5917) -
metrics: Rename method to improve clarity in config reading (
9468e1a) -
metrics: Update ConfigSnapshotCreator to utilize for_metrics method for improved config handling (
2ce0140) -
config: Improve error handling in configuration file loading (
1114c17) -
metrics: Extract configuration data handling into a separate method and streamline metrics data creation (
e316523) -
metrics: Simplify execute method by removing success and error message parameters now that it will be handled automatically by posthog reporter (
77469a9) -
metrics: Rename get_distinct_id method to get_or_create_distinct_id for clarity (
0a068c7) -
metrics: Rename metric reporter classes for consistency (
15f122f) -
metrics: Remove success an error message data from metrics object as posthog is configured to report errors automatically (
0f4eb0b) -
metrics: Update post hog metric reporter to use user identity manager and create consistent distinct ids (
b5ad406) -
metrics: Set config dir to be the .config folder of user system if is not passed and extract named variables to improve readability (
2e54e8e) -
metrics: Modify distinct ID handling to improve readability and maintainability (
aa8d52b) -
metrics: Use usage metrics data class for send method in metric reporter (
96393c2)
Detailed Changes: 0.20.0...0.21.0