| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform" |
| 5 |
|
| 6 |
import ( |
| 7 |
commonpb "go.opentelemetry.io/proto/otlp/common/v1" |
| 8 |
|
| 9 |
"go.opentelemetry.io/otel/sdk/instrumentation" |
| 10 |
) |
| 11 |
|
| 12 |
func InstrumentationScope(il instrumentation.Scope) *commonpb.InstrumentationScope { |
| 13 |
if il == (instrumentation.Scope{}) { |
| 14 |
return nil |
| 15 |
} |
| 16 |
return &commonpb.InstrumentationScope{ |
| 17 |
Name: il.Name, |
| 18 |
Version: il.Version, |
| 19 |
Attributes: Iterator(il.Attributes.Iter()), |
| 20 |
} |
| 21 |
} |