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

feat(otlp-transformer)!: remove internal types and functions from public API #5200

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Nov 25, 2024

Which problem is this PR solving?

Removes all types that don't need to be exported anymore from the public interface. They were previously private as the serialization was handled by exporters, but that has changed since #4581 and #4542 were merged. Now we don't need to make the intermediate representation public anymore since the interface takes the SDKs representation and then directly returns an Uint8Array that can immediately be sent.

Reducing the public API in this way is a key part to making @opentelemetry/otlp-transformer stable, see #4582

Fixes #4583

Breaking changes

  • (user-facing): the following types and functions were intended for internal use and have been removed from exports
    • OtlpEncodingOptions
    • IKeyValueList
    • IKeyValue
    • IInstrumentationScope
    • IArrayValue
    • LongBits
    • IAnyValue
    • Fixed64
    • SpanContextEncodeFunction
    • toLongBits
    • OptionalSpanContextEncodeFunction
    • getOtlpEncoder
    • Encoder
    • HrTimeEncodeFunction
    • encodeAsLongBits
    • encodeAsString
    • hrTimeToNanos
    • IValueAtQuantile
    • ISummaryDataPoint
    • ISummary
    • ISum
    • IScopeMetrics
    • IResourceMetrics
    • INumberDataPoint
    • IHistogramDataPoint
    • IHistogram
    • IExponentialHistogramDataPoint
    • IExponentialHistogram
    • IMetric
    • IGauge
    • IExemplar
    • EAggregationTemporality
    • IExportMetricsServiceRequest
    • IBuckets
    • IResource
    • IStatus
    • EStatusCode
    • ILink
    • IEvent
    • IScopeSpans
    • ISpan
    • IResourceSpans
    • ESpanKind
    • IExportTraceServiceRequest
    • IScopeLogs
    • IExportLogsServiceRequest
    • IResourceLogs
    • ILogRecord
    • ESeverityNumber

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Unit tests

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.58%. Comparing base (fd7f2d9) to head (fb0d6dc).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5200      +/-   ##
==========================================
- Coverage   94.59%   94.58%   -0.02%     
==========================================
  Files         314      314              
  Lines        7993     7993              
  Branches     1611     1611              
==========================================
- Hits         7561     7560       -1     
- Misses        432      433       +1     
Files with missing lines Coverage Δ
.../packages/otlp-transformer/src/json/serializers.ts 100.00% <ø> (ø)
...kages/otlp-transformer/src/protobuf/serializers.ts 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@pichlermarc pichlermarc added this to the OTLP Exporter GA milestone Nov 25, 2024
@pichlermarc pichlermarc force-pushed the feat/remove-unused-serializer-exports branch from 18e243b to 73cf777 Compare November 25, 2024 18:49
@pichlermarc pichlermarc force-pushed the feat/remove-unused-serializer-exports branch from 73cf777 to 5a76cd8 Compare November 26, 2024 10:11
Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The otlp-transformer/README.md still describes using:

import {
  createExportTraceServiceRequest,
  createExportMetricsServiceRequest,
  createExportLogsServiceRequest,
} from '@opentelemetry/otlp-transformer';
...

That should be updated, but doesn't have to block this.

@pichlermarc
Copy link
Member Author

@trentm good point - addressed in fb0d6dc 🙂

I'll also hold of on merging this until I have a PR for open-telemetry/opentelemetry-js-contrib#2565 so that we don't run into trouble when updating the contrib repo where these types are used in some tests.

@trentm
Copy link
Contributor

trentm commented Nov 28, 2024

where these types are used in some tests.

Ah, I hadn't checked for usage in the contrib repo.

@pichlermarc pichlermarc added the blocked Currently blocked on another item label Nov 28, 2024
@pichlermarc
Copy link
Member Author

added the blocked label so we don't merge this before open-telemetry/opentelemetry-js-contrib#2565

@pichlermarc pichlermarc removed the blocked Currently blocked on another item label Dec 5, 2024
@pichlermarc pichlermarc added this pull request to the merge queue Dec 5, 2024
Merged via the queue into open-telemetry:main with commit a761a8c Dec 5, 2024
23 checks passed
@pichlermarc pichlermarc deleted the feat/remove-unused-serializer-exports branch December 5, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[otlp-transformer] reduce public API surface
2 participants