OtelLoggingConfig class

OpenTelemetry configuration for VooLogger.

Configure OTLP export settings for logs including endpoint, authentication, batching, and resource attributes.

Constructors

OtelLoggingConfig({bool enabled = false, String? endpoint, String? apiKey, String serviceName = 'voo-flutter-app', String serviceVersion = '1.0.0', Map<String, dynamic>? additionalAttributes, int batchSize = 50, Duration batchInterval = const Duration(seconds: 30), int maxQueueSize = 1000, Duration timeout = const Duration(seconds: 10), int maxRetries = 3, Duration retryDelay = const Duration(seconds: 1), bool prioritizeErrors = true, Map<String, String>? headers, bool debug = false, String instrumentationScopeName = 'voo-logging', String instrumentationScopeVersion = '2.0.0'})
const
OtelLoggingConfig.development({required String endpoint, String? apiKey, String serviceName = 'voo-flutter-app-dev', String serviceVersion = '1.0.0-dev'})
Create a development configuration.
factory
OtelLoggingConfig.production({required String endpoint, required String apiKey, String serviceName = 'voo-flutter-app', String serviceVersion = '1.0.0'})
Create a production-ready configuration.
factory

Properties

additionalAttributes Map<String, dynamic>?
Additional Resource attributes.
final
apiKey String?
API key for authentication.
final
batchInterval Duration
Interval between automatic flushes.
final
batchSize int
Number of logs to batch before sending.
final
debug bool
Enable debug logging for the exporter.
final
enabled bool
Whether OTEL export is enabled.
final
endpoint String?
OTLP endpoint URL (e.g., 'https://otel-collector.example.com').
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
Additional HTTP headers for OTLP requests.
final
instrumentationScopeName String
Instrumentation scope name.
final
instrumentationScopeVersion String
Instrumentation scope version.
final
isValid bool
Check if configuration is valid for export.
no setter
maxQueueSize int
Maximum number of logs to queue before dropping oldest.
final
maxRetries int
Maximum retry attempts for failed exports.
final
prioritizeErrors bool
Whether to immediately flush error/fatal logs.
final
retryDelay Duration
Delay between retry attempts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceName String
Service name for Resource attribute.
final
serviceVersion String
Service version for Resource attribute.
final
timeout Duration
HTTP timeout for OTLP requests.
final

Methods

buildResource() → TelemetryResource
Build TelemetryResource with standard OTEL attributes.
copyWith({bool? enabled, String? endpoint, String? apiKey, String? serviceName, String? serviceVersion, Map<String, dynamic>? additionalAttributes, int? batchSize, Duration? batchInterval, int? maxQueueSize, Duration? timeout, int? maxRetries, Duration? retryDelay, bool? prioritizeErrors, Map<String, String>? headers, bool? debug}) OtelLoggingConfig
Copy with modifications.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited