aws / aws-xray-sdk-node

The official AWS X-Ray SDK for Node.js.
Apache License 2.0
271 stars 155 forks source link

Update Subsegment Type Definitions to Include`namespace` #469

Closed mckalexee closed 2 years ago

mckalexee commented 3 years ago

Background

AWS XRay will consider segments with a namespace of "remote" calls to a remote service. This allows the service map show which services are calling the remote service. It also allows you to select the remote service and view traces that called it.

Setting the namespace to "remote" is also done within this codebase. https://github.com/aws/aws-xray-sdk-node/blob/043be345d24dc537463a58999dd8651fefa12349/packages/mysql/lib/mysql_p.js#L251

The type definition for the Subsegment class does not contain the property namespace, meaning TypeScript projects that use this type definition are unable to override the namespace property.

Proposed Resolution

Add the namespace property as an optional string to the Subsegment type definition.

willarmiros commented 2 years ago

Released in 3.3.4