Add opentelemetry integration to Oban (#6)
By default a new trace is automatically started when a job is processed
by monitoring these events:
* `[:oban, :job, :start]` — at the point a job is fetched from the database and will execute
* `[:oban, :job, :stop]` — after a job succeeds and the success is recorded in the database
* `[:oban, :job, :exception]` — after a job fails and the failure is recorded in the database
To also record a span when a job is created and to link traces together
`Oban.insert/2` has to be replaced by `OpentelemetryOban.insert/2`.
Before:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> Oban.insert()
```
After:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> OpentelemetryOban.insert()
```
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2021-12-08 15:41:36 +00:00
|
|
|
# Changelog
|
|
|
|
|
2024-02-14 16:47:07 +00:00
|
|
|
## 1.1.0
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
|
|
|
* Improve `OpentelemetryOban.PluginHandler` Tracer span attributes.
|
|
|
|
The Plugin's span introduce a set of attributes prefixed with `oban.`.
|
|
|
|
Previously, no attributes were added to the span. The new attributes are:
|
|
|
|
|
|
|
|
* All Plugin:
|
|
|
|
* `oban.plugin`
|
|
|
|
* `Oban.Plugins.Cron` Plugin:
|
|
|
|
* `oban.jobs_count`
|
|
|
|
* `Oban.Plugins.Gossip` Plugin:
|
|
|
|
* `oban.gossip_count`
|
|
|
|
* `Oban.Plugins.Lifeline` Plugin:
|
|
|
|
* `oban.discarded_count`
|
|
|
|
* `oban.rescued_count`
|
|
|
|
* `Oban.Plugins.Pruner` Plugin:
|
|
|
|
* `oban.pruned_count`
|
|
|
|
* `Oban.Pro.Plugins.DynamicCron` Plugin:
|
|
|
|
* `oban.jobs_count`
|
|
|
|
* `Oban.Pro.Plugins.DynamicLifeline` Plugin:
|
|
|
|
* `oban.discarded_count`
|
|
|
|
* `oban.rescued_count`
|
|
|
|
* `Oban.Pro.Plugins.DynamicPrioritizer` Plugin:
|
|
|
|
* `oban.reprioritized_count`
|
|
|
|
* `Oban.Pro.Plugins.DynamicPruner` Plugin:
|
|
|
|
* `oban.pruned_count`
|
|
|
|
* `Oban.Pro.Plugins.DynamicScaler` Plugin:
|
|
|
|
* `oban.scaler.last_scaled_to`
|
|
|
|
* `oban.scaler.last_scaled_at`
|
|
|
|
|
2022-11-17 02:07:23 +00:00
|
|
|
## 1.0.0
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
|
|
|
* Publish 1.0
|
|
|
|
|
|
|
|
### Fixes
|
|
|
|
|
|
|
|
* Fix issue with insert_all
|
|
|
|
|
2022-01-05 01:58:06 +00:00
|
|
|
## 0.2.0-rc.5
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
|
|
|
* Opentelemetry 1.0 support
|
|
|
|
|
2021-12-28 23:39:06 +00:00
|
|
|
## 0.2.0-rc.4
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
|
|
|
* Opentelemetry 1.0.0-rc.4 support
|
|
|
|
|
Add opentelemetry integration to Oban (#6)
By default a new trace is automatically started when a job is processed
by monitoring these events:
* `[:oban, :job, :start]` — at the point a job is fetched from the database and will execute
* `[:oban, :job, :stop]` — after a job succeeds and the success is recorded in the database
* `[:oban, :job, :exception]` — after a job fails and the failure is recorded in the database
To also record a span when a job is created and to link traces together
`Oban.insert/2` has to be replaced by `OpentelemetryOban.insert/2`.
Before:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> Oban.insert()
```
After:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> OpentelemetryOban.insert()
```
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2021-12-08 15:41:36 +00:00
|
|
|
## 0.1.0
|
|
|
|
|
|
|
|
* Initial release
|