Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
iunanua committed Jun 21, 2024
1 parent f0923fc commit af1744e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions integration-tests/standalone-asm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const {

describe('Standalone ASM', () => {
let sandbox, cwd, startupTestFile, agent, proc, env

before(async () => {
sandbox = await createSandbox(['express'], true)
sandbox = await createSandbox(['express'])
cwd = sandbox.folder
startupTestFile = path.join(cwd, 'standalone-asm/index.js')
})
Expand All @@ -23,7 +24,7 @@ describe('Standalone ASM', () => {
await sandbox.remove()
})

context('enabled', () => {
describe('enabled', () => {
beforeEach(async () => {
agent = await new FakeAgent().start()

Expand Down Expand Up @@ -166,7 +167,7 @@ describe('Standalone ASM', () => {
})
})

context('propagation', () => {
describe('propagation', () => {
let proc2
let port2

Expand Down Expand Up @@ -243,7 +244,7 @@ describe('Standalone ASM', () => {
})
})

context('disabled', () => {
describe('disabled', () => {
beforeEach(async () => {
agent = await new FakeAgent().start()

Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/src/appsec/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ function onSpanExtract ({ spanContext }) {
} else if (spanContext._sampling.priority !== USER_KEEP) {
spanContext._sampling.priority = USER_KEEP
}
if (enabled && spanContext?._trace?.tags) {
}

function sample (span) {
const spanContext = span.context?.()
if (enabled && spanContext._trace?.tags) {
if (enabled && spanContext?._trace?.tags) {
spanContext._trace.tags[APPSEC_PROPAGATION_KEY] = '1'

// TODO: ask. can we reset here sampling like this?
Expand Down

0 comments on commit af1744e

Please sign in to comment.