sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Adding request data to Transactions and Spans

Open relaxolotl opened this issue 3 years ago • 0 comments
trafficstars

Spun off of https://github.com/getsentry/sentry-rust/pull/439. Jess has opened up a PR which adds in basic functionality to include request data with Transactions and Spans, which works quite well. However, it does deviate from what the other SDKs to in order to accomplish the same thing.

Using the Python SDK as an example, other SDKs use event processors to attach request data to Transactions. An additional expectation is that integrations handle this under the hood for most users, so in most situations a user should not need to manually attach this data themselves. Besides the Java SDK, most SDKs don't expose request setters and getters on Transactions or Spans. If we stick with the API introduced in #439, this SDK will be deviating from sentry's implicit unified performance API.

Unfortunately, the Rust SDK can't easily extend event_processor to follow the example set by other SDKs: While other SDKs model Transactions as Events with a field to differentiate Transactions from "regular" Events (ie inheritance), Transactions and Events are two distinctly separate types in the Rust SDK.

This issue is meant to capture the discussion and eventual decision regarding what form such an API should look like in this SDK, especially if the conclusion that doing something different from the rest of the other SDKs is worth the tradeoff.

relaxolotl avatar Mar 08 '22 05:03 relaxolotl