Skip to content

Commit 112d72a

Browse files
authored
Merge pull request #438 from Scale3-Labs/ali/s3en-2927-customer-requestfix-signoz-issue
Ali/s3en 2927 customer requestfix signoz issue
2 parents 883d9d7 + d854a06 commit 112d72a

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/langtrace_python_sdk/instrumentation/dspy/patch.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ def traced_method(wrapped, instance, args, kwargs):
120120
**get_extra_attributes(),
121121
}
122122

123-
trace_checkpoint = os.environ.get("TRACE_DSPY_CHECKPOINT", "true").lower()
124-
125123
if instance.__class__.__name__:
126124
span_attributes["dspy.signature.name"] = instance.__class__.__name__
127125
span_attributes["dspy.signature"] = str(instance.signature)
@@ -143,9 +141,6 @@ def traced_method(wrapped, instance, args, kwargs):
143141
"dspy.signature.result",
144142
json.dumps(result.toDict()),
145143
)
146-
if trace_checkpoint == "true":
147-
print(Fore.RED + "Note: DSPy checkpoint tracing is enabled in Langtrace. To disable it, set the env var, TRACE_DSPY_CHECKPOINT to false" + Fore.RESET)
148-
set_span_attribute(span, "dspy.checkpoint", ujson.dumps(instance.dump_state(False), indent=2))
149144
span.set_status(Status(StatusCode.OK))
150145

151146
span.end()

src/langtrace_python_sdk/langtrace.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff 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

105107
def 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.3.15"
1+
__version__ = "3.3.16"

0 commit comments

Comments
 (0)