File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 417417
418418# opentelemetry settings
419419OTEL_ENABLED = False
420+ OTEL_METRICS_DISPATCH_INTERVAL_MINUTES = 5
420421OTEL_PULP_API_HISTOGRAM_BUCKETS = []
421422
422423# VulnerabilityReport settings
530531 },
531532)
532533
534+ otel_metrics_dispatch_interval_validator = Validator (
535+ "OTEL_METRICS_DISPATCH_INTERVAL_MINUTES" ,
536+ is_type_of = (int , float ),
537+ gt = 0 ,
538+ messages = {
539+ "is_type_of" : "{name} must be a number." ,
540+ "operations" : "{name} must be greater than zero." ,
541+ },
542+ )
543+
533544
534545def otel_middleware_hook (settings ):
535546 data = {"dynaconf_merge" : True }
@@ -557,6 +568,7 @@ def otel_middleware_hook(settings):
557568 json_header_auth_validator ,
558569 authentication_json_header_openapi_security_scheme_validator ,
559570 otel_pulp_api_histogram_buckets_validator ,
571+ otel_metrics_dispatch_interval_validator ,
560572 ],
561573 post_hooks = (otel_middleware_hook ,),
562574)
Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ def configure_cleanup():
486486
487487def configure_periodic_telemetry ():
488488 task_name = "pulpcore.app.tasks.telemetry.otel_metrics"
489- dispatch_interval = timedelta (minutes = 5 )
489+ dispatch_interval = timedelta (minutes = settings . OTEL_METRICS_DISPATCH_INTERVAL_MINUTES )
490490 name = "Emit OpenTelemetry metrics periodically"
491491
492492 if settings .OTEL_ENABLED and settings .DOMAIN_ENABLED :
You can’t perform that action at this time.
0 commit comments