Skip to content

Conversation

@montmanu
Copy link

@montmanu montmanu commented Nov 21, 2025

What does this PR do?

Replaces hard-coded value for tag key used to identify a span's resource name with a reference to the corresponding constant.

Motivation

I was reviewing the source code to determine how a particular resource name was being assigned when I noticed an inconsistency between this implementation (the hard-coded string) vs others within the same package (which reference the RESOURCE_NAME instead).

For example, the wrapMiddleware function sources the tag key name from the constant:

span.addTags({
[RESOURCE_NAME]: middleware._name || middleware.name || '<anonymous>'
})

Even within the addResourceTag function's implementation, there seems to be an inconsistency between the following:

if (tags['resource.name']) return

vs

span.setTag(RESOURCE_NAME, resource)

Additional Notes

Here is where the RESOURCE_NAME const is defined:

RESOURCE_NAME: 'resource.name',

@montmanu montmanu requested a review from a team as a code owner November 21, 2025 18:04
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.

1 participant