opentelemetry-go-contrib icon indicating copy to clipboard operation
opentelemetry-go-contrib copied to clipboard

Rename `go.opentelemetry.io/contrib/processors/baggage/baggagetrace`

Open MrAlias opened this issue 1 year ago • 2 comments

  • The go.opentelemetry.io/contrib/processors/baggage/baggagetrace package sits on the go.opentelemetry.io/contrib/processors/* prefix. This package prefix will need to be used for log processors as well.
  • The baggagetrace package name is not descriptive of the functionality it provides. A name indicating the package provides a SpanProcessor that will copy baggage values into a span should be used instead.

Proposal

  1. Copy the package to a new package under the new processors/span directory
  • Use processors/span and not processors/trace as this is for a SpanProcessor
  1. Rename the package to one of:
  • go.opentelemetry.io/contrib/processors/span/bagcp
  • go.opentelemetry.io/contrib/processors/span/bagcopy
  • go.opentelemetry.io/contrib/processors/span/baggagecp
  • go.opentelemetry.io/contrib/processors/span/baggagecopy
  1. Deprecate go.opentelemetry.io/contrib/processors/baggage/baggagetrace in favor of the new package.

MrAlias avatar Jun 26 '24 18:06 MrAlias

I would go for go.opentelemetry.io/contrib/processors/span/baggagecopy. The long import path shouldn't matter much (and we have longer ones), and it's the clearest name.

dmathieu avatar Jun 27 '24 07:06 dmathieu

May not be ideal to split on type. There may be the case where a baggage span processor and log processor are needed.

Instead: go.opentelemetry.io/contrib/processors/baggagecopy and then have NewSpanProcessor and add in the future NewLogProcessor.

MrAlias avatar Jun 27 '24 16:06 MrAlias