Skip to content

Commit

Permalink
Remove deprecated component.Exporter types (open-telemetry#6880)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Jan 3, 2023
1 parent 390ac18 commit 13672f4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 84 deletions.
16 changes: 16 additions & 0 deletions .chloggen/rm-deprecated-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: component

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated Exporter types

# One or more tracking issues or pull requests related to the change
issues: [6880]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
79 changes: 0 additions & 79 deletions component/exporter.go

This file was deleted.

54 changes: 49 additions & 5 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,69 @@ import (
"go.uber.org/zap"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
)

// Traces is an exporter that can consume traces.
type Traces = component.TracesExporter //nolint:staticcheck
type Traces interface {
component.Component
consumer.Traces
}

// Metrics is an exporter that can consume metrics.
type Metrics = component.MetricsExporter //nolint:staticcheck
type Metrics interface {
component.Component
consumer.Metrics
}

// Logs is an exporter that can consume logs.
type Logs = component.LogsExporter //nolint:staticcheck
type Logs interface {
component.Component
consumer.Logs
}

// CreateSettings configures exporter creators.
type CreateSettings = component.ExporterCreateSettings //nolint:staticcheck
type CreateSettings struct {
// ID returns the ID of the component that will be created.
ID component.ID

component.TelemetrySettings

// BuildInfo can be used by components for informational purposes
BuildInfo component.BuildInfo
}

// Factory is factory interface for exporters.
//
// This interface cannot be directly implemented. Implementations must
// use the NewFactory to implement it.
type Factory = component.ExporterFactory //nolint:staticcheck
type Factory interface {
component.Factory

// CreateTracesExporter creates a TracesExporter based on this config.
// If the exporter type does not support tracing or if the config is not valid,
// an error will be returned instead.
CreateTracesExporter(ctx context.Context, set CreateSettings, cfg component.Config) (Traces, error)

// TracesExporterStability gets the stability level of the TracesExporter.
TracesExporterStability() component.StabilityLevel

// CreateMetricsExporter creates a MetricsExporter based on this config.
// If the exporter type does not support metrics or if the config is not valid,
// an error will be returned instead.
CreateMetricsExporter(ctx context.Context, set CreateSettings, cfg component.Config) (Metrics, error)

// MetricsExporterStability gets the stability level of the MetricsExporter.
MetricsExporterStability() component.StabilityLevel

// CreateLogsExporter creates a LogsExporter based on the config.
// If the exporter type does not support logs or if the config is not valid,
// an error will be returned instead.
CreateLogsExporter(ctx context.Context, set CreateSettings, cfg component.Config) (Logs, error)

// LogsExporterStability gets the stability level of the LogsExporter.
LogsExporterStability() component.StabilityLevel
}

// FactoryOption apply changes to Factory.
type FactoryOption interface {
Expand Down

0 comments on commit 13672f4

Please sign in to comment.