Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(redis-cache): Create cache-span with prefixed keys (get/set commands) #12070

Merged
merged 7 commits into from
May 16, 2024

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented May 16, 2024

Populates the OTel span with cache attributes. Currently, get and set commands are considered.

@s1gr1d s1gr1d requested review from mydea and Lms24 May 16, 2024 12:12
Copy link
Contributor

github-actions bot commented May 16, 2024

size-limit report 📦

Path Size
@sentry/browser 21.72 KB (+0.19% 🔺)
@sentry/browser (incl. Tracing) 32.86 KB (+0.28% 🔺)
@sentry/browser (incl. Tracing, Replay) 68.21 KB (+0.17% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.6 KB (+0.16% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.25 KB (+0.16% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.25 KB (+0.14% 🔺)
@sentry/browser (incl. Feedback) 37.68 KB (+0.12% 🔺)
@sentry/browser (incl. sendFeedback) 26.29 KB (+0.16% 🔺)
@sentry/browser (incl. FeedbackAsync) 30.66 KB (+0.14% 🔺)
@sentry/react 24.41 KB (+0.15% 🔺)
@sentry/react (incl. Tracing) 35.85 KB (+0.32% 🔺)
@sentry/vue 25.65 KB (+0.48% 🔺)
@sentry/vue (incl. Tracing) 34.68 KB (+0.36% 🔺)
@sentry/svelte 21.86 KB (+0.2% 🔺)
CDN Bundle 24.26 KB (+0.17% 🔺)
CDN Bundle (incl. Tracing) 34.29 KB (+0.35% 🔺)
CDN Bundle (incl. Tracing, Replay) 67.99 KB (+0.19% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 72.95 KB (+0.15% 🔺)
CDN Bundle - uncompressed 71.33 KB (+0.18% 🔺)
CDN Bundle (incl. Tracing) - uncompressed 101.68 KB (+0.33% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 211.3 KB (+0.16% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.6 KB (+0.15% 🔺)
@sentry/nextjs (client) 35.07 KB (+0.32% 🔺)
@sentry/sveltekit (client) 33.44 KB (+0.32% 🔺)
@sentry/node 141.32 KB (+0.22% 🔺)
@sentry/aws-serverless 128.08 KB (+0.04% 🔺)

Comment on lines 22 to 24
name: 'Test Transaction',
op: 'transaction',
},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: 'Test Transaction',
op: 'transaction',
},
name: 'Test Span',
op: 'test-span',
},

let's avoid transaction wording in new code :D

else if (response === null || response === undefined) return 0;
return JSON.stringify(response).length;
} catch (e) {
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

m: Should we return undefined here? Maybe it is more confusing to set this to 0 if something fails, than to not set it at all?

return;
}

const networkPeerAddress = spanToJSON(span).data?.['net.peer.name'];
Copy link
Member

Choose a reason for hiding this comment

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

out of interest, are we using something non-standard here or is redis emitting something non-standard?

Copy link
Member Author

Choose a reason for hiding this comment

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

redis seems to be using the old standard as there was a change to those params: open-telemetry/opentelemetry-specification#3199

We are using those: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/

Copy link
Member

Choose a reason for hiding this comment

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

ok, got it, makes sense - maybe we can leave a comment like this in the code so we can potentially revisit this when we update the redis instrumentation at some point :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants