Skip to content

Commit 81e0516

Browse files
fix: Only try to export Humanloop spans
1 parent 1e2bdaa commit 81e0516

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "humanloop"
33

44
[tool.poetry]
55
name = "humanloop"
6-
version = "0.8.29"
6+
version = "0.8.29b1"
77
description = ""
88
readme = "README.md"
99
authors = []

src/humanloop/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "humanloop",
19-
"X-Fern-SDK-Version": "0.8.29",
19+
"X-Fern-SDK-Version": "0.8.29b1",
2020
}
2121
headers["X-API-KEY"] = self.api_key
2222
return headers

src/humanloop/otel/exporter/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
)
2222
from humanloop.otel.exporter.proto import serialize_span
2323
from humanloop.otel.helpers import (
24+
is_humanloop_span,
25+
is_llm_provider_call,
2426
read_from_opentelemetry_span,
2527
write_to_opentelemetry_span,
2628
)
@@ -71,9 +73,14 @@ def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
7173
return SpanExportResult.FAILURE
7274

7375
for span in spans:
76+
# only process spans that are relevant to Humanloop
77+
if not is_humanloop_span(span) or not is_llm_provider_call(span):
78+
continue
79+
7480
file_type = span.attributes.get(HUMANLOOP_FILE_TYPE_KEY) # type: ignore [union-attr]
7581
if file_type is None:
76-
raise HumanloopRuntimeError("Internal error: Span does not have type set")
82+
logger.error("Internal error: Humanloop span does not have file type set")
83+
continue
7784

7885
try:
7986
log_args = read_from_opentelemetry_span(

0 commit comments

Comments
 (0)