File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ def __init__(self, **kwargs):
9999 or os .environ .get ("LANGTRACE_HEADERS" )
100100 or os .environ .get ("OTEL_EXPORTER_OTLP_HEADERS" )
101101 )
102- self .session_id = kwargs .get ("session_id" ) or os .environ .get ("LANGTRACE_SESSION_ID" )
102+ self .session_id = kwargs .get ("session_id" ) or os .environ .get (
103+ "LANGTRACE_SESSION_ID"
104+ )
103105
104106
105107def get_host (config : LangtraceConfig ) -> str :
@@ -156,9 +158,16 @@ def get_exporter(config: LangtraceConfig, host: str):
156158 return config .custom_remote_exporter
157159
158160 headers = get_headers (config )
159- host = f"{ host } /api/trace" if host == LANGTRACE_REMOTE_URL else host
160- if "http" in host .lower () or "https" in host .lower ():
161- return HTTPExporter (endpoint = host , headers = headers )
161+ exporter_protocol = os .environ .get ("OTEL_EXPORTER_OTLP_PROTOCOL" , "http" )
162+ if "http" in exporter_protocol .lower ():
163+ return HTTPExporter (
164+ endpoint = (
165+ f"{ host } /api/trace"
166+ if host == LANGTRACE_REMOTE_URL
167+ else f"{ host } /v1/traces"
168+ ),
169+ headers = headers ,
170+ )
162171 else :
163172 return GRPCExporter (endpoint = host , headers = headers )
164173
You can’t perform that action at this time.
0 commit comments