Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APR-258] Add option to compress logs with zstd #27148

Merged
merged 106 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
f994dd7
Add option to compress logs with zstd.
StephenWakely Jun 28, 2024
20ad1a3
Formatting
StephenWakely Jun 28, 2024
a5f4f8e
Linters
StephenWakely Jun 28, 2024
f345970
Add telemetry to the compressor.
StephenWakely Jul 1, 2024
9e4f325
Reuse metric compression component for logs.
StephenWakely Aug 30, 2024
720586b
Add gzip strategy
StephenWakely Sep 2, 2024
d548d9c
Add gzip strategy
StephenWakely Sep 2, 2024
7e4ded1
Remove old compression code.
StephenWakely Sep 2, 2024
bb841d6
Caller can limit compression algorithms available.
StephenWakely Sep 3, 2024
03c3252
Correct compress bound for gzip.
StephenWakely Sep 4, 2024
9d6acea
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Sep 4, 2024
fd38e3c
Fix broken tests.
StephenWakely Sep 5, 2024
3ec6157
Tidy
StephenWakely Sep 5, 2024
f87e432
Fix dependency runtime errors.
StephenWakely Sep 9, 2024
38aafb7
Fix dependency for otel
StephenWakely Sep 9, 2024
37cfb7f
Wip, fix tests
StephenWakely Sep 11, 2024
08713c5
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Sep 20, 2024
8a62b59
Fix tests to load compressor from provided config.
StephenWakely Sep 20, 2024
f729333
Remove unnecessary metrics.
StephenWakely Sep 20, 2024
ad84375
Include jemalloc
StephenWakely Sep 20, 2024
de2dc05
Fix linter errors
StephenWakely Sep 23, 2024
6db5379
replace
StephenWakely Sep 25, 2024
949157d
Add logging to compression strategies
StephenWakely Sep 25, 2024
835d804
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Nov 6, 2024
0d5f4b4
Linter errors
StephenWakely Nov 7, 2024
d3ca210
Added extra build tag.
StephenWakely Nov 11, 2024
46d2553
Lint
StephenWakely Nov 11, 2024
5a6fa64
Fix tests.
StephenWakely Nov 18, 2024
6e54576
Added dependency.
StephenWakely Nov 18, 2024
b60c9e3
Linter errors
StephenWakely Nov 18, 2024
2027535
Copyrights
StephenWakely Nov 18, 2024
1c2dc1d
gofmt
StephenWakely Nov 18, 2024
3b6c13d
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Nov 19, 2024
04d9922
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Nov 19, 2024
6759dcf
Linter errors
StephenWakely Nov 19, 2024
3ea013e
Fix otel
StephenWakely Nov 19, 2024
56fbdff
Fix test.
StephenWakely Nov 20, 2024
c28eb10
Remove jemalloc
StephenWakely Nov 20, 2024
d6f30bc
Go mod tidy
StephenWakely Nov 20, 2024
a85c0ab
Squashed commit of the following:
StephenWakely Nov 21, 2024
474d995
Fixed build errors
StephenWakely Nov 21, 2024
bd5dd02
Linter errors
StephenWakely Nov 22, 2024
7cf312c
Add gzip and no build tags option.
StephenWakely Nov 22, 2024
f076eba
Fixed remaining tests
StephenWakely Nov 22, 2024
7e8853b
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Nov 22, 2024
983044b
CI Errors.
StephenWakely Nov 25, 2024
93c0fff
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Nov 27, 2024
79246d9
Lints
StephenWakely Nov 28, 2024
872a4df
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Nov 28, 2024
a11f591
Fix dodgy merge
StephenWakely Nov 28, 2024
8befb87
Fixed merge
StephenWakely Nov 28, 2024
b1b8d0d
Add missing parameter
StephenWakely Nov 28, 2024
c888885
Fix test dependency.
StephenWakely Nov 29, 2024
d8874e4
Inject compressionFactory into serverless
StephenWakely Nov 29, 2024
876b8ae
Add parameter for unsupported
StephenWakely Nov 29, 2024
320dc2b
Add some logging
StephenWakely Dec 3, 2024
703ba26
Feedback from pgimalac
StephenWakely Dec 4, 2024
fe3db79
Added compression factory for CWS reporter.
StephenWakely Dec 4, 2024
107d519
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Dec 4, 2024
616f9ac
Fixed demultiplexer test
StephenWakely Dec 4, 2024
c95cb32
More details in max size comment for gzip
StephenWakely Dec 4, 2024
09112ea
Update serverless test dependencies
StephenWakely Dec 4, 2024
13fbfd6
Remove the compression factory.
StephenWakely Dec 12, 2024
ad214bb
Remove fx-factory
StephenWakely Dec 12, 2024
b60df43
Merge remote-tracking branch 'origin' into stephen/zstd_logs
StephenWakely Dec 12, 2024
3bf2fae
Gofmt
StephenWakely Dec 12, 2024
562ae56
Update components
StephenWakely Dec 13, 2024
d22884a
Update components
StephenWakely Dec 13, 2024
5b7f07e
TEMPORARILY change the default compression for logs
StephenWakely Dec 13, 2024
2b3b083
Remove unused code
StephenWakely Dec 16, 2024
b6d5380
Fixed tests.
StephenWakely Dec 17, 2024
ce2a5ff
Added a NoopCompressor module.
StephenWakely Dec 17, 2024
a61f56d
Merge branch 'main' into stephen/zstd_logs
remeh Dec 20, 2024
7b0caf9
inv tidy && inv tidy
remeh Dec 20, 2024
d55cf94
PR feedback
jszwedko Dec 20, 2024
3bc1ad9
Replace version numbers for compression module
jszwedko Dec 20, 2024
c3f4e4e
Avoid throwing away error
jszwedko Dec 20, 2024
219ab7f
Create multiple components
StephenWakely Dec 20, 2024
cda88e9
Refactor to separate components
StephenWakely Jan 3, 2025
f7a59b5
Passed lints
StephenWakely Jan 7, 2025
fb0fadc
Fix tests
StephenWakely Jan 9, 2025
a53f926
Added separate otel compression component.
StephenWakely Jan 10, 2025
23bb4da
Fix otel integration test.
StephenWakely Jan 10, 2025
11c6975
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Jan 10, 2025
2bca491
Lints
StephenWakely Jan 13, 2025
d1883bf
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Jan 13, 2025
7e4cbe6
Fix tests.
StephenWakely Jan 13, 2025
82a66c6
Lints
StephenWakely Jan 13, 2025
db10f48
More lints
StephenWakely Jan 13, 2025
5f75fa9
Lints
StephenWakely Jan 13, 2025
5081593
Extra module replaces
StephenWakely Jan 14, 2025
ce710df
Fix modules
StephenWakely Jan 14, 2025
12b8f2d
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Jan 14, 2025
3a5ac7b
Fix go versions for otel
StephenWakely Jan 14, 2025
c5a1010
Lints
StephenWakely Jan 14, 2025
243d01d
More lints
StephenWakely Jan 14, 2025
820f26f
Provide fx
StephenWakely Jan 15, 2025
bce1dc4
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Jan 15, 2025
da72b2f
Update compression module name.
StephenWakely Jan 15, 2025
746fe48
Inject metrics compression for systray.
StephenWakely Jan 15, 2025
7566372
Revert serverless test module
StephenWakely Jan 15, 2025
4dbb30b
Updated with feedback from Olivier
StephenWakely Jan 15, 2025
77cc39f
Fix fromconfig.
StephenWakely Jan 16, 2025
1c75357
Merge remote-tracking branch 'origin/main' into stephen/zstd_logs
StephenWakely Jan 16, 2025
63770e2
Feedback from Rémy and Brian
StephenWakely Jan 16, 2025
fdc16ca
Update copyright
StephenWakely Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@
/comp/haagent @DataDog/ndm-core
/comp/languagedetection/client @DataDog/container-platform
/comp/rdnsquerier @DataDog/ndm-integrations
/comp/serializer/compression @DataDog/agent-metrics-logs
/comp/serializer/logscompression @DataDog/agent-processing-and-routing
/comp/serializer/metricscompression @DataDog/agent-processing-and-routing
/comp/snmpscan @DataDog/ndm-core
# END COMPONENTS

Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ workflow:
- comp/dogstatsd/**/*
- comp/forwarder/**/*
- comp/logs/**/*
- comp/serializer/compression/**/*
- comp/serializer/**/*
- pkg/aggregator/**/*
- pkg/collector/**/*
- pkg/commonchecks/**/*
Expand Down
6 changes: 4 additions & 2 deletions cmd/agent/subcommands/diagnose/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import (
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompressorfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompressorfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/pkg/api/util"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/diagnose"
Expand Down Expand Up @@ -104,9 +105,10 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
fx.Supply(option.None[collector.Component]()),
dualTaggerfx.Module(common.DualTaggerParams()),
autodiscoveryimpl.Module(),
compressionfx.Module(),
diagnosesendermanagerimpl.Module(),
haagentfx.Module(),
logscompressorfx.Module(),
metricscompressorfx.Module(),
)
},
}
Expand Down
6 changes: 4 additions & 2 deletions cmd/agent/subcommands/flare/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ import (
"github.com/DataDog/datadog-agent/comp/metadata/inventoryhost/inventoryhostimpl"
"github.com/DataDog/datadog-agent/comp/metadata/inventoryotel/inventoryotelimpl"
"github.com/DataDog/datadog-agent/comp/metadata/resources/resourcesimpl"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompressorfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompressorfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/pkg/api/util"
"github.com/DataDog/datadog-agent/pkg/config/settings"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
Expand Down Expand Up @@ -131,7 +132,6 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
localTaggerfx.Module(tagger.Params{}),
autodiscoveryimpl.Module(),
fx.Supply(option.None[collector.Component]()),
compressionfx.Module(),
diagnosesendermanagerimpl.Module(),
// We need inventoryagent to fill the status page generated by the flare.
inventoryagentimpl.Module(),
Expand All @@ -147,6 +147,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
}),
core.Bundle(),
haagentfx.Module(),
logscompressorfx.Module(),
metricscompressorfx.Module(),
)
},
}
Expand Down
6 changes: 4 additions & 2 deletions cmd/agent/subcommands/jmx/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ import (
integrations "github.com/DataDog/datadog-agent/comp/logs/integrations/def"
"github.com/DataDog/datadog-agent/comp/remote-config/rcservice"
"github.com/DataDog/datadog-agent/comp/remote-config/rcservicemrf"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompression "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/pkg/aggregator/sender"
"github.com/DataDog/datadog-agent/pkg/cli/standalone"
pkgcollector "github.com/DataDog/datadog-agent/pkg/collector"
Expand Down Expand Up @@ -129,7 +130,6 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
fx.Supply(cliParams),
fx.Supply(params),
core.Bundle(),
compressionfx.Module(),
diagnosesendermanagerimpl.Module(),
fx.Supply(func(diagnoseSenderManager diagnosesendermanager.Component) (sender.SenderManager, error) {
return diagnoseSenderManager.LazyGetSenderManager()
Expand Down Expand Up @@ -168,6 +168,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
}),
fx.Provide(func() remoteagentregistry.Component { return nil }),
haagentfx.Module(),
logscompression.Module(),
metricscompression.Module(),
)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
agenttelemetry "github.com/DataDog/datadog-agent/comp/core/agenttelemetry/def"
agenttelemetryfx "github.com/DataDog/datadog-agent/comp/core/agenttelemetry/fx"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"

