def _wrap(tracer, to_wrap, wrapped, instance, args, kwargs):
    """Instruments and calls every function defined in TO_WRAP."""
    if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
        return wrapped(*args, **kwargs)

    name = to_wrap.get("span_name")
    with tracer.start_as_current_span(name) as span:
        span.set_attribute(SpanAttributes.DB_SYSTEM, "weaviate")
        span.set_attribute(SpanAttributes.DB_OPERATION, to_wrap.get("method"))

        obj = to_wrap.get("object")
        instrumentor = InstrumentorFactory.from_name(obj)
        if instrumentor:
            instrumentor.instrument(to_wrap.get("method"), span, args, kwargs)

        return_value = wrapped(*args, **kwargs)

    return return_value
Instruments and calls every function defined in TO_WRAP.
packages/opentelemetry-instrumentation-weaviate/opentelemetry/instrumentation/weaviate/wrapper.py