Skip to content

Don't add empty headers on lambda completion#11551

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/lambda-empty
Jun 4, 2026
Merged

Don't add empty headers on lambda completion#11551
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/lambda-empty

Conversation

@amarziali
Copy link
Copy Markdown
Contributor

What Does This Do

Adding empty headers is not supported by okHttp. This PR add guards around possibly empty values.

Guards from errors like:

java.lang.IllegalArgumentException
  at datadog.okhttp3.Headers.checkValue(Headers.java:272)
  at datadog.okhttp3.Headers$Builder.add(Headers.java:312)
  at datadog.okhttp3.Request$Builder.addHeader(Request.java:196)
  at datadog.trace.lambda.LambdaHandler.notifyEndInvocation(LambdaHandler.java:125)
  at datadog.trace.agent.core.CoreTracer.notifyExtensionEnd(CoreTracer.java:1248)

Motivation

Additional Notes

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@amarziali amarziali requested a review from a team as a code owner June 3, 2026 16:51
@amarziali amarziali added type: bug Bug report and fix tag: serverless Serverless support tag: telemetry error reported Reported by error telemetry labels Jun 3, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 3, 2026

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@datadog-datadog-prod-us1

This comment has been minimized.

@amarziali amarziali added the inst: aws lambda AWS Lambda instrumentation label Jun 3, 2026
@amarziali amarziali enabled auto-merge June 3, 2026 16:54
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 3, 2026

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.92 s 14.06 s [-2.4%; +0.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.85 s 12.90 s [-1.1%; +0.3%] (no difference)
startup:petclinic:appsec:Agent 16.38 s 16.44 s [-1.5%; +0.8%] (no difference)
startup:petclinic:iast:Agent 16.49 s 16.70 s [-2.4%; -0.1%] (maybe better)
startup:petclinic:profiling:Agent 16.54 s 16.71 s [-2.6%; +0.6%] (no difference)
startup:petclinic:tracing:Agent 15.78 s 15.77 s [-1.0%; +1.2%] (no difference)

Commit: 829151a0 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Comment thread dd-trace-core/src/main/java/datadog/trace/lambda/LambdaHandler.java Outdated
Copy link
Copy Markdown
Contributor

@dougqh dougqh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a helper method that handles this might be a cleaner solution

@amarziali amarziali added this pull request to the merge queue Jun 3, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 3, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented Jun 3, 2026

View all feedbacks in Devflow UI.

2026-06-03 17:44:24 UTC ℹ️ Start processing command /merge


2026-06-03 17:44:28 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-06-03 18:15:13 UTC ⚠️ MergeQueue: This merge request build was cancelled

andrea.marziali@datadoghq.com cancelled this merge request build

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2026
Copy link
Copy Markdown
Contributor

@purple4reina purple4reina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on Douglas's comment though

@amarziali
Copy link
Copy Markdown
Contributor Author

I think a helper method that handles this might be a cleaner solution

I wanted to avoid to add more to Strings but it's true that I can add something to LambdaHandler indeed

@amarziali
Copy link
Copy Markdown
Contributor Author

/merge -c

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented Jun 3, 2026

View all feedbacks in Devflow UI.

2026-06-03 18:14:58 UTC ℹ️ Start processing command /merge -c

@amarziali amarziali enabled auto-merge June 4, 2026 06:53
@amarziali amarziali added this pull request to the merge queue Jun 4, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 4, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented Jun 4, 2026

View all feedbacks in Devflow UI.

2026-06-04 07:44:43 UTC ℹ️ Start processing command /merge


2026-06-04 07:44:48 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-06-04 09:14:28 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 4, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 0cbc512 into master Jun 4, 2026
572 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/lambda-empty branch June 4, 2026 09:14
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: aws lambda AWS Lambda instrumentation tag: serverless Serverless support tag: telemetry error reported Reported by error telemetry type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants