Skip to content

Commit

Permalink
Act on review comment to remove passthrough with placeholder for real…
Browse files Browse the repository at this point in the history
… implementation.
  • Loading branch information
michaelsafyan committed Nov 1, 2024
1 parent 80976e9 commit 929e38a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
23 changes: 15 additions & 8 deletions connector/blobuploadconnector/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@ import (
"go.opentelemetry.io/collector/pdata/plog"
)

type passThroughLogsConnector struct {
type logsToLogsImpl struct {
nextConsumer consumer.Logs
}

func (c *passThroughLogsConnector) Start(_ context.Context, _ component.Host) error { return nil }
func (c *passThroughLogsConnector) Shutdown(_ context.Context) error { return nil }
func (c *logsToLogsImpl) Start(_ context.Context, _ component.Host) error {
// TODO: implement
return nil
}

func (c *logsToLogsImpl) Shutdown(_ context.Context) error {
// TODO: implement
return nil
}

func (c *passThroughLogsConnector) ConsumeLogs(ctx context.Context, ld plog.Logs) error {
func (c *logsToLogsImpl) ConsumeLogs(ctx context.Context, ld plog.Logs) error {
// TODO: implement
return c.nextConsumer.ConsumeLogs(ctx, ld)
}

func (c *passThroughLogsConnector) Capabilities() consumer.Capabilities {
func (c *logsToLogsImpl) Capabilities() consumer.Capabilities {
return consumer.Capabilities{MutatesData: false}
}

Expand All @@ -33,8 +41,7 @@ func createLogsToLogsConnector(_ Deps) connector.CreateLogsToLogsFunc {
_ connector.Settings,
_ component.Config,
nextConsumer consumer.Logs) (connector.Logs, error) {
// TODO: implement actual, non-pass through implementation when
// there is a config present with a non-empty "logs" config.
return &passThroughLogsConnector{nextConsumer: nextConsumer}, nil
// TODO: implement
return &logsToLogsImpl{nextConsumer: nextConsumer}, nil
}
}
25 changes: 15 additions & 10 deletions connector/blobuploadconnector/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ import (
"go.opentelemetry.io/collector/pdata/ptrace"
)

type passThroughTracesConnector struct {
type tracesToTracesImpl struct {
nextConsumer consumer.Traces
component.StartFunc
component.ShutdownFunc
}

func (c *passThroughTracesConnector) Start(_ context.Context, _ component.Host) error { return nil }
func (c *passThroughTracesConnector) Shutdown(_ context.Context) error { return nil }
func (c *tracesToTracesImpl) Start(_ context.Context, _ component.Host) error {
// TODO: implement
return nil
}

func (c *tracesToTracesImpl) Shutdown(_ context.Context) error {
// TODO: implement
return nil
}

func (c *passThroughTracesConnector) ConsumeTraces(ctx context.Context, td ptrace.Traces) error {
func (c *tracesToTracesImpl) ConsumeTraces(ctx context.Context, td ptrace.Traces) error {
// TODO: implement
return c.nextConsumer.ConsumeTraces(ctx, td)
}

func (c *passThroughTracesConnector) Capabilities() consumer.Capabilities {
func (c *tracesToTracesImpl) Capabilities() consumer.Capabilities {
return consumer.Capabilities{MutatesData: false}
}

Expand All @@ -35,8 +41,7 @@ func createTracesToTracesConnector(_ Deps) connector.CreateTracesToTracesFunc {
_ connector.Settings,
_ component.Config,
nextConsumer consumer.Traces) (connector.Traces, error) {
// TODO: implement actual, non-pass through implementation when
// there is a config present with a non-empty "traces" config.
return &passThroughTracesConnector{nextConsumer: nextConsumer}, nil
// TODO: implement
return &tracesToTracesImpl{nextConsumer: nextConsumer}, nil
}
}

0 comments on commit 929e38a

Please sign in to comment.