-
Notifications
You must be signed in to change notification settings - Fork 309
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
Standalone ASM priority sampler and tag propagation #4416
Merged
iunanua
merged 110 commits into
master
from
igor/standalone-asm-priority-sampler-channel
Jul 5, 2024
Merged
Standalone ASM priority sampler and tag propagation #4416
iunanua
merged 110 commits into
master
from
igor/standalone-asm-priority-sampler-channel
Jul 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Ugaitz Urien <[email protected]>
Co-authored-by: simon-id <[email protected]>
simon-id
reviewed
Jun 26, 2024
simon-id
reviewed
Jun 28, 2024
simon-id
reviewed
Jun 28, 2024
simon-id
reviewed
Jul 1, 2024
simon-id
reviewed
Jul 1, 2024
simon-id
reviewed
Jul 2, 2024
simon-id
reviewed
Jul 2, 2024
simon-id
reviewed
Jul 2, 2024
simon-id
reviewed
Jul 2, 2024
simon-id
approved these changes
Jul 3, 2024
Qard
approved these changes
Jul 3, 2024
juan-fernandez
pushed a commit
that referenced
this pull request
Jul 10, 2024
* DD_APM_TRACING_ENABLED and span _dd.apm.enabled tag * clean up * Use MANUAL_KEEP const * Add _dd.p.appsec tag on standalone ASM events * Include apmTracingEnabled checks * Appsec Reporter tests * Appsec sdk track_event test * Use numeric value for _dd.p.appsec * Include appsec standalone config in .ts files * Clean up null and undefined values * Remove not needed config properties * standalone module * Clean up * standalone proxy test * Update packages/dd-trace/test/appsec/iast/vulnerability-reporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * appsec reporter test * Use standalone singletone in vulnerability-reporter * continue applying ratelimiter on appsec standalone events * Update packages/dd-trace/src/appsec/reporter.js Co-authored-by: simon-id <[email protected]> * Add _dd.apm.enabled:0 in root spans with remote parent * Use a method to add the tag * Remove apmTracingEnabled config property * Add _dd.p.appsec tag in trace tags * Some tests * Set _dd.apm.enabled in root span * configure standalone if _tracingInitialized * Use dd-trace:span:start channel * PrioritySampler and propagation * Clean up * Clean up * use a meta tag * Use dc to modify what is injected and extracted * set USER_KEEP priority * integration tests * hasSubscribers check * test description * hasSubscribers check * standalone tests * Check span context has tags before using them and check if config has changed * clean up * Pass prioritySampler as argument to DatadogTracer * clean up * clean up * protect span context sampling access * Disable span stats if standalone enabled * clean up * clean up * Clean up * Clean up * clean up * Remove all headers from carrier * inject integration tests * remove only * Update packages/dd-trace/test/appsec/sdk/track_event.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * protect sample method * Use assert instead expect * reset sampling prio * unsubscribe after test * clear dd context from tracestate * propagation with and without ASM events * suggestions * test inject and extrach channels * use two services to test propagation * integration tests cleanup * clean up * clean up * Update packages/dd-trace/src/priority_sampler.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * Move hasOwn, remove not used argument and fix test * simplify iast integration-test using weak_hash * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * suggestions * Fix integration tests * Update packages/dd-trace/test/span_stats.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/exporters/agent/exporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Remove redundant check * Remove standalone option * protect onSpanInject and onSpanExtract * do not set _dd.p.dm * remove _dd.p.dm check from integration tests * increase coverage * increase coverage * more coverage * remove not needed async * set default mechanism * sugestions * Remove throw tests * Remove throw tests * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: simon-id <[email protected]> --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: simon-id <[email protected]>
juan-fernandez
pushed a commit
that referenced
this pull request
Jul 10, 2024
* DD_APM_TRACING_ENABLED and span _dd.apm.enabled tag * clean up * Use MANUAL_KEEP const * Add _dd.p.appsec tag on standalone ASM events * Include apmTracingEnabled checks * Appsec Reporter tests * Appsec sdk track_event test * Use numeric value for _dd.p.appsec * Include appsec standalone config in .ts files * Clean up null and undefined values * Remove not needed config properties * standalone module * Clean up * standalone proxy test * Update packages/dd-trace/test/appsec/iast/vulnerability-reporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * appsec reporter test * Use standalone singletone in vulnerability-reporter * continue applying ratelimiter on appsec standalone events * Update packages/dd-trace/src/appsec/reporter.js Co-authored-by: simon-id <[email protected]> * Add _dd.apm.enabled:0 in root spans with remote parent * Use a method to add the tag * Remove apmTracingEnabled config property * Add _dd.p.appsec tag in trace tags * Some tests * Set _dd.apm.enabled in root span * configure standalone if _tracingInitialized * Use dd-trace:span:start channel * PrioritySampler and propagation * Clean up * Clean up * use a meta tag * Use dc to modify what is injected and extracted * set USER_KEEP priority * integration tests * hasSubscribers check * test description * hasSubscribers check * standalone tests * Check span context has tags before using them and check if config has changed * clean up * Pass prioritySampler as argument to DatadogTracer * clean up * clean up * protect span context sampling access * Disable span stats if standalone enabled * clean up * clean up * Clean up * Clean up * clean up * Remove all headers from carrier * inject integration tests * remove only * Update packages/dd-trace/test/appsec/sdk/track_event.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * protect sample method * Use assert instead expect * reset sampling prio * unsubscribe after test * clear dd context from tracestate * propagation with and without ASM events * suggestions * test inject and extrach channels * use two services to test propagation * integration tests cleanup * clean up * clean up * Update packages/dd-trace/src/priority_sampler.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * Move hasOwn, remove not used argument and fix test * simplify iast integration-test using weak_hash * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * suggestions * Fix integration tests * Update packages/dd-trace/test/span_stats.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/exporters/agent/exporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Remove redundant check * Remove standalone option * protect onSpanInject and onSpanExtract * do not set _dd.p.dm * remove _dd.p.dm check from integration tests * increase coverage * increase coverage * more coverage * remove not needed async * set default mechanism * sugestions * Remove throw tests * Remove throw tests * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: simon-id <[email protected]> --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: simon-id <[email protected]>
juan-fernandez
pushed a commit
that referenced
this pull request
Jul 11, 2024
* DD_APM_TRACING_ENABLED and span _dd.apm.enabled tag * clean up * Use MANUAL_KEEP const * Add _dd.p.appsec tag on standalone ASM events * Include apmTracingEnabled checks * Appsec Reporter tests * Appsec sdk track_event test * Use numeric value for _dd.p.appsec * Include appsec standalone config in .ts files * Clean up null and undefined values * Remove not needed config properties * standalone module * Clean up * standalone proxy test * Update packages/dd-trace/test/appsec/iast/vulnerability-reporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * appsec reporter test * Use standalone singletone in vulnerability-reporter * continue applying ratelimiter on appsec standalone events * Update packages/dd-trace/src/appsec/reporter.js Co-authored-by: simon-id <[email protected]> * Add _dd.apm.enabled:0 in root spans with remote parent * Use a method to add the tag * Remove apmTracingEnabled config property * Add _dd.p.appsec tag in trace tags * Some tests * Set _dd.apm.enabled in root span * configure standalone if _tracingInitialized * Use dd-trace:span:start channel * PrioritySampler and propagation * Clean up * Clean up * use a meta tag * Use dc to modify what is injected and extracted * set USER_KEEP priority * integration tests * hasSubscribers check * test description * hasSubscribers check * standalone tests * Check span context has tags before using them and check if config has changed * clean up * Pass prioritySampler as argument to DatadogTracer * clean up * clean up * protect span context sampling access * Disable span stats if standalone enabled * clean up * clean up * Clean up * Clean up * clean up * Remove all headers from carrier * inject integration tests * remove only * Update packages/dd-trace/test/appsec/sdk/track_event.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * protect sample method * Use assert instead expect * reset sampling prio * unsubscribe after test * clear dd context from tracestate * propagation with and without ASM events * suggestions * test inject and extrach channels * use two services to test propagation * integration tests cleanup * clean up * clean up * Update packages/dd-trace/src/priority_sampler.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * Move hasOwn, remove not used argument and fix test * simplify iast integration-test using weak_hash * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * suggestions * Fix integration tests * Update packages/dd-trace/test/span_stats.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/exporters/agent/exporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Remove redundant check * Remove standalone option * protect onSpanInject and onSpanExtract * do not set _dd.p.dm * remove _dd.p.dm check from integration tests * increase coverage * increase coverage * more coverage * remove not needed async * set default mechanism * sugestions * Remove throw tests * Remove throw tests * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: simon-id <[email protected]> --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: simon-id <[email protected]>
juan-fernandez
pushed a commit
that referenced
this pull request
Jul 11, 2024
* DD_APM_TRACING_ENABLED and span _dd.apm.enabled tag * clean up * Use MANUAL_KEEP const * Add _dd.p.appsec tag on standalone ASM events * Include apmTracingEnabled checks * Appsec Reporter tests * Appsec sdk track_event test * Use numeric value for _dd.p.appsec * Include appsec standalone config in .ts files * Clean up null and undefined values * Remove not needed config properties * standalone module * Clean up * standalone proxy test * Update packages/dd-trace/test/appsec/iast/vulnerability-reporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * appsec reporter test * Use standalone singletone in vulnerability-reporter * continue applying ratelimiter on appsec standalone events * Update packages/dd-trace/src/appsec/reporter.js Co-authored-by: simon-id <[email protected]> * Add _dd.apm.enabled:0 in root spans with remote parent * Use a method to add the tag * Remove apmTracingEnabled config property * Add _dd.p.appsec tag in trace tags * Some tests * Set _dd.apm.enabled in root span * configure standalone if _tracingInitialized * Use dd-trace:span:start channel * PrioritySampler and propagation * Clean up * Clean up * use a meta tag * Use dc to modify what is injected and extracted * set USER_KEEP priority * integration tests * hasSubscribers check * test description * hasSubscribers check * standalone tests * Check span context has tags before using them and check if config has changed * clean up * Pass prioritySampler as argument to DatadogTracer * clean up * clean up * protect span context sampling access * Disable span stats if standalone enabled * clean up * clean up * Clean up * Clean up * clean up * Remove all headers from carrier * inject integration tests * remove only * Update packages/dd-trace/test/appsec/sdk/track_event.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * protect sample method * Use assert instead expect * reset sampling prio * unsubscribe after test * clear dd context from tracestate * propagation with and without ASM events * suggestions * test inject and extrach channels * use two services to test propagation * integration tests cleanup * clean up * clean up * Update packages/dd-trace/src/priority_sampler.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * Move hasOwn, remove not used argument and fix test * simplify iast integration-test using weak_hash * Update packages/dd-trace/src/appsec/standalone.js Co-authored-by: Ugaitz Urien <[email protected]> * suggestions * Fix integration tests * Update packages/dd-trace/test/span_stats.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Update packages/dd-trace/test/exporters/agent/exporter.spec.js Co-authored-by: Ugaitz Urien <[email protected]> * Remove redundant check * Remove standalone option * protect onSpanInject and onSpanExtract * do not set _dd.p.dm * remove _dd.p.dm check from integration tests * increase coverage * increase coverage * more coverage * remove not needed async * set default mechanism * sugestions * Remove throw tests * Remove throw tests * Update packages/dd-trace/test/appsec/standalone.spec.js Co-authored-by: simon-id <[email protected]> --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: simon-id <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Continuation of #4291
Defines two new channels in
opentracing/propagation/text_map.js
in order to alter trace propagation:dd-trace:span:inject
which publishes the trace span context and the carrier that is going to be injected in a downstream reqdd-trace:span:extract
which publishes the trace span context and the carrier when a span is going to be extracted from an upstream req.When standalone ASM is enabled it:
PrioritySampler
withStandaloneAsmPrioritySampler
viaDatadogTracer
constructor.StandaloneAsmPrioritySampler
searches for_dd.p.appsec
in the tags in order to keep a trace, sets a 1 req/min rate limiter and disables user rules._dd.p.appsec
tag, removesx-datadog-
and datadog info fromtracestate
_dd.p.appsec
tag, resets the sampling priority.'Datadog-Client-Computed-Stats': 'yes'
header when exporting traces to the agent to pretend stats computation is made by the tracerST PR to enable Standalone ASM tests
Motivation
Support Standalone ASM billing
Plugin Checklist
Additional Notes