We're developing an SDK that uses OpenTelemetry. This morning a user reported that after installing the SDK, everything they tried led to this error:
TypeError: Can't instantiate abstract class _ProxyMeter with abstract method create_gauge
_ProxyMeter here is our own subclass of Meter.
The changelog says:
this project adheres to Semantic Versioning.
I think releasing this change violates semver, as it was a minor version release that created errors in previously compliant code.
If this is intentional because users aren't supposed to subclass Meter themselves, please let me know so that we can constrain the dependency to <1.24 to avoid any future surprises. We have subclasses of Span, Tracer, TracerProvider, MeterProvider, Meter, and probably others, so from our perspective the abstract base classes need to be stable.
If this wasn't intentional, then in future I think you could either:
- Release such changes in a major version, or
- Add new 'abstract' methods to abstract base classes as normal methods (i.e. not decorated with
@abstractmethod) but that simply raise NotImplementedError. That way subclasses can still be instantiated.
We've resolved the problem in our own library, but it's likely that there are other libraries currently giving new users the same error. That could be mitigated here by either:
- Releasing 2.0.0 with the same code, then yanking 1.23.0 from PyPI. This means that
pip install opentelemetry-sdk<2 will install 1.22.0, while pip install opentelemetry-sdk==1.23.0 will still work.
- Releasing 1.23.1 with a backwards compatible fix such as (2) above.
We're developing an SDK that uses OpenTelemetry. This morning a user reported that after installing the SDK, everything they tried led to this error:
_ProxyMeterhere is our own subclass ofMeter.The changelog says:
I think releasing this change violates semver, as it was a minor version release that created errors in previously compliant code.
If this is intentional because users aren't supposed to subclass
Meterthemselves, please let me know so that we can constrain the dependency to<1.24to avoid any future surprises. We have subclasses ofSpan,Tracer,TracerProvider,MeterProvider,Meter, and probably others, so from our perspective the abstract base classes need to be stable.If this wasn't intentional, then in future I think you could either:
@abstractmethod) but that simplyraise NotImplementedError. That way subclasses can still be instantiated.We've resolved the problem in our own library, but it's likely that there are other libraries currently giving new users the same error. That could be mitigated here by either:
pip install opentelemetry-sdk<2will install 1.22.0, whilepip install opentelemetry-sdk==1.23.0will still work.