| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package component // import "go.opentelemetry.io/collector/component" |
| 5 |
|
| 6 |
import ( |
| 7 |
"go.opentelemetry.io/otel/metric" |
| 8 |
"go.opentelemetry.io/otel/trace" |
| 9 |
"go.uber.org/zap" |
| 10 |
|
| 11 |
"go.opentelemetry.io/collector/pdata/pcommon" |
| 12 |
) |
| 13 |
|
| 14 |
// TelemetrySettings provides components with APIs to report telemetry. |
| 15 |
type TelemetrySettings struct { |
| 16 |
// Logger that the factory can use during creation and can pass to the created |
| 17 |
// component to be used later as well. |
| 18 |
Logger *zap.Logger |
| 19 |
|
| 20 |
// TracerProvider that the factory can pass to other instrumented third-party libraries. |
| 21 |
// |
| 22 |
// The service may wrap this provider for attribute injection. The wrapper may implement an |
| 23 |
// additional `Unwrap() trace.TracerProvider` method to grant access to the underlying SDK. |
| 24 |
TracerProvider trace.TracerProvider |
| 25 |
|
| 26 |
// MeterProvider that the factory can pass to other instrumented third-party libraries. |
| 27 |
MeterProvider metric.MeterProvider |
| 28 |
|
| 29 |
// Resource contains the resource attributes for the collector's telemetry. |
| 30 |
Resource pcommon.Resource |
| 31 |
|
| 32 |
// prevent unkeyed literal initialization |
| 33 |
_ struct{} |
| 34 |
} |