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

Metrics SDK should provide testing library that can construct instances of SDK data interfaces. #4389

Open
jsuereth opened this issue Apr 18, 2022 · 1 comment

Comments

@jsuereth
Copy link
Contributor

Right now, we are hiding all the concrete class (but also the constructors) for SDK data, which means either:

  1. Downstream users need to create their own data hierarchy for testing.
  2. Downstream users need to depend on internal construction mechanisms.

We should definitely provide constructors of these data points at a MINIMUM for users to test their own SDK extensions.

Originally posted by @jsuereth in #4242 (comment)

@anuraaga
Copy link
Contributor

Copying in comment here for tracking

Yeah we still need to introduce a testing version of data construction similar to what we have for SpanData, probably with builders to avoid the long factory methods. For most cases though do the assertj helpers work?

Realized though that for exporters the assertj helpers don't apply. Still I'd generally expect the tests to use the API+SDK itself in many cases - not a reason to avoid the testing builders, just a potential way with the current code.

ThomasJazz added a commit to ThomasJazz/opentelemetry-java that referenced this issue Feb 11, 2024
ThomasJazz added a commit to ThomasJazz/opentelemetry-java that referenced this issue Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants