feat(aap): update tags on inferred spans for API Gateway by CarlesDD · Pull Request #704 · DataDog/datadog-lambda-js

What does this PR do?

It updates tags for API Gateway Rest Proxy and HTTP API inferred spans, to enable discovery by both the APM Endpoint Catalog and the API Gateway Catalog:

  • Span name differentiation by API Gateway type
    • API Gateway V2 (HTTP API) inferred spans now use aws.httpapi as the span name
    • API Gateway V1 (REST API) and WebSocket continue using aws.apigateway
  • Updated span.type to web
    • API Gateway inferred spans now use span.type: "web" to ensure they are considered as a source for API endpoints
  • Removed operation_name tag
    • The operation_name tag has been removed from API Gateway inferred spans for consistency with the RFC specification
  • Added dd_resource_key with API Gateway ARN
    • Inferred spans now include the dd_resource_key tag containing the computed API Gateway ARN
    • Format for V1/WebSocket: arn:aws:apigateway:{region}::/restapis/{api-id}
    • Format for V2: arn:aws:apigateway:{region}::/apis/{api-id}
    • This ensures the CCRID matches the correct API Gateway resource rather than the Lambda function

Motivation

This PR implements tags updates for RFC-1081.

The goal is be able to use API Gateway lambda inferred spans for endpoint discovery and correlation in the AppSec API Catalog.

Testing Guidelines

Additional Notes

APPSEC-60015

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)