getsentry / sentry-java

A Sentry SDK for Java, Android and other JVM languages.
https://docs.sentry.io/
MIT License
1.16k stars 435 forks source link

Changes in url from interceptor chain not represented inside span/breadcrumb #3610

Open JohannesPtaszyk opened 4 months ago

JohannesPtaszyk commented 4 months ago

Integration

sentry

Java Version

17

Version

7.12.1

Steps to Reproduce

  1. Create OkHttp instance
  2. Create API with route with parts, which should be replaced e.g. fancy.api/REPLACABLE_VERSION/health (REPLACABLE_VERSION would be replaced by our OkHttp interceptor chain with meta information from a custom annotation
  3. Look at sentry after calling the API

Additional information: This seems to happen, because the sauce of truth for the path is not comming from the Sentry interceptor, but from the event listener. It would be nice to have an option to tell the Sentry interceptor to override that value whith the one from the interceptor chain or something like that, because right now we are missing important information in our http breadcrumbs.

Expected Result

placeholder parts are replaced and fancy.api/v1/health is logged instead of fancy.api/REPLACABLE_VERSION/health

Actual Result

fancy.api/REPLACABLE_VERSION/health is logged

markushi commented 3 months ago

Hey @JohannesPtaszyk, thanks for reaching out. Just to better understand your use-case: How are you replacing the placeholders in your urls. Are you using a custom interceptor for this?

JohannesPtaszyk commented 3 months ago

Yes, we are using a custom interceptor, which checks for annotations on the API method of our retrofit interface