Skip to content

Commit

Permalink
fix: mock for test
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-star-l committed Aug 14, 2024
1 parent 791e71e commit 05a5e46
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
30 changes: 27 additions & 3 deletions exporter/dorisexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.opentelemetry.io/collector/pdata/plog"
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/ptrace"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/dorisexporter/internal/metadata"
)
Expand Down Expand Up @@ -45,13 +48,34 @@ func createDefaultConfig() component.Config {
}

func createLogsExporter(ctx context.Context, set exporter.Settings, cfg component.Config) (exporter.Logs, error) {
return nil, nil
return exporterhelper.NewLogsExporter(
ctx,
set,
cfg,
func(ctx context.Context, ld plog.Logs) error {
return nil
},
)
}

func createTracesExporter(ctx context.Context, set exporter.Settings, cfg component.Config) (exporter.Traces, error) {
return nil, nil
return exporterhelper.NewTracesExporter(
ctx,
set,
cfg,
func(ctx context.Context, td ptrace.Traces) error {
return nil
},
)
}

func createMetricsExporter(ctx context.Context, set exporter.Settings, cfg component.Config) (exporter.Metrics, error) {
return nil, nil
return exporterhelper.NewMetricsExporter(
ctx,
set,
cfg,
func(ctx context.Context, md pmetric.Metrics) error {
return nil
},
)
}
3 changes: 2 additions & 1 deletion exporter/dorisexporter/internal/metadata/generated_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05a5e46

Please sign in to comment.