ZopaPublic / ktor-opentracing

Ktor features for OpenTracing instrumentation.
MIT License
38 stars 8 forks source link

Add configuration to replace sections of path strings according to regexes, and tags spans accordingly #20

Closed aideencostello closed 3 years ago

aideencostello commented 3 years ago

Add configuration to replace sections of path strings according to regexes, and tags spans accordingly

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

aideencostello commented 3 years ago

@hj1611 Somewhat related to your comment, you could say we are missing a feature of being able to anchor your regex.

The scenario I'm thinking of is if you have the same customId in multiple paths, and you want to call it different things according to the path:

/butterfly/1234-4567/type -> /butterfly/<butterfly-id>/type

/cow/1245-4322/age -> /cow/<cow-id>/age

I suspect this is overkill, but shout anyone if you think it would be useful.

Edit: this could always be added later as an optional param

fstien commented 3 years ago

@hj1611 Somewhat related to your comment, you could say we are missing a feature of being able to anchor your regex.

The scenario I'm thinking of is if you have the same customId in multiple paths, and you want to call it different things according to the path:

/butterfly/1234-4567/type -> /butterfly/<butterfly-id>/type

/cow/1245-4322/age -> /cow/<cow-id>/age

I suspect this is overkill, but shout anyone if you think it would be useful.

Edit: this could always be added later as an optional param

@hj1611 i see what you mean, it seems unlikely that you'd want a different string for the same regex. Users can always use a generic id string and should know their apps well enough to know what it's referring to (usually the id of the resource in the path haha)

fstien commented 3 years ago

@aideencostello Can you please give this PR a more descriptive name, which can be included in the release message as an announcement of the new feature.