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

internal/appsec: rework appsec telemetry #3345

Draft
wants to merge 2 commits into
base: v2-dev
Choose a base branch
from

Conversation

eliottness
Copy link
Contributor

What does this PR do?

  • Fix truncation metrics count that were not using a bitfield before
  • Add more tags to the telemetry rasp.timeout metric.
  • Change the RASPRuleType type from string to uint8 to make arrays of static size and use them as a dictionnary
  • in waf.HandleMetrics replace a lot of makes with keys being RASPRuleType with an array
  • Order metrics by their frequency of access and using this, replace some of the map generated ahead of time by lazily generated maps using xsync.MapOf
  • Rework the appsec start telemetry by simplyfing it
  • Remove the config.Origin type and replace it by the more general purpose telemetry.Origin (That I am thinking of promoting to the package internal/globalconfig 🤔 )

Motivation

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 25, 2025

Datadog Report

Branch report: eliottness/more-lazy-metrics
Commit report: 833af9d
Test service: dd-trace-go

✅ 0 Failed, 4502 Passed, 66 Skipped, 24m 24.72s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Mar 25, 2025

Benchmarks

Benchmark execution time: 2025-03-25 16:51:50

Comparing candidate commit 9d9edfd in PR branch eliottness/more-lazy-metrics with baseline commit 8cc7cca in branch v2-dev.

Found 2 performance improvements and 0 performance regressions! Performance is the same for 54 metrics, 0 unstable metrics.

scenario:BenchmarkSetTagString-24

  • 🟩 execution_time [-9.097ns; -5.683ns] or [-7.662%; -4.786%]

scenario:BenchmarkSetTagStringer-24

  • 🟩 execution_time [-8.240ns; -4.440ns] or [-5.454%; -2.939%]

@eliottness eliottness force-pushed the eliottness/more-lazy-metrics branch from 9d9edfd to 7942683 Compare March 28, 2025 16:13
Signed-off-by: Eliott Bouhana <[email protected]>
@eliottness eliottness force-pushed the eliottness/more-lazy-metrics branch from c6c0df4 to 5c6ec98 Compare March 28, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant