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
Add AppSignal and Sentry APM instrumentation (v0.3.0)
- Add transaction tracking for AppSignal (>= 2.0, < 4.0)
- Add transaction tracking for Sentry (>= 4.1.0)
- Support simultaneous instrumentation in both APM tools
- Add observability configuration (appsignal_enabled, sentry_enabled)
- Add comprehensive unit tests for APM instrumentation
- Update documentation with usage examples
- Bump version to 0.3.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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,52 @@ 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
+
#### Sentry
158
+
159
+
The gem can add the `use_cache` method to Sentry performance traces when enabled. This allows you to see the idempotency check as part of your request traces and automatically captures any errors that occur.
160
+
161
+
To enable Sentry transaction tracking:
162
+
163
+
```ruby
164
+
Idempotency.configure do |config|
165
+
config.observability.sentry_enabled =true
166
+
end
167
+
```
168
+
169
+
Note: The Sentry gem must be installed and configured in your application.
170
+
171
+
#### Using Both AppSignal and Sentry
172
+
173
+
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:
174
+
175
+
```ruby
176
+
Idempotency.configure do |config|
177
+
config.observability.appsignal_enabled =true
178
+
config.observability.sentry_enabled =true
179
+
end
180
+
```
181
+
182
+
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