You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config.instrumentation_listeners = [my_custom_listener] # Array of custom listeners
39
44
end
@@ -110,7 +115,11 @@ end
110
115
111
116
### Instrumentation
112
117
113
-
The gem supports instrumentation through StatsD out of the box. When you configure a StatsD client in the configuration, the StatsdListener will be automatically set up. It tracks the following metrics:
118
+
The gem supports instrumentation through multiple observability platforms:
119
+
120
+
#### StatsD
121
+
122
+
When you configure a StatsD client in the configuration, the StatsdListener will be automatically set up. It tracks the following metrics:
114
123
115
124
-`idempotency_cache_hit_count` - Incremented when a cached response is found
116
125
-`idempotency_cache_miss_count` - Incremented when no cached response exists
@@ -122,11 +131,38 @@ Each metric includes tags:
122
131
-`namespace` - Your configured namespace (if provided)
123
132
-`metric` - The metric name (for duration histogram only)
124
133
125
-
To enable StatsD instrumentation, simply configure the metrics settings:
134
+
To enable StatsD instrumentation:
126
135
127
136
```ruby
128
137
Idempotency.configure do |config|
129
138
config.metrics.statsd_client =Datadog::Statsd.new
130
139
config.metrics.namespace ='my_service_name'
131
140
end
132
141
```
142
+
143
+
#### AppSignal
144
+
145
+
The gem can add the `use_cache` method to AppSignal transaction traces when enabled. This allows you to see the idempotency check as part of your request traces and helps identify performance bottlenecks.
146
+
147
+
To enable AppSignal transaction tracking:
148
+
149
+
```ruby
150
+
Idempotency.configure do |config|
151
+
config.observability.appsignal_enabled =true
152
+
end
153
+
```
154
+
155
+
Note: The AppSignal gem must be installed and configured in your application.
156
+
157
+
#### Using Both AppSignal and Sentry
158
+
159
+
You can enable both observability tools simultaneously. When both are enabled, the `use_cache` method will be instrumented in both APM systems with nested transactions:
160
+
161
+
```ruby
162
+
Idempotency.configure do |config|
163
+
config.observability.appsignal_enabled =true
164
+
config.observability.sentry_enabled =true
165
+
end
166
+
```
167
+
168
+
This allows you to see the idempotency check in both your AppSignal and Sentry dashboards, providing comprehensive observability across your monitoring stack.
0 commit comments