Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed May 24, 2024
1 parent 765c3e6 commit 61854d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cmd/otel-agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import (
configprovider "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/pipeline/provider"
"github.com/DataDog/datadog-agent/comp/serializer/compression"
"github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy"
tracecomp "github.com/DataDog/datadog-agent/comp/trace"
traceagentcomp "github.com/DataDog/datadog-agent/comp/trace/agent"
traceconfig "github.com/DataDog/datadog-agent/comp/trace/config"
"github.com/DataDog/datadog-agent/pkg/config/env"
"github.com/DataDog/datadog-agent/pkg/serializer"
Expand Down Expand Up @@ -164,6 +166,15 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams,
fx.Provide(func(tcfg *pkgtraceconfig.AgentConfig, statsdClient ddgostatsd.ClientInterface) (*pkgagent.Agent, error) {
return pkgagent.NewAgent(ctx, tcfg, telemetry.NewCollector(tcfg), statsdClient), nil
}),

Check warning on line 168 in cmd/otel-agent/subcommands/run/command.go

View check run for this annotation

Codecov / codecov/patch

cmd/otel-agent/subcommands/run/command.go#L166-L168

Added lines #L166 - L168 were not covered by tests
// ctx is required to be supplied from here, as Windows needs to inject its own context
// to allow the agent to work as a service.
fx.Provide(func() context.Context { return ctx }), // fx.Supply(ctx) fails with a missing type error.

Check warning on line 171 in cmd/otel-agent/subcommands/run/command.go

View check run for this annotation

Codecov / codecov/patch

cmd/otel-agent/subcommands/run/command.go#L171

Added line #L171 was not covered by tests
fx.Supply(&traceagentcomp.Params{
CPUProfile: "",
MemProfile: "",
PIDFilePath: "",
}),
tracecomp.Bundle(),
)
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (m *MockTagEnricher) Enrich(_ context.Context, extraTags []string, dimensio
func newFactory() exp.Factory {
return NewFactory(&MockSerializer{}, &MockTagEnricher{}, func(context.Context) (string, error) {
return "", nil
})
}, nil)
}

func TestNewFactory(t *testing.T) {
Expand Down

0 comments on commit 61854d4

Please sign in to comment.