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

[contrib-test-utils] stop using soon-to-be-removed @opentelemetry/otlp-transformer types #2565

Closed
1 task done
Tracked by #4582
pichlermarc opened this issue Nov 28, 2024 · 3 comments · Fixed by #2573
Closed
1 task done
Tracked by #4582
Assignees
Labels
pkg:contrib-test-utils type:feature A feature with no sub-issues to address

Comments

@pichlermarc
Copy link
Member

pichlermarc commented Nov 28, 2024

Description

This issue is part of open-telemetry/opentelemetry-js#4582

In open-telemetry/opentelemetry-js#4583 we will remove large parts of the public API of the @opentelemetry/otlp-transformer package. Before this change is released we should also get rid of all usages of these soon to be removed APIs from our tests here in this repository to ensure a smooth update-process to the latest @opentelemetry/* packages.

This issue is considered done when:

@trentm
Copy link
Contributor

trentm commented Nov 28, 2024

Looks like the only usage in the contrib repo is:

packages/opentelemetry-test-utils/src/test-fixtures.ts
27:import {
28:  IInstrumentationScope,
29:  IResource,
30:  ISpan,
31:} from '@opentelemetry/otlp-transformer';

This is code that I added. Hrm.

@trentm
Copy link
Contributor

trentm commented Nov 28, 2024

I'm happy to help adjust that code, but I'm not sure what the best way to do that would be. Do you know if there are convenient exported types for the JSON serialization of the OTLP ExportTraceServiceResponse type (and eventually for the equivalent metrics and logs service response types)?

If not, I suppose the test-fixtures.ts test facility could re-define those types. The object the TestCollector is making available is mostly just JSON.parse(body) where body is the content sent to the OTLP/json POST /v1/traces endpoint.

@pichlermarc
Copy link
Member Author

@trentm Thanks for the offer, I assume the change would be quite mechanical so I'll look into it next week - I'll reach out if anything's unclear. 🙂

Do you know if there are convenient exported types for the JSON serialization of the OTLP ExportTraceServiceResponse type (and eventually for the equivalent metrics and logs service response types)?
If not, I suppose the test-fixtures.ts test facility could re-define those types. The object the TestCollector is making available is mostly just JSON.parse(body) where body is the content sent to the OTLP/json POST /v1/traces endpoint.

hmm, there's no such thing AFAIK. I think we have to re-define them here - in any case I think we can get away with far fewer types exported from the contrib-test-utils package than what we had over at @opentelemetry/otlp-transformer 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:contrib-test-utils type:feature A feature with no sub-issues to address
Projects
None yet
2 participants