Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Litarnus
Copy link
Contributor

@Litarnus Litarnus commented Sep 2, 2025

Introduces auto-instrumentation for Symfony cache.

Symfony cache works slightly different than PSR-6 Cache. Instead of having an explicit put or save method, it provides a callback which is invoked on a cache miss.

Sentry will now auto instrument those and will provide proper spans. If the callback produces spans, those spans will be visible in the trace explorer to give further insights to the cache operation.

This PR also updates the span.op. Previously, it just used the PSR-6 method names as span op, which would not work with the Cache Module.

@Litarnus Litarnus marked this pull request as ready for review September 8, 2025 11:37
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@Litarnus Litarnus marked this pull request as draft September 8, 2025 12:33
@Litarnus Litarnus marked this pull request as ready for review September 8, 2025 13:45
*/
public static function getCacheItemSize($value): ?int
{
if (\is_string($value)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment why we only gather the payload size on strings for now.

@Litarnus Litarnus merged commit 02df933 into master Sep 11, 2025
40 checks passed
@Litarnus Litarnus deleted the martinl/cache-tracing branch September 11, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants