-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathredis.lua
More file actions
39 lines (32 loc) · 987 Bytes
/
redis.lua
File metadata and controls
39 lines (32 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local sentry = require("sentry.init")
local redis_integration = require("sentry.integrations.redis")
-- Initialize Sentry with Redis transport
local RedisTransport = redis_integration.setup_redis_integration()
sentry.init({
dsn = "https://your-dsn@sentry.io/project-id",
environment = "redis",
transport = RedisTransport,
redis_key = "sentry:events"
})
-- Redis-specific context
sentry.set_tag("platform", "redis")
sentry.set_extra("redis_version", "7.0")
-- Simulate Redis script execution
sentry.add_breadcrumb({
message = "Redis script started",
category = "redis",
level = "info"
})
-- Capture events that will be queued in Redis
sentry.capture_message("Redis script executed successfully", "info")
-- Example of error in Redis context
local success, err = pcall(function()
-- Simulate Redis operation error
redis.call("INVALID_COMMAND")
end)
if not success then
sentry.capture_exception({
type = "RedisError",
message = err
})
end