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-190] Change the default metric compression kind to be zstd. #32087

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion pkg/config/setup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const (
DefaultRuntimePoliciesDir = "/etc/datadog-agent/runtime-security.d"

// DefaultCompressorKind is the default compressor. Options available are 'zlib' and 'zstd'
DefaultCompressorKind = "zlib"
DefaultCompressorKind = "zstd"

// DefaultZstdCompressionLevel is the default compression level for `zstd`.
// Compression level 1 provides the lowest compression ratio, but uses much less RSS especially
Expand Down
2 changes: 1 addition & 1 deletion pkg/serializer/internal/metrics/service_checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestPayloadsEmptyServiceCheck(t *testing.T) {

func TestPayloadsServiceChecks(t *testing.T) {
config := mock.New(t)
config.Set("serializer_max_payload_size", 200, pkgconfigmodel.SourceAgentRuntime)
config.Set("serializer_max_payload_size", 250, pkgconfigmodel.SourceAgentRuntime)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The max compress bound for zstd is larger than for zlib. So to get this test to pass I have had to increase this size. It does indicate that a side effect of moving to zstd will be less events per payload.

When looking at the actual payload sizes in this test we have:

With Zstd:
compressed size: 108
compressed size: 108
compressed size: 92

With Zlib:
compressed size: 116
compressed size: 113
compressed size: 96


serviceCheckCollection := []ServiceChecks{
{createServiceCheck("1"), createServiceCheck("2"), createServiceCheck("3")},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Each section from every release note are combined when the
# CHANGELOG.rst is rendered. So the text needs to be worded so that
# it does not depend on any information only available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
enhancements:
- |
Metric payloads are compressed using `zstd` compression by default.
This can be reverted to the previous compression kind by adding
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This can be reverted to the previous compression kind by adding
This can be reverted to the previous compression algorithm by adding

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see why you've been with kind

``serializer_compressor_kind: zlib`` to the configuration.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
auth_token_file_path: /tmp/agent-auth-token
hostname: smp-regression

dd_url: http://127.0.0.1:9091
process_config.process_dd_url: http://localhost:9092

telemetry.enabled: true
telemetry.checks: '*'

# Disable cloud detection. This stops the Agent from poking around the
# execution environment & network. This is particularly important if the target
# has network access.
cloud_provider_metadata: []

dogstatsd_socket: '/tmp/dsd.socket'
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
optimization_goal: ingress_throughput
erratic: false

target:
name: datadog-agent
command: /bin/entrypoint.sh
cpu_allotment: 8
memory_allotment: 4GiB

environment:
DD_API_KEY: 00000001
DD_HOSTNAME: smp-regression

profiling_environment:
DD_INTERNAL_PROFILING_BLOCK_PROFILE_RATE: 10000
DD_INTERNAL_PROFILING_CPU_DURATION: 1m
DD_INTERNAL_PROFILING_DELTA_PROFILES: true
DD_INTERNAL_PROFILING_ENABLED: true
DD_INTERNAL_PROFILING_ENABLE_GOROUTINE_STACKTRACES: true
DD_INTERNAL_PROFILING_MUTEX_PROFILE_FRACTION: 10
DD_INTERNAL_PROFILING_PERIOD: 1m
DD_INTERNAL_PROFILING_UNIX_SOCKET: /var/run/datadog/apm.socket
DD_PROFILING_EXECUTION_TRACE_ENABLED: true
DD_PROFILING_EXECUTION_TRACE_PERIOD: 1m
DD_PROFILING_WAIT_PROFILE: true

DD_INTERNAL_PROFILING_EXTRA_TAGS: experiment:uds_dogstatsd_to_api
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
generator:
- unix_datagram:
seed: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131]
path: "/tmp/dsd.socket"
variant:
dogstatsd:
contexts:
inclusive:
min: 10
max: 100
name_length:
inclusive:
min: 8
max: 64
tag_length:
inclusive:
min: 4
max: 45
tags_per_msg:
inclusive:
min: 8
max: 45
multivalue_count:
inclusive:
min: 2
max: 32
multivalue_pack_probability: 0.08
kind_weights:
metric: 90
event: 5
service_check: 5
metric_weights:
count: 100
gauge: 10
timer: 0
distribution: 0
set: 0
histogram: 0
bytes_per_second: "1 MiB"
maximum_prebuild_cache_size_bytes: "500 Mb"

blackhole:
- http:
binding_addr: "127.0.0.1:9091"
response_delay_millis: 75
- http:
binding_addr: "127.0.0.1:9092"

target_metrics:
- prometheus:
uri: "http://127.0.0.1:5000/telemetry"
2 changes: 1 addition & 1 deletion test/regression/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lading:
version: 0.24.0
version: 0.25.2

target:
cpu_allotment: 8
Expand Down
Loading