Removed dropped link's attributes field from API package#2118
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2118 +/- ##
=====================================
Coverage 73.5% 73.5%
=====================================
Files 168 168
Lines 8233 8234 +1
=====================================
+ Hits 6058 6059 +1
Misses 1935 1935
Partials 240 240
|
| ### Changed | ||
|
|
||
| - The `SpanModels` function is now exported from the `go.opentelemetry.io/otel/exporters/zipkin` package to convert OpenTelemetry spans into Zipkin model spans. (#2027) | ||
| - Replaced usages of the `trace.Link` type in the SDK package with an equivalent `Link` struct that also counts the number of dropped link's attributes. (#2118) |
There was a problem hiding this comment.
Can we rewrite this from the user perspective? Likely this needs to be transformed into an item in the Add section describing the new type used.
There was a problem hiding this comment.
Maybe I've stretched it too far, but from a user/usage perspective, I can think in something like:
Added a new
Linktype under the SDKotel/sdk/tracepackage that counts the number of attributes that were dropped for surpassing theAttributePerLinkCountLimitconfigured in the Span'sSpanLimits. This new type replaces the equal-named APILinktype found in theotel/tracepackage for most usages within the SDK. For example, instances of this type are now returned by theLinks()function ofReadOnlySpans provided in places like theOnEndfunction ofSpanProcessorimplementations.
But don't hesitate on suggesting a better/shorter alternative if you had something in mind!
|
This PR looks ready to be moved out of draft state. |
…-dropped-link-attributes
…oved' section to avoid ambiguity
pellared
left a comment
There was a problem hiding this comment.
I added two nit comments, but for me, it is also fine as it is 😉
| - Added the `WithRetry` option to the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. | ||
| This option is a replacement for the removed `WithMaxAttempts` and `WithBackoff` options. (#2095) | ||
| - Added API `LinkFromContext` to return Link which encapsulates SpanContext from provided context and also encapsulates attributes. (#2115) | ||
| - Added a new `Link` type under the SDK `otel/sdk/trace` package that counts the number of attributes that were dropped for surpassing the `AttributePerLinkCountLimit` configured in the Span's `SpanLimits`. |
There was a problem hiding this comment.
I think the convention would be to write go.opentelemetry.io/otel/sdk/trace instead of otel/sdk/trace.
| - Removed the `WithMaxAttempts` and `WithBackoff` options from the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. | ||
| The retry logic of the package has been updated to match the `otlptracegrpc` package and accordingly a `WithRetry` option is added that should be used instead. (#2095) | ||
| - Removed metrics test package `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#2105) | ||
| - Removed `DroppedAttributeCount` field from `otel/trace.Link` struct. (#2118) |
There was a problem hiding this comment.
I think the convention would be to write "go.opentelemetry.io/otel/trace".Link instead of otel/trace.Link.
There was a problem hiding this comment.
Oh, I just saw this and previous comment, but I guess the PR got merged to include it into v1.0.0-RC2 released today.
If needed, I can normalize these to fit the convention in a separate PR, just let me know!
This PR removes the
DroppedAttributeCountfield from theotel/trace.Linkstruct in order to not leak implementation details into the API package.A new
trace.Linktype is introduced in theotel/sdkmodule for the purpose of counting the number of dropped link's attributes.The interface for adding links to a Span remains under the original
otel/trace.Linktype, but are then converted intotracesdk.Links for internal storage. They are also used to createReadOnlySpans.Fixes #2051.