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

[Serverless] Always create REPORT log message when logs enabled. #21783

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

purple4reina
Copy link
Contributor

What does this PR do?

Ensures that the REPORT log message is sent even when enhanced metrics are disabled.

Motivation

Customer reported issue, not seeing REPORT log when adding DD_ENHANCED_METRICS=false.

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided. Except if the qa/skip-qa label, with required either qa/done or qa/no-code-change labels, are applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

https://datadoghq.atlassian.net/browse/SVLS-4311

@purple4reina purple4reina added changelog/no-changelog [deprecated] qa/skip-qa - use other qa/ labels [DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card team/serverless qa/done QA done before merge and regressions are covered by tests labels Dec 27, 2023
@purple4reina purple4reina added this to the Triage milestone Dec 27, 2023
@purple4reina purple4reina requested a review from a team as a code owner December 27, 2023 20:43
@@ -673,65 +673,70 @@ func TestProcessLogMessageLogsNotEnabled(t *testing.T) {
}

func TestProcessLogMessagesTimeoutLogFromReportLog(t *testing.T) {
logChannel := make(chan *config.ChannelMessage)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of this huge diff is just adding a subtest with t.Run, which required indenting the whole test.

Copy link
Contributor

@joeyzhao2018 joeyzhao2018 left a comment

Choose a reason for hiding this comment

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

🚢

@purple4reina purple4reina force-pushed the rey.abolofia/report-log branch from 8357975 to 865272f Compare January 2, 2024 18:27
@purple4reina
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 2, 2024

🚂 MergeQueue

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

you can cancel this operation by commenting your pull request with /merge -c!

@dd-devflow
Copy link

dd-devflow bot commented Jan 2, 2024

⚠️ MergeQueue

This merge request was unqueued

If you need support, contact us on slack #ci-interfaces!

@purple4reina purple4reina modified the milestone: Triage Jan 4, 2024
@purple4reina
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 4, 2024

🚂 MergeQueue

Pull request added to the queue.

There are 2 builds ahead! (estimated merge in less than 45m)

you can cancel this operation by commenting your pull request with /merge -c!

@dd-devflow
Copy link

dd-devflow bot commented Jan 4, 2024

❌ MergeQueue

PR can't be merged according to github policy

If you need support, contact us on slack #ci-interfaces with those details!

@purple4reina purple4reina force-pushed the rey.abolofia/report-log branch from 865272f to 111b25e Compare January 4, 2024 17:36
@purple4reina
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 4, 2024

🚂 MergeQueue

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

you can cancel this operation by commenting your pull request with /merge -c!

@purple4reina
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 4, 2024

🚂 MergeQueue

Pull request added to the queue.

This build is going to start soon! (estimated merge in less than 45m)

you can cancel this operation by commenting your pull request with /merge -c!

@dd-devflow
Copy link

dd-devflow bot commented Jan 4, 2024

❌ MergeQueue

Tests failed on this commit c23a929

You should fix those tests and then re-add your pull request to the queue!

Details

checks are failing:

  • log on arm64
  • log on amd64

If you need support, contact us on slack #ci-interfaces with those details!

@purple4reina purple4reina force-pushed the rey.abolofia/report-log branch from 111b25e to 6b693a6 Compare January 4, 2024 21:01
@pr-commenter
Copy link

pr-commenter bot commented Jan 4, 2024

Bloop Bleep... Dogbot Here

Regression Detector Results

Run ID: 87f60ee6-d73d-4b6f-a8b2-ab8ac17063c1
Baseline: 4960c63
Comparison: 1f45318
Total CPUs: 7

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

No significant changes in experiment optimization goals

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

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI
file_to_blackhole % cpu utilization +1.07 [-5.50, +7.63]
idle memory utilization -0.29 [-0.32, -0.26]
file_tree memory utilization -0.83 [-0.93, -0.73]

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
file_to_blackhole % cpu utilization +1.07 [-5.50, +7.63]
process_agent_standard_check memory utilization +0.71 [+0.66, +0.76]
trace_agent_json ingress throughput +0.03 [+0.01, +0.06]
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.05, +0.05]
uds_dogstatsd_to_api ingress throughput -0.00 [-0.03, +0.03]
trace_agent_msgpack ingress throughput -0.03 [-0.05, -0.02]
process_agent_real_time_mode memory utilization -0.09 [-0.12, -0.06]
otel_to_otel_logs ingress throughput -0.10 [-0.83, +0.62]
process_agent_standard_check_with_stats memory utilization -0.24 [-0.29, -0.19]
idle memory utilization -0.29 [-0.32, -0.26]
tcp_syslog_to_blackhole ingress throughput -0.38 [-0.45, -0.32]
file_tree memory utilization -0.83 [-0.93, -0.73]

Explanation

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".

@purple4reina purple4reina force-pushed the rey.abolofia/report-log branch from 6b693a6 to 8ed0093 Compare January 5, 2024 16:35
@purple4reina
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 5, 2024

🚂 MergeQueue

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

you can cancel this operation by commenting your pull request with /merge -c!

@purple4reina purple4reina force-pushed the rey.abolofia/report-log branch from 8ed0093 to 1f45318 Compare January 5, 2024 20:07
Copy link
Contributor

github-actions bot commented Jan 5, 2024

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between 4960c63 and b75e889.

tl;dr
  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type.

How do I interpret these charts?

The charts below comes from benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

Benchmark stats
goos: linux
goarch: amd64
pkg: github.com/DataDog/datadog-agent/pkg/serverless/daemon
cpu: AMD EPYC 7763 64-Core Processor                
                                      │    previous     │                 current                  │
                                      │     sec/op      │    sec/op     vs base                    │
api-gateway-appsec.json                  91.29µ ±  4%     90.19µ ±  3%        ~ (p=0.315 n=10)
api-gateway-kong-appsec.json             68.58µ ±  3%     68.59µ ±  2%        ~ (p=0.684 n=10)
api-gateway-kong.json                    67.87µ ±  3%     65.82µ ±  3%   -3.03% (p=0.035 n=10)
api-gateway-non-proxy-async.json         104.2µ ±  2%     104.3µ ±  3%        ~ (p=0.739 n=10)
api-gateway-non-proxy.json               102.2µ ±  3%     102.6µ ±  3%        ~ (p=0.739 n=10)
api-gateway-websocket-connect.json       72.16µ ±  2%     71.61µ ±  4%        ~ (p=0.393 n=10)
api-gateway-websocket-default.json       64.30µ ±  3%     63.16µ ±  2%        ~ (p=0.063 n=10)
api-gateway-websocket-disconnect.json    61.90µ ±  4%     62.05µ ±  4%        ~ (p=0.739 n=10)
api-gateway.json                         122.0µ ±  5%     115.5µ ±  6%   -5.35% (p=0.023 n=10)
application-load-balancer.json           65.02µ ±  6%     59.09µ ±  3%   -9.12% (p=0.000 n=10)
cloudfront.json                          52.44µ ± 14%     47.55µ ±  8%   -9.34% (p=0.023 n=10)
cloudwatch-events.json                   42.63µ ±  5%     38.45µ ±  3%   -9.80% (p=0.001 n=10)
cloudwatch-logs.json                     58.33µ ±  5%     51.66µ ±  5%  -11.45% (p=0.000 n=10)
custom.json                              31.89µ ±  9%     29.31µ ±  2%   -8.10% (p=0.000 n=10)
dynamodb.json                           115.47µ ± 16%     99.84µ ±  8%        ~ (p=0.052 n=10)
empty.json                               39.66µ ± 16%     33.80µ ± 12%        ~ (p=0.052 n=10)
eventbridge-custom.json                  45.92µ ±  7%     48.26µ ± 14%        ~ (p=0.363 n=10)
http-api.json                            94.54µ ± 13%     86.31µ ±  5%        ~ (p=0.063 n=10)
kinesis-batch.json                       98.67µ ±  5%     90.50µ ± 10%   -8.28% (p=0.000 n=10)
kinesis.json                             74.79µ ± 12%     65.32µ ± 19%  -12.67% (p=0.043 n=10)
s3.json                                  84.58µ ± 40%     82.37µ ± 19%        ~ (p=0.515 n=10+8)
sns-batch.json                           135.1µ ±   ∞ ¹
geomean                                  71.96µ           65.91µ         -5.62%                  ²
¹ need >= 6 samples for confidence interval at level 0.95
² benchmark set differs from baseline; geomeans may not be comparable

                                      │    previous     │                 current                  │
                                      │      B/op       │     B/op       vs base                   │
api-gateway-appsec.json                 41.88Ki ±  3%     41.87Ki ±  3%       ~ (p=0.971 n=10)
api-gateway-kong-appsec.json            27.95Ki ± 10%     27.95Ki ± 12%       ~ (p=0.491 n=10)
api-gateway-kong.json                   25.29Ki ± 26%     25.29Ki ±  0%       ~ (p=0.361 n=10)
api-gateway-non-proxy-async.json        51.34Ki ±  0%     51.34Ki ±  0%       ~ (p=1.000 n=10)
api-gateway-non-proxy.json              49.90Ki ±  0%     49.90Ki ±  0%       ~ (p=0.591 n=10)
api-gateway-websocket-connect.json      29.11Ki ±  0%     29.11Ki ±  0%       ~ (p=0.588 n=10)
api-gateway-websocket-default.json      23.26Ki ±  0%     23.25Ki ±  0%       ~ (p=0.424 n=10)
api-gateway-websocket-disconnect.json   22.89Ki ±  0%     22.89Ki ±  0%       ~ (p=0.752 n=10)
api-gateway.json                        53.82Ki ±  0%     53.82Ki ±  0%       ~ (p=0.782 n=10)
application-load-balancer.json          22.90Ki ±  0%     22.90Ki ±  0%       ~ (p=0.754 n=10)
cloudfront.json                         18.43Ki ±  0%     18.43Ki ±  0%       ~ (p=0.085 n=10)
cloudwatch-events.json                  11.46Ki ±  0%     11.46Ki ±  0%       ~ (p=0.250 n=10)
cloudwatch-logs.json                    53.28Ki ±  0%     53.28Ki ±  0%  -0.01% (p=0.004 n=10)
custom.json                             9.215Ki ±  0%     9.216Ki ±  0%       ~ (p=0.358 n=10)
dynamodb.json                           43.24Ki ±  0%     43.24Ki ±  0%       ~ (p=0.340 n=10)
empty.json                              8.708Ki ±  0%     8.709Ki ±  0%       ~ (p=0.464 n=10)
eventbridge-custom.json                 13.18Ki ±  0%     13.18Ki ±  0%       ~ (p=0.307 n=10)
http-api.json                           24.10Ki ±  0%     24.10Ki ±  0%       ~ (p=0.064 n=10)
kinesis-batch.json                      28.40Ki ±  0%     28.41Ki ±  0%       ~ (p=0.467 n=10)
kinesis.json                            18.14Ki ±  0%     18.13Ki ±  0%       ~ (p=0.115 n=10)
s3.json                                 20.86Ki ±  0%     20.86Ki ±  0%       ~ (p=0.912 n=10+8)
sns-batch.json                          41.55Ki ±   ∞ ¹
geomean                                 25.39Ki           24.81Ki        -0.00%                  ²
¹ need >= 6 samples for confidence interval at level 0.95
² benchmark set differs from baseline; geomeans may not be comparable

                                      │   previous   │                current                │
                                      │  allocs/op   │ allocs/op   vs base                   │
api-gateway-appsec.json                 630.0 ± 0%     630.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway-kong-appsec.json            487.0 ± 0%     487.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway-kong.json                   465.0 ± 0%     465.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway-non-proxy-async.json        722.0 ± 0%     722.0 ± 0%       ~ (p=0.628 n=10)
api-gateway-non-proxy.json              712.0 ± 0%     712.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway-websocket-connect.json      452.0 ± 0%     452.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway-websocket-default.json      377.0 ± 0%     377.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway-websocket-disconnect.json   367.0 ± 0%     367.0 ± 0%       ~ (p=1.000 n=10)   ¹
api-gateway.json                        786.0 ± 0%     786.0 ± 0%       ~ (p=1.000 n=10)
application-load-balancer.json          348.0 ± 0%     348.0 ± 0%       ~ (p=1.000 n=10)
cloudfront.json                         280.0 ± 0%     280.0 ± 0%       ~ (p=1.000 n=10)   ¹
cloudwatch-events.json                  217.0 ± 0%     217.0 ± 0%       ~ (p=1.000 n=10)   ¹
cloudwatch-logs.json                    211.0 ± 0%     211.0 ± 0%       ~ (p=1.000 n=10)   ¹
custom.json                             165.0 ± 0%     165.0 ± 0%       ~ (p=1.000 n=10)   ¹
dynamodb.json                           584.0 ± 0%     584.0 ± 0%       ~ (p=1.000 n=10)   ¹
empty.json                              156.0 ± 0%     156.0 ± 0%       ~ (p=1.000 n=10)   ¹
eventbridge-custom.json                 249.0 ± 0%     249.0 ± 0%       ~ (p=1.000 n=10)   ¹
http-api.json                           424.0 ± 0%     424.0 ± 0%       ~ (p=0.474 n=10)
kinesis-batch.json                      384.0 ± 0%     384.0 ± 0%       ~ (p=1.000 n=10)   ¹
kinesis.json                            279.0 ± 0%     279.0 ± 0%       ~ (p=1.000 n=10)
s3.json                                 350.0 ± 0%     350.0 ± 0%       ~ (p=0.889 n=10+8)
sns-batch.json                          443.0 ±  ∞ ²
geomean                                 374.9          372.0       +0.00%                  ³
¹ all samples are equal
² need >= 6 samples for confidence interval at level 0.95
³ benchmark set differs from baseline; geomeans may not be comparable

@purple4reina
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 6, 2024

🚂 MergeQueue

Pull request added to the queue.

This build is going to start soon! (estimated merge in less than 44m)

you can cancel this operation by commenting your pull request with /merge -c!

@dd-mergequeue dd-mergequeue bot merged commit 900a2d6 into main Jan 6, 2024
181 checks passed
@dd-mergequeue dd-mergequeue bot deleted the rey.abolofia/report-log branch January 6, 2024 11:13
DylanLovesCoffee pushed a commit that referenced this pull request Jan 18, 2024
[Serverless] Always create REPORT log message when logs enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog [deprecated] qa/skip-qa - use other qa/ labels [DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card mergequeue-status: done qa/done QA done before merge and regressions are covered by tests team/serverless
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants