Skip to content

Conversation

@JWinermaSplunk
Copy link
Contributor

add support for weaviate instrumentation

@JWinermaSplunk JWinermaSplunk requested review from a team as code owners December 4, 2025 00:15

def __init__(self, exception_logger: Optional[Any] = None) -> None:
super().__init__()
Config.exception_logger = exception_logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is exception_logger used ?

# Ignore errors when unwrapping connection methods
pass

def _get_server_details(self, version: int, tracer: Tracer) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the function name be more meaningful ?


class _WeaviateConnectionInjectionWrapper:
"""
A wrapper that intercepts calls to weaviate connection methods to inject tracing headers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this description accurate ? do not see any tracing header injection happening in the logic below. Let's discuss if I am misunderstanding it ?


class _WeaviateTraceInjectionWrapper:
"""
A wrapper that intercepts calls to weaviate to inject tracing headers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this description accurate ? do not see any tracing header injection happening in the logic below. Let's discuss if I am misunderstanding it ?

getattr(wrapped, "__name__", "unknown"),
)
name = f"{SPAN_NAME_PREFIX}.{name}"
with self.tracer.start_as_current_span(name, kind=SpanKind.CLIENT) as span:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is creating a span. Should this logic be in a separate file and not in the init.py ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting as Weaviate doesn't have any underlying GenAI utils, so it is up for discretion as to where to create the span. I believe this is also what openllemetry was also doing, but I could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants