@@ -31,6 +31,7 @@ class DBOSConfig(TypedDict, total=False):
3131 otlp_logs_endpoints: List[str]: OTLP logs endpoints
3232 admin_port (int): Admin port
3333 run_admin_server (bool): Whether to run the DBOS admin server
34+ otlp_attributes (dict[str, str]): A set of custom attributes to apply OTLP-exported logs and traces
3435 """
3536
3637 name : str
@@ -43,6 +44,7 @@ class DBOSConfig(TypedDict, total=False):
4344 otlp_logs_endpoints : Optional [List [str ]]
4445 admin_port : Optional [int ]
4546 run_admin_server : Optional [bool ]
47+ otlp_attributes : Optional [dict [str , str ]]
4648
4749
4850class RuntimeConfig (TypedDict , total = False ):
@@ -84,6 +86,7 @@ class LoggerConfig(TypedDict, total=False):
8486class TelemetryConfig (TypedDict , total = False ):
8587 logs : Optional [LoggerConfig ]
8688 OTLPExporter : Optional [OTLPExporterConfig ]
89+ otlp_attributes : Optional [dict [str , str ]]
8790
8891
8992class ConfigFile (TypedDict , total = False ):
@@ -145,7 +148,8 @@ def translate_dbos_config_to_config_file(config: DBOSConfig) -> ConfigFile:
145148
146149 # Telemetry config
147150 telemetry : TelemetryConfig = {
148- "OTLPExporter" : {"tracesEndpoint" : [], "logsEndpoint" : []}
151+ "OTLPExporter" : {"tracesEndpoint" : [], "logsEndpoint" : []},
152+ "otlp_attributes" : config .get ("otlp_attributes" , {}),
149153 }
150154 # For mypy
151155 assert telemetry ["OTLPExporter" ] is not None
0 commit comments