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

Improve auto multiline v2 truncation behavior to be consistent with single line logs #32831

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gh123man
Copy link
Member

@gh123man gh123man commented Jan 9, 2025

What does this PR do?

Use the same truncation logic as the single line handler (introduced previously in this PR #30434). While the current approach correctly truncated joined multiline logs, it did not consistently handle single line logs that were too long.

This PR also removes the possibility for duplicate truncated tags to occur in single line mode.

Motivation

Describe how you validated your changes

There are a few permutations to test:

Base settings for all tests:

logs_enabled: true
logs_config:
    experimental_auto_multi_line_detection: true
    tag_multi_line_logs: true
    tag_truncated_logs: true

Test 1 - happy path. Send multiline logs and confirm the are correctly aggregated ex:

2024-08-14 18:06:05 INFO Main main Some log line 150
2024-08-14 18:06:05 SEVERE Main main Exception occur
java.lang.Exception: boom
	at Main.funcd(Main.java:50)
	at Main.funcc(Main.java:49)
	at Main.funcb(Main.java:48)
	at Main.funca(Main.java:47)
	at Main.main(Main.java:29)

2024-08-14 18:06:05 INFO Main main Some log line 151
2024-08-14 18:06:05 INFO Main main Some log line 152
2024-08-14 18:06:05 WARNING Main main something happened!!

Test 2 - limit the max line length:

logs_config:
    max_message_size_bytes: 50

Send the same logs and they should be truncated like this:
image

Note that each multiline log segment has the start/end truncation.
Single line logs are also correctly truncated.

Test 3 - in the logs explorer search for

host:<HOST_NAME> multiline:* truncated:* and ensure you can find all the multiline and truncated logs.

Test 4 - Test single line logs only have 1 tag

with the same settings as test 3, disable experimental_auto_multi_line_detection. tail the logs again and search for them with this query:

``host:<HOST_NAME> truncated:single_line`

confirm that the tag only exists once.

Possible Drawbacks / Trade-offs

Additional Notes

@gh123man gh123man added this to the 7.63.0 milestone Jan 9, 2025
@github-actions github-actions bot added medium review PR review might take time team/agent-metrics-logs labels Jan 9, 2025
@agent-platform-auto-pr
Copy link
Contributor

Uncompressed package size comparison

Comparison with ancestor 3f997d247e11871e8395be4aa8cae1250c6f7c14

Diff per package
package diff status size ancestor threshold
datadog-heroku-agent-amd64-deb 0.01MB ⚠️ 506.57MB 506.56MB 0.50MB
datadog-iot-agent-arm64-deb 0.01MB ⚠️ 109.44MB 109.43MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.01MB ⚠️ 109.51MB 109.50MB 0.50MB
datadog-agent-x86_64-rpm 0.00MB 1022.09MB 1022.08MB 0.50MB
datadog-agent-x86_64-suse 0.00MB 1022.09MB 1022.08MB 0.50MB
datadog-agent-amd64-deb 0.00MB 1012.77MB 1012.77MB 0.50MB
datadog-agent-arm64-deb 0.00MB 941.95MB 941.94MB 0.50MB
datadog-iot-agent-amd64-deb 0.00MB 114.01MB 114.01MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 114.08MB 114.08MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 114.08MB 114.08MB 0.50MB
datadog-agent-aarch64-rpm 0.00MB 951.24MB 951.24MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 58.82MB 58.82MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 58.90MB 58.90MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 58.90MB 58.90MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 56.33MB 56.33MB 0.50MB

Decision

⚠️ Warning

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jan 9, 2025

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=52601934 --os-family=ubuntu

Note: This applies to commit a4342a7

@gh123man gh123man added the qa/done QA done before merge and regressions are covered by tests label Jan 9, 2025
@gh123man gh123man marked this pull request as ready for review January 9, 2025 21:14
@gh123man gh123man requested a review from a team as a code owner January 9, 2025 21:14
Copy link

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: ccdf3d46-4372-40e2-a1a4-2cdf3dc5a82d

Baseline: 3f997d2
Comparison: a4342a7
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
uds_dogstatsd_to_api_cpu % cpu utilization +3.78 [+3.09, +4.48] 1 Logs
quality_gate_logs % cpu utilization +2.21 [-1.03, +5.44] 1 Logs
quality_gate_idle_all_features memory utilization +0.10 [+0.01, +0.19] 1 Logs bounds checks dashboard
file_tree memory utilization +0.09 [-0.04, +0.22] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.08 [+0.02, +0.14] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.08 [-0.83, +1.00] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.03 [-0.83, +0.89] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.02 [-0.65, +0.69] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.00 [-0.77, +0.77] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.01 [-0.83, +0.81] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.02 [-0.66, +0.62] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.02 [-0.14, +0.10] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.06 [-0.52, +0.39] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.15 [-0.92, +0.63] 1 Logs
quality_gate_idle memory utilization -0.60 [-0.64, -0.56] 1 Logs bounds checks dashboard

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/agent-metrics-logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant