Skip to content

Commit

Permalink
Bump version to 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vu-hoang-kaligo committed Jan 14, 2025
1 parent 96affbc commit b38b50e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
## [Change Log]

## [0.1.4] - 2025-01-14

- Support instrumentation via event hook approach
- Support metrics logging via StatsdListener

## [0.1.3] - 2025-01-14

- Support testing by mocking MockRedis#evalsha

## [0.1.2] - 2025-01-07

- Support auto-releasing gem

## [0.1.1] - 2025-01-07

- Allow configuring idempotent methods instead of hardcoding POST

## [0.1.0] - 2024-11-13

- Initial release
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
idempotency (0.1.3)
idempotency (0.1.4)
base64
dry-configurable
dry-monitor
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,31 @@ RSpec.configure do |config|
end
```

### Instrumentation

The gem supports instrumentation through StatsD. It tracks the following metrics:

- `idempotency_cache_hit_count` - Incremented when a cached response is found
- `idempotency_cache_miss_count` - Incremented when no cached response exists
- `idempotency_lock_conflict_count` - Incremented when concurrent requests conflict
- `idempotency_cache_duration_seconds` - Histogram of operation duration

Each metric includes tags:
- `action` - Either the specified action name or `"{HTTP_METHOD}:{PATH}"`
- `namespace` - Your configured namespace (if provided)
- `metric` - The metric name (for duration histogram only)

To enable above instrumentation, configure a StatsD listener:

```ruby
statsd_client = Datadog::Statsd.new
statsd_listener = Idempotency::Instrumentation::StatsdListener.new(
statsd_client,
'my_service_name'
)

Idempotency.configure do |config|
config.instrumentation_listeners = [statsd_listener]
end
```

2 changes: 1 addition & 1 deletion lib/idempotency/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class Idempotency
VERSION = '0.1.3'
VERSION = '0.1.4'
end

0 comments on commit b38b50e

Please sign in to comment.