Skip to content

Update Instrumenting Amazon API Gateway with v2 content #29566

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

Merged
merged 5 commits into from
Jun 5, 2025

Conversation

domalessi
Copy link
Contributor

What does this PR do? What is the motivation?

https://datadoghq.atlassian.net/browse/DOCS-10997

Updating the Instrumenting Amazon API Gateway page to incorporate new content, as introduced in this PR: DataDog/datadog-cdk-constructs#430.

Merge instructions

Merge readiness:

  • Ready for merge

For Datadog employees:
Merge queue is enabled in this repo. Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass in CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

To have your PR automatically merged after it receives the required reviews, add the following PR comment:

/merge

Additional notes

@domalessi domalessi requested a review from a team as a code owner May 27, 2025 20:09
@domalessi domalessi requested a review from purple4reina May 27, 2025 20:10
Copy link
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@buraizu buraizu self-assigned this May 28, 2025
Copy link
Contributor

github-actions bot commented May 28, 2025

✅ Documentation Team Review

The documentation team has approved this pull request. Thank you for your contribution!


### HTTP API (V2)

Attach the parameter mapping that injects the headers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also include here info on what customers will need to do this manually, should they not deploy using the cdk? I'm thinking something along the lines of the "header|value" table that's included in V1. You can see what exactly those are here.

It's vitally important that the x-dd-proxy-request-time-ms gets three zeros appended, as done with "${context.requestTimeEpoch}000", which turns the request time from seconds to milliseconds. Without this, the start time of the synthetic span will be off my a factor of 1000.

| `x-dd-proxy-domain-name` | `context.domainName` |
| `x-dd-proxy-httpmethod` | `context.httpMethod` |
| `x-dd-proxy-path` | `context.path` |
| `x-dd-proxy-stage` | `context.stage` |
Copy link
Contributor

Choose a reason for hiding this comment

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

These headers are set differently based on apigw version. Specifically the requestTimeEpoch needs to be handled differently in v2 than in v1.

Take a look at https://github.com/DataDog/datadog-cdk-constructs/blob/b7a9aa75a8d40a89718481fecf8f41e175f5704f/src/apigateway/parameters.ts for the different values that should be set based on v1 or v2.

@domalessi domalessi merged commit 3cf7480 into master Jun 5, 2025
14 checks passed
@domalessi domalessi deleted the domalessi/docs-10997-apigateway branch June 5, 2025 15:02
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.

3 participants