Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REMOVAL] Remove build option WITH_DEPRECATED_SDK_FACTORY #2716

Closed
marcalff opened this issue Jun 25, 2024 · 1 comment · Fixed by #2717
Closed

[REMOVAL] Remove build option WITH_DEPRECATED_SDK_FACTORY #2716

marcalff opened this issue Jun 25, 2024 · 1 comment · Fixed by #2717
Assignees
Labels
bug Something isn't working removal Removal triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@marcalff
Copy link
Member

CMake option WITH_DEPRECATED_SDK_FACTORY was introduced in opentelemetry-cpp 1.16.0.

This option is temporary, and used to avoid application code changes when upgrading to 1.16.0, to facilitate upgrade.

Remove option WITH_DEPRECATED_SDK_FACTORY for the next release.

Code currently using WITH_DEPRECATED_SDK_FACTORY=OFF is ready and not affected.

Code still using WITH_DEPRECATED_SDK_FACTORY=ON in release 1.16.0 will not build in 1.17.0. It must be fixed before upgrading to the next release.

@marcalff marcalff added the bug Something isn't working label Jun 25, 2024
@marcalff marcalff self-assigned this Jun 25, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 25, 2024
@marcalff marcalff added removal Removal and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 25, 2024
@marcalff marcalff pinned this issue Jun 25, 2024
@marcalff marcalff added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jun 25, 2024
marcalff added a commit to marcalff/opentelemetry-cpp that referenced this issue Jun 25, 2024
@marcalff
Copy link
Member Author

For reference, from the DEPRECATED.md file published in 1.16.0:


SDK ProviderFactory cleanup

Announcement (SDK ProviderFactory cleanup)

  • Version: 1.15.0
  • Date: 2024-06-03
  • PR: [API/SDK] Provider cleanup
    #2664

This PR introduces changes to SDK ProviderFactory methods.

Motivation (SDK ProviderFactory cleanup)

SDK Factory methods for signal providers, such as:

  • opentelemetry::sdk::trace::TracerProviderFactory
  • opentelemetry::sdk::metrics::MeterProviderFactory
  • opentelemetry::sdk::logs::LoggerProviderFactory
  • opentelemetry::sdk::logs::EventLoggerProviderFactory

currently returns a unique pointer on a API class.

This is incorrect, the proper return type should be
a unique pointer on a SDK class instead.

Scope (SDK ProviderFactory cleanup)

All the current Create methods in:

  • class opentelemetry::sdk::trace::TracerProviderFactory
  • class opentelemetry::sdk::metrics::MeterProviderFactory
  • class opentelemetry::sdk::logs::LoggerProviderFactory
  • class opentelemetry::sdk::logs::EventLoggerProviderFactory

are marked as deprecated, as they return an API object.

Instead, another set of Create methods is provided,
with a different return type, an SDK object.

Both sets can not be exposed at the same time,
as this would cause build breaks,
so a compilation flag is defined to select which methods to use.

When OPENTELEMETRY_DEPRECATED_SDK_FACTORY is defined,
the old, deprecated, methods are available.

When OPENTELEMETRY_DEPRECATED_SDK_FACTORY is not defined,
the new methods are available.

The scope of this deprecation and removal,
is to remove the flag OPENTELEMETRY_DEPRECATED_SDK_FACTORY itself,
which implies that only the new set of Create() methods,
returning an SDK object, are supported.

Mitigation (SDK ProviderFactory cleanup)

Build without defining flag OPENTELEMETRY_DEPRECATED_SDK_FACTORY.

Existing code, such as:

  std::shared_ptr<opentelemetry::trace::TracerProvider> tracer_provider;
  tracer_provider = opentelemetry::sdk::trace::TracerProviderFactory::Create(...);

should be adjusted to:

  std::shared_ptr<opentelemetry::sdk::trace::TracerProvider> tracer_provider;
  tracer_provider = opentelemetry::sdk::trace::TracerProviderFactory::Create(...);

Planned removal (SDK ProviderFactory cleanup)

Flag OPENTELEMETRY_DEPRECATED_SDK_FACTORY is introduced in release 1.16.0,
to provide a migration path.

This flag is meant to be temporary, and short lived.
Expect removal by release 1.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working removal Removal triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant