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

Tests should use configured provider types for non-standard SDKs #486

Open
c24t opened this issue Mar 14, 2020 · 2 comments
Open

Tests should use configured provider types for non-standard SDKs #486

c24t opened this issue Mar 14, 2020 · 2 comments
Labels
help wanted release:after-ga To be resolved after GA release triaged

Comments

@c24t
Copy link
Member

c24t commented Mar 14, 2020

Follow-up to #466.

Many ext tests use the default SDK TracerProvider and MeterProvider types. Some ext packages (typically "integrations") only rely on the API package, other ext packages (typically "exporters") rely on the SDK package because they use types defined in the API.

Both kinds of ext packages should work with the default no-op providers, built-in SDK providers, and custom SDK providers. Even though the SDK package needs to be present to use an exporter ext package, the user may configure their application with DefaultProvider from the API package. For this reason, the exporter shouldn't rely on SDK-specific implementation details.

To make sure we're not relying on the built-in SDK implementation, and to support writing custom SDKs, we should refactor ext tests to use each available provider. In general, custom SDKs should behave the same way as the built-in SDK, but we will want separate tests for API-provided providers.

@mauriciovasquezbernal
Copy link
Member

Follow-up to #466.

Many ext tests use the default SDK TracerProvider and MeterProvider types. Some ext packages (typically "integrations") only rely on the API package, other ext packages (typically "exporters") rely on the SDK package because they use types defined in the API.

Do you mean exporters use types defined in the SDK?

Both kinds of ext packages should work with the default no-op providers, built-in SDK providers, and custom SDK providers. Even though the SDK package needs to be present to use an exporter ext package, the user may configure their application with DefaultProvider from the API package. For this reason, the exporter shouldn't rely on SDK-specific implementation details.

I totally agree for the integration packages, but I'm not sure what you mean for the exporters. As far as I know exporters are an SDK-only concept, so it's fine for them to rely on the SDK internal details. Exporters would not be even invoked if the user chooses the default no-op implementation, the application should work in that case. Could you please clarify?

@lzchen lzchen added the release:after-ga To be resolved after GA release label Dec 18, 2020
@lzchen
Copy link
Contributor

lzchen commented Dec 18, 2020

Discussed 12/18:

We need to setup tests in such a way where we test the instrumentations with the no-op providers.

  1. Add to test-utils to instantiate default providers (no sdk components)
  2. All tests that we write should test the no-op provider and the sdk provider.

This is specifically to ensure that nothing bad will happen if the default sdk is not used (instrumentations won't crash using only the no-op provider).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted release:after-ga To be resolved after GA release triaged
Projects
None yet
Development

No branches or pull requests

4 participants