File tree Expand file tree Collapse file tree
src/workflows/util/zocalo Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from typing import ClassVar , TypedDict
4+
35from marshmallow import fields
46from zocalo .configuration import PluginSchema
57
1113class OTEL :
1214 """A Zocalo configuration plugin to pre-populate OTELTracing config defaults"""
1315
16+ class _OTELConfig (TypedDict , total = False ):
17+ endpoint : str
18+ timeout : int
19+
20+ # Store configuration for access by services
21+ config : ClassVar [_OTELConfig ] = {}
22+
1423 class Schema (PluginSchema ):
1524 host = fields .Str (required = True )
1625 port = fields .Int (required = True )
1726 timeout = fields .Int (required = False , load_default = 10 )
1827
19- # Store configuration for access by services
20- config = {}
21-
2228 @staticmethod
2329 def activate (configuration ):
2430 # Build the full endpoint URL
2531 endpoint = f"https://{ configuration ['host' ]} :{ configuration ['port' ]} /v1/traces"
2632 OTEL .config ["endpoint" ] = endpoint
2733 OTEL .config ["timeout" ] = configuration .get ("timeout" , 10 )
28- return OTEL .config
34+ return dict ( OTEL .config )
2935
3036
3137class Stomp :
You can’t perform that action at this time.
0 commit comments