Skip to content

log: make remaining log level guards and the trace-agent RC path rule-aware - #57911

Draft
pgimalac wants to merge 1 commit into
pgimalac/log-level-runtime-settingsfrom
pgimalac/log-level-follow-ups
Draft

pgimalac wants to merge 1 commit into
pgimalac/log-level-runtime-settingsfrom
pgimalac/log-level-follow-ups

Conversation

@pgimalac

@pgimalac pgimalac commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Remove various uses of log.GetLogLevel, in favor of ShouldLog or GetLogLevelSpec depending on how the level was used.

Motivation

GetLogLevel() only reports the default level, so with #57848 anything built on it ignores per-package rules.

Describe how you validated your changes

New tests for the /config/set endpoint (values stored as given, including an uppercase import path), the remote config spec flow (escaping, override removal) and the seclog level checks; dda inv test on all touched packages and the linter pass.

…-aware

Guards comparing against GetLogLevel, which only reports the default
level, stop working with per-package rules; replace them with ShouldLog
checks:

- seclog's IsTracing/IsDebugging now report whether trace/debug is
  enabled instead of requiring an exact level match, so IsDebugging is
  true at trace level as well; the mount point resolver gate collapses
  to IsDebugging alone.
- the SNMP session attaches its gosnmp logger when trace logging is
  enabled.

The trace-agent remote config handler keeps and compares the full log
level spec (via GetLogLevelSpec) instead of only the default level, so
an override is actually removed when the remote config stops sending
it, and the /config/set request URL-escapes the value. On the receiving
side, the endpoint no longer lowercases the value before validation:
import paths are case-sensitive, so a per-package spec would be
rewritten into one that never matches.
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 94.12%
• Overall Coverage: 62.79% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 20cb9c8 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor 29b66769:

Results for datadog-agent_7.86.0~devel.git.315.20cb9c8.pipeline.143696952-1_amd64.deb:

No change detected

Results for datadog-iot-agent_7.86.0~devel.git.315.20cb9c8.pipeline.143696952-1_amd64.deb:

No change detected

@dd-octo-sts

dd-octo-sts Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 29b6676
📊 Static Quality Gates Dashboard
🔗 SQG Job

Successful checks

Info

Quality gate Change Size (prev → curr → max)
✅ agent_deb_amd64 +195.34 KiB (0.03% increase, -3.62% of buffer) 755.256 → 755.447 → 760.520
✅ agent_deb_amd64_fips +164.0 KiB (0.02% increase, -3.03% of buffer) 688.278 → 688.438 → 693.570
✅ agent_heroku_amd64 +43.34 KiB (0.01% increase, -6.77% of buffer) 319.145 → 319.187 → 319.770
✅ agent_msi +203.5 KiB (0.03% increase, -55.46% of buffer) 653.832 → 654.030 → 654.190
✅ agent_rpm_amd64 +195.34 KiB (0.03% increase, -3.63% of buffer) 755.240 → 755.431 → 760.500
✅ agent_rpm_amd64_fips +164.0 KiB (0.02% increase, -3.03% of buffer) 688.261 → 688.422 → 693.550
✅ agent_rpm_arm64 +147.33 KiB (0.02% increase, -2.71% of buffer) 725.785 → 725.929 → 731.100
✅ agent_rpm_arm64_fips +143.64 KiB (0.02% increase, -2.61% of buffer) 664.371 → 664.512 → 669.740
✅ agent_suse_amd64 +195.34 KiB (0.03% increase, -3.63% of buffer) 755.240 → 755.431 → 760.500
✅ agent_suse_amd64_fips +164.0 KiB (0.02% increase, -3.03% of buffer) 688.261 → 688.422 → 693.550
✅ agent_suse_arm64 +147.33 KiB (0.02% increase, -2.71% of buffer) 725.785 → 725.929 → 731.100
✅ agent_suse_arm64_fips +143.64 KiB (0.02% increase, -2.61% of buffer) 664.371 → 664.512 → 669.740
✅ docker_agent_amd64 +171.34 KiB (0.02% increase, -3.16% of buffer) 811.423 → 811.591 → 816.720
✅ docker_agent_arm64 +147.32 KiB (0.02% increase, -2.67% of buffer) 806.591 → 806.735 → 811.970
✅ docker_agent_jmx_amd64 +171.34 KiB (0.02% increase, -3.16% of buffer) 1002.293 → 1002.460 → 1007.590
✅ docker_agent_jmx_arm64 +147.32 KiB (0.01% increase, -2.67% of buffer) 986.241 → 986.384 → 991.620
✅ docker_dogstatsd_amd64 +28.0 KiB (0.07% increase, -3.05% of buffer) 39.543 → 39.571 → 40.440
✅ docker_host_profiler_amd64 +34.71 KiB (0.01% increase, -4.72% of buffer) 308.722 → 308.756 → 309.440
✅ docker_host_profiler_arm64 +10.18 KiB (0.00% increase, -1.39% of buffer) 319.865 → 319.875 → 320.580
✅ dogstatsd_deb_amd64 +24.0 KiB (0.08% increase, -2.57% of buffer) 30.289 → 30.313 → 31.200
✅ dogstatsd_deb_arm64 +24.0 KiB (0.08% increase, -2.54% of buffer) 28.278 → 28.301 → 29.200
✅ dogstatsd_rpm_amd64 +24.0 KiB (0.08% increase, -2.57% of buffer) 30.289 → 30.313 → 31.200
✅ dogstatsd_suse_amd64 +24.0 KiB (0.08% increase, -2.57% of buffer) 30.289 → 30.313 → 31.200
✅ iot_agent_deb_amd64 +28.0 KiB (0.06% increase, -15.25% of buffer) 47.371 → 47.398 → 47.550
✅ iot_agent_deb_arm64 +24.0 KiB (0.05% increase, -6.13% of buffer) 43.837 → 43.861 → 44.220
✅ iot_agent_deb_armhf +20.0 KiB (0.04% increase, -5.31% of buffer) 44.652 → 44.672 → 45.020
✅ iot_agent_rpm_amd64 +28.0 KiB (0.06% increase, -15.30% of buffer) 47.371 → 47.399 → 47.550
✅ iot_agent_suse_amd64 +28.0 KiB (0.06% increase, -15.21% of buffer) 47.370 → 47.398 → 47.550
✅ docker_cluster_agent_amd64 +24.0 KiB (0.01% increase, -0.72% of buffer) 211.196 → 211.220 → 214.450
✅ docker_cluster_agent_arm64 +64.0 KiB (0.03% increase, -1.92% of buffer) 224.162 → 224.224 → 227.410
3 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
✅ docker_cws_instrumentation_amd64 7.443 MiB
✅ docker_cws_instrumentation_arm64 6.877 MiB
✅ docker_dogstatsd_arm64 37.629 MiB

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant