-
Notifications
You must be signed in to change notification settings - Fork 783
Description
When calling TracerProvicer.get_tracer(), I see a deprecationwarning even though both libraries are at the same version.
The issue seems to be that the sdk instantiates an InstrumentationInfo object here:
which seems to be deprecated here:
opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/util/instrumentation.py
Lines 29 to 40 in a3346ae
| @deprecated(version="1.11.1", reason="You should use InstrumentationScope") | |
| def __init__( | |
| self, | |
| name: str, | |
| version: Optional[str] = None, | |
| schema_url: Optional[str] = None, | |
| ): | |
| self._name = name | |
| self._version = version | |
| if schema_url is None: | |
| schema_url = "" | |
| self._schema_url = schema_url |
Unless I'm misreading the coce, this means there is no way to get rid of this deprecation warning, because the library deprecated something but continues to use it, which seems unusual.
environment:
python 3.7.10
(relevant part of) requirements.txt
opentelemetry-api==1.11.1
opentelemetry-exporter-otlp-proto-grpc==1.11.1
opentelemetry-instrumentation==0.30b1
opentelemetry-instrumentation-asgi==0.30b1
opentelemetry-instrumentation-flask==0.30b1
opentelemetry-instrumentation-pymongo==0.30b1
opentelemetry-instrumentation-requests==0.30b1
opentelemetry-instrumentation-sqlalchemy==0.30b1
opentelemetry-instrumentation-wsgi==0.30b1
opentelemetry-proto==1.11.1
opentelemetry-sdk==1.11.1
opentelemetry-semantic-conventions==0.30b1
opentelemetry-util-http==0.30b1
Steps to reproduce:
We're seeing it when doing something like:
from [our own central lbrary that re-exports some opentelemetry functions] import get_tracer
tracer = get_tracer(__name__)
with tracer.start_as_current_span(name=span_name, kind=SpanKind.CLIENT):
[make a request to an external service] The only things that I can think of that are slightly unusual here is that we're importing get_tracer from a different place, and that we're starting a CLIENT span.