getsentry / getsentry/sentry-php

Deprecate `startTransaction`

Open
#1,953 1 comment 0 reactions 1 assignee Claimed by @Litarnus View on GitHub
Improvement PHP Spans
Dominant language
PHP
Stars
1.9k
Forks
474
Avg merge
2d 3h
Merged PRs (30d)
8

Description

There are multiple ways how we could deprecate/remote `startTransaction`:

### Alter the signature to allow returning `null` values

We would check the current `trace_lifecycle` value and depending on the value, either return a `Transaction` or return null. We could also start a (segment) span instead so that all usages of `startTransaction` would become wrappers over `startSpan`.

It will break code that operates on the transaction.

### Return a "null" Transaction

We could subclass the current Transaction class and override all methods so they don't do anything but don't crash any application. While this looks like the safer approach, it will also hide usages of `startTransaction` and might make it more difficult to properly switch since everything will just continue to work and it will only be noticed once weird data shows up in sentry

### Return an unsampled Transaction

If the current `trace_lifecycle` is set to `stream`, `startTransaction` will return an unsampled transaction. This way nothing breaks but also nothing shows up in Sentry.

All cases should emit debug logs to help figure out what is going on during the transition.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.