Skip to content

Commit 7d2f689

Browse files
authored
Merge pull request #137 from hennevogel/bugfix/aj-failures
Fix measurements of performing/failed ActiveJobs
2 parents 878305c + 9ce8a60 commit 7d2f689

File tree

6 files changed

+10
-77
lines changed

6 files changed

+10
-77
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
For the full commit log, [see here](https://github.com/influxdata/influxdb-rails/commits/master).
44

5+
## v1.0.1.beta3, release 2020-10-16
6+
- Drop `perform_start.active_job` subscriber, it's rather useless on dashboards.
7+
58
## v1.0.1.beta2, released 2020-09-14
69
- Implement [`deliver.action_mailer`](https://guides.rubyonrails.org/active_support_instrumentation.html#deliver-action-mailer) subscriber
710
- Add missing Active Job documentation

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ Reported tags:
137137
Reported ActiveSupport instrumentation hooks:
138138

139139
- [enqueue.active\_job](https://guides.rubyonrails.org/active_support_instrumentation.html#enqueue-active-job)
140-
- [perform_start.active\_job](https://guides.rubyonrails.org/active_support_instrumentation.html#perform-start-active-job)
141140
- [perform.active\_job](https://guides.rubyonrails.org/active_support_instrumentation.html#perform-active-job)
142141

143142
Reported values:
@@ -149,14 +148,14 @@ Reported values:
149148
Reported tags:
150149

151150
```ruby
152-
hook: ["enqueue", "perform_start", "perform"],
153-
state: ["queued", "running", "succeeded", "failed"],
151+
hook: ["enqueue", "perform"],
152+
state: ["queued", "succeeded", "failed"],
154153
job: "SomeJobClassName",
155154
queue: "queue_name"
156155
```
157156

158157
*Note*: Only the measurements with the hook `perform` report a duration in the value.
159-
The other hooks are counters and always report a value of `1`.
158+
The enqueue hook is a counter and always reports a value of `1`.
160159

161160
### Action Mailer
162161

lib/influxdb/rails/middleware/active_job_subscriber.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def short_hook_name
4444

4545
def fetch_short_hook_name
4646
return "enqueue" if hook_name.include?("enqueue")
47-
return "perform_start" if hook_name.include?("perform_start")
48-
return "perform" if hook_name.include?("perform")
47+
48+
"perform"
4949
end
5050

5151
def job
@@ -59,7 +59,7 @@ def value
5959
end
6060

6161
def failed?
62-
payload[:exception_object]
62+
payload[:aborted]
6363
end
6464
end
6565
end

lib/influxdb/rails/railtie.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Railtie < ::Rails::Railtie # :nodoc:
3232
"sql.active_record" => Middleware::SqlSubscriber,
3333
"instantiation.active_record" => Middleware::ActiveRecordSubscriber,
3434
"enqueue.active_job" => Middleware::ActiveJobSubscriber,
35-
"perform_start.active_job" => Middleware::ActiveJobSubscriber,
3635
"perform.active_job" => Middleware::ActiveJobSubscriber,
3736
"deliver.action_mailer" => Middleware::ActionMailerSubscriber,
3837
"block_instrumentation.influxdb_rails" => Middleware::BlockInstrumentationSubscriber,

lib/influxdb/rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module InfluxDB
22
module Rails
3-
VERSION = "1.0.1.beta2".freeze
3+
VERSION = "1.0.1.beta3".freeze
44
end
55
end

spec/requests/active_job_perform_start_metrics_spec.rb

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)