fix(serverless-init): set serverless log hostname to empty string#40074
Conversation
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: fb444b5 Optimization Goals: ✅ No significant changes detected
|
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | docker_containers_cpu | % cpu utilization | +0.98 | [-2.08, +4.05] | 1 | Logs |
Fine details of change detection per experiment
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | tcp_syslog_to_blackhole | ingress throughput | +1.10 | [+1.02, +1.19] | 1 | Logs |
| ➖ | docker_containers_cpu | % cpu utilization | +0.98 | [-2.08, +4.05] | 1 | Logs |
| ➖ | quality_gate_logs | % cpu utilization | +0.81 | [-1.92, +3.53] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_metrics_logs | memory utilization | +0.68 | [+0.29, +1.08] | 1 | Logs bounds checks dashboard |
| ➖ | ddot_logs | memory utilization | +0.31 | [+0.22, +0.40] | 1 | Logs |
| ➖ | ddot_metrics | memory utilization | +0.26 | [+0.15, +0.37] | 1 | Logs |
| ➖ | file_to_blackhole_0ms_latency | egress throughput | +0.10 | [-0.48, +0.68] | 1 | Logs |
| ➖ | file_to_blackhole_1000ms_latency | egress throughput | +0.01 | [-0.59, +0.62] | 1 | Logs |
| ➖ | file_to_blackhole_100ms_latency | egress throughput | +0.01 | [-0.59, +0.61] | 1 | Logs |
| ➖ | uds_dogstatsd_to_api | ingress throughput | -0.00 | [-0.28, +0.28] | 1 | Logs |
| ➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.00 | [-0.02, +0.01] | 1 | Logs |
| ➖ | uds_dogstatsd_20mb_12k_contexts_20_senders | memory utilization | -0.01 | [-0.07, +0.05] | 1 | Logs |
| ➖ | file_tree | memory utilization | -0.04 | [-0.07, -0.00] | 1 | Logs |
| ➖ | quality_gate_idle_all_features | memory utilization | -0.04 | [-0.08, -0.01] | 1 | Logs bounds checks dashboard |
| ➖ | file_to_blackhole_500ms_latency | egress throughput | -0.06 | [-0.65, +0.52] | 1 | Logs |
| ➖ | otlp_ingest_metrics | memory utilization | -0.13 | [-0.27, +0.02] | 1 | Logs |
| ➖ | otlp_ingest_logs | memory utilization | -0.16 | [-0.28, -0.03] | 1 | Logs |
| ➖ | quality_gate_idle | memory utilization | -0.21 | [-0.25, -0.18] | 1 | Logs bounds checks dashboard |
| ➖ | docker_containers_memory | memory utilization | -0.27 | [-0.32, -0.23] | 1 | Logs |
Bounds Checks: ✅ Passed
| perf | experiment | bounds_check_name | replicates_passed | links |
|---|---|---|---|---|
| ✅ | docker_containers_cpu | simple_check_run | 10/10 | |
| ✅ | docker_containers_memory | memory_usage | 10/10 | |
| ✅ | docker_containers_memory | simple_check_run | 10/10 | |
| ✅ | file_to_blackhole_0ms_latency | lost_bytes | 10/10 | |
| ✅ | file_to_blackhole_0ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_1000ms_latency | 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_500ms_latency | lost_bytes | 10/10 | |
| ✅ | file_to_blackhole_500ms_latency | memory_usage | 10/10 | |
| ✅ | quality_gate_idle | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_idle | memory_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | memory_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_logs | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_logs | lost_bytes | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_logs | memory_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | cpu_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | lost_bytes | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | memory_usage | 10/10 | bounds checks dashboard |
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
CI Pass/Fail Decision
✅ Passed. All Quality Gates passed.
- quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
8617a7f to
06a65c4
Compare
06a65c4 to
9532089
Compare
Static quality checks✅ Please find below the results from static quality gates Successful checksInfo
|
Serverless Benchmark Results
tl;drUse these benchmarks as an insight tool during development.
What is this benchmarking?The 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 The benchstat docs explain how to interpret these charts.
I need more helpFirst off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development. If you would like a hand interpreting the results come chat with us in Benchmark stats |
Gitlab CI Configuration ChangesAdded Jobstests_serverless-init-logstests_serverless-init-logs:
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
needs:
- go_deps
rules:
- if: $RUN_UNIT_TESTS == "off"
when: never
- if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
when: never
- when: on_success
script:
- mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
|| exit 101
- rm -f modcache.tar.xz
- go test -tags "serverless otlp test" ./cmd/serverless-init/.
stage: source_test
tags:
- arch:amd64Changes Summary
ℹ️ Diff available in the job log. |
jszwedko
left a comment
There was a problem hiding this comment.
Approving for @DataDog/agent-log-pipelines owned files. Generally this approach makes sense to me to avoid having host set to unknown.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
|
Hello! I was curious when this version would be released? I hit this issue recently and I've verified using 1.1.4 does indeed not cause tag inheritance behavior as described. I'd also prefer to not use a quite outdated version of serverless-init (1.1.4 looks like it's 2 years old). Thanks! |
|
Looks like it's released here: https://github.com/DataDog/datadog-agent/releases/tag/serverless-init-1.7.9 but the image isn't published. |
|
Hi @ylee-figma! serverless-init-1.7.9 was released this morning to Docker, ECR, and GAR. |
|
@duncanpharvey Is there a way to specifically set hostname, rather than it always being blank or unknown, e.g. when following datadog's Azure Container Apps guide for serverless-init? We've got concrete hostnames in this case and would want to use the per-replica variant instead (e.g. |
Thanks for the reply; I'll drop a message in #39536 as well to share this same context, since this is a meaningful improvement for ACA customers. |
What does this PR do?
Passes the
hostnameinterfacecomponent to the Serverless Logs Agent so the hostname on logs is set to an empty string.Motivation
https://datadoghq.atlassian.net/browse/SVLS-7460
Currently the hostname is being set to
unknown. In Datadog Orgs where a host with the nameunknownalready exists and has tags on it, logs with a matching hostname will inherit these tags, potentially resulting in scenarios where a log has multiple tags with the same key but different values.Describe how you validated your changes
Added a serverless-init log test to validate that the hostname component has an empty string set for a build of serverless-init.
Also deployed manually to Google Cloud Run and Azure Container Apps using both the sidecar and in process approach to validate the logs have hostname set as an empty string.
Possible Drawbacks / Trade-offs
Additional Notes
A regression was introduced in
v1.2.1of the serverless-init image that caused the hostname to be set tounknown. It's unclear what specific change caused the regression as no Github tags were created for these older versions.There is already a provider hostname configuration for Serverless. By passing the
hostnameinterfacecomponent to the Serverless Logs Agent we can set the empty string hostname on the provider.datadog-agent/pkg/util/hostname/providers_serverless.go
Line 19 in cc85b51
Ultimately the hostname is passed to the logs processor where it is read and inserted into the log message. This is where the hostname was set to
unknownprior to this change.datadog-agent/pkg/logs/processor/processor.go
Lines 199 to 219 in 35ec447
Since the signature of
SetupLogAgentis updated to include the hostname componentcmd/serverlessneeds to be updated as well. However Lambda Functions have special handling in the logs processor which means this change will not affect the hostname on Lambda Function logs.datadog-agent/cmd/serverless-init/log/log.go
Line 59 in 42a25bb