File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1007,6 +1007,9 @@ def parse_section(section):
10071007).lower ()
10081008OTEL_BASIC_AUTH_USERNAME = os .environ .get ("OTEL_BASIC_AUTH_USERNAME" , "" )
10091009OTEL_BASIC_AUTH_PASSWORD = os .environ .get ("OTEL_BASIC_AUTH_PASSWORD" , "" )
1010+ OTEL_METRICS_EXPORT_INTERVAL_MILLIS = int (
1011+ os .environ .get ("OTEL_METRICS_EXPORT_INTERVAL_MILLIS" , "10000" )
1012+ )
10101013
10111014OTEL_METRICS_BASIC_AUTH_USERNAME = os .environ .get (
10121015 "OTEL_METRICS_BASIC_AUTH_USERNAME" , OTEL_BASIC_AUTH_USERNAME
Original file line number Diff line number Diff line change 4444 OTEL_METRICS_BASIC_AUTH_PASSWORD ,
4545 OTEL_METRICS_OTLP_SPAN_EXPORTER ,
4646 OTEL_METRICS_EXPORTER_OTLP_INSECURE ,
47+ OTEL_METRICS_EXPORT_INTERVAL_MILLIS ,
4748)
4849from open_webui .models .users import Users
4950
50- _EXPORT_INTERVAL_MILLIS = 10_000 # 10 seconds
51-
5251
5352def _build_meter_provider (resource : Resource ) -> MeterProvider :
5453 """Return a configured MeterProvider."""
@@ -67,7 +66,7 @@ def _build_meter_provider(resource: Resource) -> MeterProvider:
6766 OTLPHttpMetricExporter (
6867 endpoint = OTEL_METRICS_EXPORTER_OTLP_ENDPOINT , headers = headers
6968 ),
70- export_interval_millis = _EXPORT_INTERVAL_MILLIS ,
69+ export_interval_millis = OTEL_METRICS_EXPORT_INTERVAL_MILLIS ,
7170 )
7271 ]
7372 else :
@@ -78,7 +77,7 @@ def _build_meter_provider(resource: Resource) -> MeterProvider:
7877 insecure = OTEL_METRICS_EXPORTER_OTLP_INSECURE ,
7978 headers = headers ,
8079 ),
81- export_interval_millis = _EXPORT_INTERVAL_MILLIS ,
80+ export_interval_millis = OTEL_METRICS_EXPORT_INTERVAL_MILLIS ,
8281 )
8382 ]
8483
You can’t perform that action at this time.
0 commit comments