Comments (10)
Hello, thanks for writing! We are indeed working on a feature which let's you define specific prefixes for your cache keys. The API will possibly look something like this: integrations: [Sentry.redisIntegration({ cachePrefixes: ['cache:'] })]
.
If the key is prefixed with one of the defined prefixes, the ops will be marked as cache.[..]
.
from sentry-javascript.
Hi @s1gr1d! Is there any way for me to also only have certain commands instrumented? Eg let's say I only care for get
/set
/delete
and don't care for other Redis commands?
from sentry-javascript.
Currently, there isn't. Would you want to specify certain Redis commands to be instrumented in general or just when you're using Redis as a cache? Meaning, Redis would be instrumented for all commands but only when a key is prefixed with e.g. cache:
we would drop commands which are not specified.
from sentry-javascript.
If you want, you can already try adding cache prefixes to the integration with the latest version of Sentry. Currently they pick up get
and set
.
from sentry-javascript.
Would you want to specify certain Redis commands to be instrumented in general or just when you're using Redis as a cache?
We use Redis for a couple different things, eg sometimes we use EVAL
to run a script. Let's say I'm only interested in gets/sets/deletes in general across Redis, is that something I can currently do using the cache prefixes?
Meaning, Redis would be instrumented for all commands but only when a key is prefixed with e.g. cache: we would drop commands which are not specified.
I'm not sure what this means - if I set { cachePrefixes: ['cache.'] }
I assume a get span will have op cache.get
, but what would something like PUBLISH
or EVALSHA
have? cache.publish
and cache.evalsha
? Or would those be dropped?
Since cachePrefixes
is a list of strings, what would having multiple strings there do? Eg what is the expected behavior of setting { cachePrefixes: ['cache.', 'redis.'] }
?
from sentry-javascript.
So cachePrefixes
defines a list of prefixes, if any of them is matched we will ensure these spans will show up as cache spans in the UI. So e.g. { cachePrefixes: ['cache.', 'redis.'] }
means that e.g. these: cache.publish
or redis.publish
will be shown as cache spans, but other.publish
will not. Does this make sense?
from sentry-javascript.
So
cachePrefixes
defines a list of prefixes, if any of them is matched we will ensure these spans will show up as cache spans in the UI. So e.g.{ cachePrefixes: ['cache.', 'redis.'] }
means that e.g. these:cache.publish
orredis.publish
will be shown as cache spans, butother.publish
will not. Does this make sense?
I see, so what this sounds like to me is that anything I specify as cache.something
will show up in the Caches performance UI if I have "cache"
in my cachePrefixes. Going back to my original issue however, the Redis integration (as of SDK 8.2.1 at least) marks ioredis
commands as db.<command>
instead of redis.<command>
or cache.<command>
.
So even if I set cache prefixes, it probably won't resolve that issue?
from sentry-javascript.
It looks like the docs on cache prefixes are describing an entirely different usage. The docs are saying the cache prefixes array is used for filtering what the cache key itself is prefixed by, rather than the span op of the cache span?
![image](https://private-user-images.githubusercontent.com/23463457/332944723-17bf7940-866e-4cda-8f05-1303f1f97f0e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzM5MDYsIm5iZiI6MTcxOTE3MzYwNiwicGF0aCI6Ii8yMzQ2MzQ1Ny8zMzI5NDQ3MjMtMTdiZjc5NDAtODY2ZS00Y2RhLThmMDUtMTMwM2YxZjk3ZjBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIwMTMyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2MmY3NWI1OTc1NWNmODBiNTRkNzljZmJkMjVhMmZlNmI4Yjk4ZTQ0YWU4NTMzYWQ2YTAxYzAwNjNlMjNjMmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.x0mhv5IeHef-YaRKcY_weUuWI6Zk_kAKWJ_fe4SDM08)
from sentry-javascript.
@rahul-kumar-saini So in general the docs you are referring to are our "develop" docs which are not really intended for end-user consumption but rather for SDK maintainers, so take everything in there with a grain of salt because it is often idealistic and the reality looks different.
The docs are saying the cache prefixes array is used for filtering what the cache key itself is prefixed by, rather than the span op of the cache span?
The docs here say that if you have a cache invocation, and the cache key matches one of the prefixes, its db
span should be wrapped in a cache
span. In reality, what this will mean for the JS SDK is that the cache span will be wrapped by the db span due to a technical limitation. If the cache key doesn't match any of the prefixes, a cache
span will not be created, the db
span will stay. This is so that you aren't getting random redis spans in your caches view when you don't use redis as a cache. All redis operations will however still likely show up in the queries view.
The caches view will launch soon and we are just in the process of building redis integrations. They are still very much experimental.
cc @AbhiPrasad because he is looking at this soon
from sentry-javascript.
We have two variants, that will be supported with the upcoming release. Each one instruments a set of redis commands.
cache.get
: get, mgetcache.put
: set, setex
All other commands will be handled as db
spans. In regards to your question about other commands like evalsha
: Do you use any other commands to interact with your cache (which ones)?
Currently, it is not possible to evaluate other commands than listed above as cache spans.
from sentry-javascript.
Related Issues (20)
- Add solidstart to release registry
- Add release registry target entry for solidstart to craft.yml
- Add solidstart SDK docs
- Add solidstart onboarding
- A drop in simultaneous requests per seconds with Bun when Sentry is active HOT 3
- Align `Span` interface with changes in Otel Span interface
- Could not find a declaration file for module `@sentry/profiling-node` HOT 5
- Sentry SDK sends events of type `session` twice to two different DSNs
- Add Nuxt SDK package boilerplate
- Inconsisten span origin naming
- SpyOn captureException no longer works in sentry/react 8 HOT 2
- V8 Integrations are broken HOT 9
- Code sign the Sentry lambda layer to use in code signed lambdas HOT 1
- Module not found: Can't resolve 'opentelemetry-instrumentation-fetch-node' HOT 3
- Local variables missing when exception originates in node_modules dependency HOT 4
- Renable http instrumentation test for node-express-esm-preload
- JavaScript heap out of memory HOT 6
- Feedback Modal: Missing Screenshot btn in production HOT 3
- Sentry.captureFeedback produces unviewable images in sentry.io
- Problems with `@sentry/astro` on Netlify HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript.