File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -153,21 +153,23 @@ def get_headers(config: LangtraceConfig):
153153 return headers
154154
155155
156+ def append_api_path (host : str ):
157+ if host == LANGTRACE_REMOTE_URL :
158+ return f"{ host } /api/trace"
159+ if "localhost" in host :
160+ return host
161+ return f"{ host } /v1/traces"
162+
163+
156164def get_exporter (config : LangtraceConfig , host : str ):
157165 if config .custom_remote_exporter :
158166 return config .custom_remote_exporter
159167
160168 headers = get_headers (config )
161169 exporter_protocol = os .environ .get ("OTEL_EXPORTER_OTLP_PROTOCOL" , "http" )
162170 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- )
171+ host = append_api_path (host )
172+ return HTTPExporter (endpoint = host , headers = headers )
171173 else :
172174 return GRPCExporter (endpoint = host , headers = headers )
173175
Original file line number Diff line number Diff line change 1- __version__ = "3.3.16 "
1+ __version__ = "3.3.17 "
You can’t perform that action at this time.
0 commit comments