Skip to content

[FEATURE]: use http route name not path for websocket span resource name #6575

@chiawendt

Description

@chiawendt

Package Name

datadog-plugin-ws

Package Version(s)

No response

Describe the feature you'd like

Currently websocket.receive spans use http path as resource name, which is not suitable as resource names should have low cardinality and normalized (I think). Using http route seems better.

Image

Reference implementation for http server spans:

function addResourceTag (context) {
const { req, span } = context
const tags = span.context()._tags
if (tags['resource.name']) return
const resource = [req.method, tags[HTTP_ROUTE]]
.filter(Boolean)
.join(' ')
span.setTag(RESOURCE_NAME, resource)
}

Is your feature request related to a problem?

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions