Skip to content
GitHub

Configuration

Config section: monitor (MonitorConfig). Env prefix: LEX_MONITOR__.

KeyTypeDefaultEnv VarDescription
enabledboolTrueLEX_MONITOR__ENABLEDEnable monitoring
namestr"lexigram-service"LEX_MONITOR__NAMEService name / provider name
backend_typeBackendTypememoryLEX_MONITOR__BACKEND_TYPEMonitoring backend (opentelemetry / prometheus / memory)
environmentEnvironmentdevelopmentDeployment environment
envstr | NoneNoneLEX_MONITOR__ENVEnvironment override string
debugboolFalseLEX_MONITOR__DEBUGEnable debug mode
KeyTypeDefaultEnv VarDescription
metrics.enabledboolTrueLEX_MONITOR__METRICS__ENABLEDEnable metrics collection
metrics.prefixstr"lexigram_"LEX_MONITOR__METRICS__PREFIXMetric name prefix
metrics.default_labelsdict[str, str]{}Default labels for all metrics
metrics.histogram_bucketslist[float][0.1, 0.5, 1.0, 2.0, 5.0, 10.0]Default histogram bucket boundaries
metrics.collection_intervalfloat60.0LEX_MONITOR__METRICS__COLLECTION_INTERVALMetrics collection interval (seconds)
KeyTypeDefaultEnv VarDescription
tracing.enabledboolTrueLEX_MONITOR__TRACING__ENABLEDEnable tracing
tracing.service_namestr"lexigram-service"LEX_MONITOR__TRACING__SERVICE_NAMEService name for traces
tracing.sampler_typeSamplerTypealways_onLEX_MONITOR__TRACING__SAMPLER_TYPESampling strategy
tracing.sample_ratefloat1.0LEX_MONITOR__TRACING__SAMPLE_RATESample rate (0.0–1.0)
tracing.max_traces_per_secondint100Rate limit for rate_limiting sampler
tracing.propagation_formatslist[str]["tracecontext", "baggage"]Trace propagation formats
tracing.max_attributesint128Max attributes per span
tracing.max_eventsint128Max events per span
tracing.max_linksint128Max links per span
tracing.max_spansint1000Max in-memory spans
KeyTypeDefaultEnv VarDescription
health.enabledboolTrueLEX_MONITOR__HEALTH__ENABLEDEnable health checks
health.pathstr"/health"LEX_MONITOR__HEALTH__PATHHealth endpoint path
health.include_detailsboolTrueInclude detailed health info
health.timeoutfloat5.0LEX_MONITOR__HEALTH__TIMEOUTHealth check timeout (seconds)
health.checkslist[str][]Health check names to run
health.intervalint30LEX_MONITOR__HEALTH__INTERVALHealth check interval (seconds)
KeyTypeDefaultEnv VarDescription
logging.enabledboolTrueLEX_MONITOR__LOGGING__ENABLEDEnable structured logging
logging.levelstr"INFO"LEX_MONITOR__LOGGING__LEVELLog level
logging.formatstr"json"LEX_MONITOR__LOGGING__FORMATLog format (json / text)
logging.include_trace_contextboolTrueInclude trace context in logs
logging.redact_fieldslist[str]["password","secret","token","api_key","authorization"]Fields to redact
KeyTypeDefaultEnv VarDescription
opentelemetry.endpointstr | NoneNoneLEX_MONITOR__OPENTELEMETRY__ENDPOINTOTLP endpoint URL
opentelemetry.headersdict[str, str]{}OTLP request headers
opentelemetry.insecureboolFalseUse insecure connection
opentelemetry.timeoutfloat30.0Export timeout (seconds)
opentelemetry.compressionstr"none"Compression (none / gzip)
opentelemetry.batch_sizeint512Export batch size
opentelemetry.export_intervalfloat5.0Export interval (seconds)
opentelemetry.tracing_exporterslist[OTelExporterConfig][{"type":"console"}]Tracing exporter configs
opentelemetry.metrics_exporterslist[OTelExporterConfig][{"type":"console"}]Metrics exporter configs
KeyTypeDefaultEnv VarDescription
prometheus.portint8000LEX_MONITOR__PROMETHEUS__PORTMetrics server port
prometheus.pathstr"/metrics"LEX_MONITOR__PROMETHEUS__PATHMetrics endpoint path
prometheus.enable_default_metricsboolTrueEnable default process metrics
prometheus.pushgateway_urlstr | NoneNonePushgateway URL
prometheus.push_intervalfloat10.0Pushgateway push interval
prometheus.store_in_dbboolFalsePersist metrics to database
prometheus.metrics_tablestr"metrics_samples"DB metrics table name
monitor:
backend_type: prometheus
environment: production
metrics:
enabled: true
prefix: myapp_
histogram_buckets: [0.05, 0.1, 0.5, 1.0, 5.0]
tracing:
enabled: true
service_name: my-service
sampler_type: probability
sample_rate: 0.1
health:
path: /health
include_details: true
logging:
level: INFO
format: json
redact_fields:
- password
- api_key
prometheus:
port: 8000
path: /metrics
Terminal window
export LEX_MONITOR__BACKEND_TYPE=prometheus
export LEX_MONITOR__TRACING__ENABLED=true
export LEX_MONITOR__TRACING__SAMPLE_RATE=0.1
export LEX_MONITOR__PROMETHEUS__PORT=8000
export LEX_MONITOR__LOGGING__LEVEL=INFO