Class TelemetryConfig
- Namespace
- AiDotNet.Deployment.Configuration
- Assembly
- AiDotNet.dll
Configuration for telemetry - tracking and monitoring model inference metrics.
public class TelemetryConfig
- Inheritance
-
TelemetryConfig
- Inherited Members
Remarks
For Beginners: Telemetry collects data about how your model is performing in production. Think of it like a fitness tracker for your AI model - it tracks important health metrics so you know when something goes wrong or when performance degrades.
What gets tracked:
- Latency: How long each inference takes (helps identify slowdowns)
- Throughput: How many inferences per second (measures capacity)
- Errors: When predictions fail (helps identify issues)
- Cache hits/misses: How often cached models are used (optimizes memory)
- Version usage: Which model versions are being used (helps with rollouts)
Why it's important:
- Detect performance degradation before users complain
- Understand usage patterns to optimize resources
- Debug production issues with real data
- Make data-driven decisions about model updates
Privacy Note: Telemetry doesn't collect user data or predictions, only metadata like timing and version information.
Properties
CollectErrors
Alias for TrackErrors for more intuitive access.
public bool CollectErrors { get; set; }
Property Value
CollectLatency
Alias for TrackLatency for more intuitive access.
public bool CollectLatency { get; set; }
Property Value
CustomTags
Gets or sets custom tags to include with all telemetry events.
public Dictionary<string, string> CustomTags { get; set; }
Property Value
Remarks
For Beginners: Add custom labels to telemetry data (e.g., environment, region). Useful for filtering and organizing metrics from different deployments.
Enabled
Gets or sets whether telemetry is enabled (default: true).
public bool Enabled { get; set; }
Property Value
Remarks
For Beginners: Set to true to collect performance metrics, false to disable telemetry. Recommended to keep enabled for production monitoring.
ExportEndpoint
Gets or sets the telemetry export endpoint URL (optional).
public string? ExportEndpoint { get; set; }
Property Value
Remarks
For Beginners: URL to send telemetry data for centralized monitoring. Leave null to only store locally. Set to your monitoring system's endpoint.
FlushIntervalSeconds
Gets or sets the telemetry flush interval in seconds (default: 60).
public int FlushIntervalSeconds { get; set; }
Property Value
Remarks
For Beginners: How often to send telemetry data to the export endpoint. Default is every minute. Lower values = more real-time, higher values = less network traffic.
SamplingRate
Gets or sets the sampling rate for telemetry (default: 1.0 = 100%).
public double SamplingRate { get; set; }
Property Value
Remarks
For Beginners: What percentage of requests to track (0.0 to 1.0). 1.0 = track everything, 0.1 = track 10% of requests. Lower values reduce overhead.
TrackCacheMetrics
Gets or sets whether to track cache hit/miss rates (default: true).
public bool TrackCacheMetrics { get; set; }
Property Value
Remarks
For Beginners: Tracks how often models are found in cache vs loaded from disk. Helps optimize cache size and eviction policies.
TrackDetailedTiming
Gets or sets whether to track detailed timing breakdowns (default: false).
public bool TrackDetailedTiming { get; set; }
Property Value
Remarks
For Beginners: Tracks pre-processing, inference, and post-processing times separately. More detailed but slight performance overhead. Use for debugging performance issues.
TrackErrors
Gets or sets whether to track errors and exceptions (default: true).
public bool TrackErrors { get; set; }
Property Value
Remarks
For Beginners: Records when predictions fail or errors occur. Critical for debugging and maintaining system health.
TrackLatency
Gets or sets whether to track inference latency (default: true).
public bool TrackLatency { get; set; }
Property Value
Remarks
For Beginners: Tracks how long each prediction takes. Helps identify performance problems and slow requests.
TrackThroughput
Gets or sets whether to track throughput metrics (default: true).
public bool TrackThroughput { get; set; }
Property Value
Remarks
For Beginners: Tracks how many predictions per second your system handles. Helps understand capacity and plan for scaling.
TrackVersionUsage
Gets or sets whether to track model version usage (default: true).
public bool TrackVersionUsage { get; set; }
Property Value
Remarks
For Beginners: Records which model versions are being used. Helps track rollouts and A/B test results.