// checks implemented as components

Expand Down Expand Up @@ -124,6 +123,7 @@ import (
"github.com/DataDog/datadog-agent/comp/remote-config/rcservice/rcserviceimpl"
"github.com/DataDog/datadog-agent/comp/remote-config/rcservicemrf/rcservicemrfimpl"
"github.com/DataDog/datadog-agent/comp/remote-config/rctelemetryreporter/rctelemetryreporterimpl"
metricscompressorfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/comp/snmptraps"
snmptrapsServer "github.com/DataDog/datadog-agent/comp/snmptraps/server"
traceagentStatusImpl "github.com/DataDog/datadog-agent/comp/trace/status/statusimpl"
Expand Down Expand Up @@ -380,7 +380,6 @@ func getSharedFxOption() fx.Option {
authtokenimpl.Module(),
apiimpl.Module(),
commonendpoints.Module(),
compressionfx.Module(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams(demultiplexerimpl.WithDogstatsdNoAggregationPipelineConfig())),
demultiplexerendpointfx.Module(),
dogstatsd.Bundle(dogstatsdServer.Params{Serverless: false}),
Expand Down Expand Up @@ -474,6 +473,7 @@ func getSharedFxOption() fx.Option {
networkpath.Bundle(),
remoteagentregistryfx.Module(),
haagentfx.Module(),
metricscompressorfx.Module(),
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason we don't need the logscompression.Module() here? (while for instance we need it in the JMX command. FWIW it seems we need it in all other commands)

Copy link
Contributor Author

@StephenWakely StephenWakely Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is being provided by process.Bundle(). It needs to be in this bundle, because that also includes the eventplatformimpl component which needs the logscompression component.

}

Expand Down
9 changes: 6 additions & 3 deletions cmd/agent/subcommands/snmp/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import (
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompression "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
snmpscan "github.com/DataDog/datadog-agent/comp/snmpscan/def"
snmpscanfx "github.com/DataDog/datadog-agent/comp/snmpscan/fx"
"github.com/DataDog/datadog-agent/pkg/networkdevice/metadata"
Expand Down Expand Up @@ -98,10 +99,11 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))),
orchestratorimpl.Module(orchestratorimpl.NewDefaultParams()),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),
compressionfx.Module(),
nooptagger.Module(),
eventplatformreceiverimpl.Module(),
haagentfx.Module(),
metricscompression.Module(),
logscompression.Module(),
)
if err != nil {
var ue configErr
Expand Down Expand Up @@ -162,10 +164,11 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),
eventplatformreceiverimpl.Module(),
compressionfx.Module(),
nooptagger.Module(),
snmpscanfx.Module(),
haagentfx.Module(),
metricscompression.Module(),
logscompression.Module(),
)
if err != nil {
var ue configErr
Expand Down
6 changes: 4 additions & 2 deletions cmd/cluster-agent-cloudfoundry/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ import (
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
integrations "github.com/DataDog/datadog-agent/comp/logs/integrations/def"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/pkg/clusteragent"
"github.com/DataDog/datadog-agent/pkg/clusteragent/clusterchecks"
pkgcollector "github.com/DataDog/datadog-agent/pkg/collector"
Expand Down Expand Up @@ -86,7 +87,6 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
}),
core.Bundle(),
forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithResolvers())),
compressionfx.Module(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()),
orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDisabledParams()),
eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()),
Expand Down Expand Up @@ -128,6 +128,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
proccontainers.InitSharedContainerProvider(wmeta, tagger)
}),
haagentfx.Module(),
logscompressionfx.Module(),
metricscompressionfx.Module(),
)
},
}
Expand Down
2 changes: 0 additions & 2 deletions cmd/cluster-agent/subcommands/diagnose/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/DataDog/datadog-agent/comp/core/config"
log "github.com/DataDog/datadog-agent/comp/core/log/def"
"github.com/DataDog/datadog-agent/comp/core/secrets"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
"github.com/DataDog/datadog-agent/pkg/diagnose"
"github.com/DataDog/datadog-agent/pkg/diagnose/diagnosis"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
Expand All @@ -38,7 +37,6 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
LogParams: log.ForOneShot(command.LoggerName, "off", true), // no need to show regular logs
}),
core.Bundle(),
compressionfx.Module(),
)
},
}
Expand Down
10 changes: 7 additions & 3 deletions cmd/cluster-agent/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ import (
rccomp "github.com/DataDog/datadog-agent/comp/remote-config/rcservice"
"github.com/DataDog/datadog-agent/comp/remote-config/rcservice/rcserviceimpl"
"github.com/DataDog/datadog-agent/comp/remote-config/rctelemetryreporter/rctelemetryreporterimpl"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/def"
logscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/pkg/clusteragent"
admissionpkg "github.com/DataDog/datadog-agent/pkg/clusteragent/admission"
admissionpatch "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/patch"
Expand Down Expand Up @@ -137,7 +139,6 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
}),
core.Bundle(),
forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithResolvers(), defaultforwarder.WithDisableAPIKeyChecking())),
compressionfx.Module(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()),
orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDefaultParams()),
eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()),
Expand Down Expand Up @@ -204,6 +205,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
proccontainers.InitSharedContainerProvider(wmeta, tagger)
}),
haagentfx.Module(),
logscompressionfx.Module(),
metricscompressionfx.Module(),
)
},
}
Expand All @@ -226,6 +229,7 @@ func start(log log.Component,
logReceiver option.Option[integrations.Component],
_ healthprobe.Component,
settings settings.Component,
compression logscompression.Component,
datadogConfig config.Component,
) error {
stopCh := make(chan struct{})
Expand Down Expand Up @@ -441,7 +445,7 @@ func start(log log.Component,
go func() {
defer wg.Done()

if err := runCompliance(mainCtx, demultiplexer, wmeta, apiCl, le.IsLeader); err != nil {
if err := runCompliance(mainCtx, demultiplexer, wmeta, apiCl, compression, le.IsLeader); err != nil {
pkglog.Errorf("Error while running compliance agent: %v", err)
}
}()
Expand Down
9 changes: 5 additions & 4 deletions cmd/cluster-agent/subcommands/start/compliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"github.com/DataDog/datadog-agent/comp/logs/agent/config"
logscompression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/def"
"github.com/DataDog/datadog-agent/pkg/aggregator/sender"
"github.com/DataDog/datadog-agent/pkg/compliance"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
Expand All @@ -31,9 +32,9 @@ const (
intakeTrackType = "compliance"
)

func runCompliance(ctx context.Context, senderManager sender.SenderManager, wmeta workloadmeta.Component, apiCl *apiserver.APIClient, isLeader func() bool) error {
func runCompliance(ctx context.Context, senderManager sender.SenderManager, wmeta workloadmeta.Component, apiCl *apiserver.APIClient, compression logscompression.Component, isLeader func() bool) error {
stopper := startstop.NewSerialStopper()
if err := startCompliance(senderManager, wmeta, stopper, apiCl, isLeader); err != nil {
if err := startCompliance(senderManager, wmeta, stopper, apiCl, isLeader, compression); err != nil {
return err
}

Expand Down Expand Up @@ -72,7 +73,7 @@ func newLogContextCompliance() (*config.Endpoints, *client.DestinationsContext,
return newLogContext(logsConfigComplianceKeys, "cspm-intake.")
}

func startCompliance(senderManager sender.SenderManager, wmeta workloadmeta.Component, stopper startstop.Stopper, apiCl *apiserver.APIClient, isLeader func() bool) error {
func startCompliance(senderManager sender.SenderManager, wmeta workloadmeta.Component, stopper startstop.Stopper, apiCl *apiserver.APIClient, isLeader func() bool, compression logscompression.Component) error {
endpoints, ctx, err := newLogContextCompliance()
if err != nil {
log.Error(err)
Expand All @@ -87,7 +88,7 @@ func startCompliance(senderManager sender.SenderManager, wmeta workloadmeta.Comp
return err
}

reporter := compliance.NewLogReporter(hname, "compliance-agent", "compliance", endpoints, ctx)
reporter := compliance.NewLogReporter(hname, "compliance-agent", "compliance", endpoints, ctx, compression)
statsdClient, err := simpleTelemetrySenderFromSenderManager(senderManager)
if err != nil {
return err
Expand Down
6 changes: 4 additions & 2 deletions cmd/dogstatsd/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ import (
"github.com/DataDog/datadog-agent/comp/metadata/resources/resourcesimpl"
"github.com/DataDog/datadog-agent/comp/metadata/runner"
metadatarunnerimpl "github.com/DataDog/datadog-agent/comp/metadata/runner/runnerimpl"
compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx"
logscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx"
"github.com/DataDog/datadog-agent/pkg/serializer"
"github.com/DataDog/datadog-agent/pkg/status/health"
"github.com/DataDog/datadog-agent/pkg/util/coredump"
Expand Down Expand Up @@ -141,7 +142,8 @@ func RunDogstatsdFct(cliParams *CLIParams, defaultConfPath string, defaultLogFil
AgentType: workloadmeta.NodeAgent,
InitHelper: common.GetWorkloadmetaInit(),
}),
compressionfx.Module(),
metricscompressionfx.Module(),
logscompressionfx.Module(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams(
demultiplexerimpl.WithContinueOnMissingHostname(),
demultiplexerimpl.WithDogstatsdNoAggregationPipelineConfig(),
Expand Down
15 changes: 11 additions & 4 deletions cmd/otel-agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
remoteTaggerFx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote"
taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types"
"github.com/DataDog/datadog-agent/comp/core/telemetry/telemetryimpl"

workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx"
"github.com/DataDog/datadog-agent/comp/dogstatsd/statsd"
Expand All @@ -48,7 +47,9 @@ import (
"github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl"
"github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter"
"github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient"
compressionfxzlib "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-zlib"
logscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
metricscompression "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/def"
metricscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/metricscompression/fx-otel"
traceagentfx "github.com/DataDog/datadog-agent/comp/trace/agent/fx"
traceagentcomp "github.com/DataDog/datadog-agent/comp/trace/agent/impl"
gzipfx "github.com/DataDog/datadog-agent/comp/trace/compression/fx-gzip"
Expand All @@ -58,6 +59,7 @@ import (
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/serializer"
"github.com/DataDog/datadog-agent/pkg/trace/telemetry"
"github.com/DataDog/datadog-agent/pkg/util/compression"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/option"

Expand Down Expand Up @@ -160,8 +162,13 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams,
return log.ForDaemon(params.LoggerName, "log_file", pkgconfigsetup.DefaultOTelAgentLogFile)
}),
logsagentpipelineimpl.Module(),
// We directly select fxzlib
compressionfxzlib.Module(),
logscompressionfx.Module(),
metricscompressionfx.Module(),
// For FX to provide the compression.Compressor interface (used by serializer.NewSerializer)
// implemented by the metricsCompression.Component
fx.Provide(func(c metricscompression.Component) compression.Compressor {
StephenWakely marked this conversation as resolved.
Show resolved Hide resolved
return c
}),
fx.Provide(serializer.NewSerializer),
// For FX to provide the serializer.MetricSerializer from the serializer.Serializer
fx.Provide(func(s *serializer.Serializer) serializer.MetricSerializer {
Expand Down
7 changes: 5 additions & 2 deletions cmd/security-agent/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import (
"github.com/DataDog/datadog-agent/comp/dogstatsd"
"github.com/DataDog/datadog-agent/comp/dogstatsd/statsd"
"github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl"
logscompression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/def"
logscompressionfx "github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx"
commonsettings "github.com/DataDog/datadog-agent/pkg/config/settings"

"github.com/DataDog/datadog-agent/pkg/collector/python"
Expand Down Expand Up @@ -124,7 +126,7 @@ func (s *service) Run(svcctx context.Context) error {
workloadmetafx.Module(workloadmeta.Params{
AgentType: workloadmeta.Remote,
}),
fx.Provide(func(log log.Component, config config.Component, statsd statsd.Component, wmeta workloadmeta.Component) (status.InformationProvider, *agent.RuntimeSecurityAgent, error) {
fx.Provide(func(log log.Component, config config.Component, statsd statsd.Component, wmeta workloadmeta.Component, compression logscompression.Component) (status.InformationProvider, *agent.RuntimeSecurityAgent, error) {
stopper := startstop.NewSerialStopper()

statsdClient, err := statsd.CreateForHostPort(setup.GetBindHost(config), config.GetInt("dogstatsd_port"))
Expand All @@ -138,7 +140,7 @@ func (s *service) Run(svcctx context.Context) error {
return status.NewInformationProvider(nil), nil, err
}

runtimeAgent, err := runtime.StartRuntimeSecurity(log, config, hostnameDetected, stopper, statsdClient, wmeta)
runtimeAgent, err := runtime.StartRuntimeSecurity(log, config, hostnameDetected, stopper, statsdClient, wmeta, compression)
if err != nil {
return status.NewInformationProvider(nil), nil, err
}
Expand Down Expand Up @@ -175,6 +177,7 @@ func (s *service) Run(svcctx context.Context) error {
}
}),
settingsimpl.Module(),
logscompressionfx.Module(),
)

return err
Expand Down
Loading
Loading