-
Notifications
You must be signed in to change notification settings - Fork 393
Add support for the kicks
gem
#4253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
1396121
7bd5b43
0643968
1d273cf
a4c0ca6
9351e39
03db6f2
c5c1384
8cf6a59
efd850e
b018621
6d6743d
539da60
265d516
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -49,12 +49,15 @@ | |||||
|
||||||
# Builds a matrix of versions to test for a given integration | ||||||
|
||||||
# `range`: the range of versions to test | ||||||
# `gem` : optional, gem name to test (gem name can be different from the integration name) | ||||||
# `min` : optional, minimum version to test | ||||||
# `meta` : optional, additional metadata (development dependencies, etc.) for the group | ||||||
def build_coverage_matrix(integration, range, gem: nil, min: nil, meta: {}) | ||||||
gem ||= integration | ||||||
# @param [String] integration the name of the integration to test | ||||||
# @param [Range, Integer] range the range of major versions to test, or a single major version to test | ||||||
# @param [String] gem optional, gem name to test (gem name can be different from the integration name) | ||||||
# @param [String] min optional, minimum version to test | ||||||
# @param [Boolean] latest optional, whether to test the latest version | ||||||
# @param [Hash] meta optional, additional metadata (development dependencies, etc.) for the group | ||||||
def build_coverage_matrix(integration, range, gem: integration, min: nil, latest: true, meta: {}) | ||||||
# Allow single version to be passed easily | ||||||
range = range..range if range.is_a?(Integer) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
if min | ||||||
appraise "#{integration}-min" do | ||||||
|
@@ -70,12 +73,14 @@ def build_coverage_matrix(integration, range, gem: nil, min: nil, meta: {}) | |||||
end | ||||||
end | ||||||
|
||||||
appraise "#{integration}-latest" do | ||||||
# The latest group declares dependencies without version constraints, | ||||||
# still requires being updated to pick up the next major version and | ||||||
# committing the changes to lockfiles. | ||||||
gem gem | ||||||
meta.each { |k, v| v ? gem(k, v) : gem(k) } | ||||||
if latest | ||||||
appraise "#{integration}-latest" do | ||||||
# The latest group declares dependencies without version constraints, | ||||||
# still requires being updated to pick up the next major version and | ||||||
# committing the changes to lockfiles. | ||||||
gem gem | ||||||
meta.each { |k, v| v ? gem(k, v) : gem(k) } | ||||||
end | ||||||
end | ||||||
end | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,8 @@ | |
build_coverage_matrix('stripe', 7..12, min: '5.15.0') | ||
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby') | ||
build_coverage_matrix('elasticsearch', 7..8) | ||
build_coverage_matrix('kicks', [], min: '3.0.0') | ||
build_coverage_matrix('sneakers', [], min: '2.12.0', latest: false) # Sneakers is not receiving updates anymore and 2.12.0 is the last version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually think we don't need to invoke Prefer the following for explicitness appraisal 'sneakers-min' do
gem 'sneakers', '= 2.12.0'
end |
||
|
||
appraise 'relational_db' do | ||
gem 'activerecord', '~> 5' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,8 @@ | |
build_coverage_matrix('stripe', 7..12, min: '5.15.0') | ||
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby') | ||
build_coverage_matrix('elasticsearch', 7..8) | ||
build_coverage_matrix('kicks', [], min: '3.0.0') | ||
build_coverage_matrix('sneakers', [], min: '2.12.0', latest: false) # Sneakers is not receiving updates anymore and 2.12.0 is the last version | ||
|
||
appraise 'relational_db' do | ||
gem 'activerecord', '~> 7' | ||
|
@@ -131,7 +133,6 @@ | |
gem 'roda', '>= 2.0.0' | ||
gem 'semantic_logger', '~> 4.0' | ||
gem 'sidekiq', '~> 7' | ||
gem 'sneakers', '>= 2.12.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this change be propagated to the other appraisal files as well? Noticed the others still list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marcotc Do you struggle to remove |
||
gem 'sucker_punch' | ||
gem 'que', '>= 1.0.0' | ||
end | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1112,6 +1112,32 @@ end | |||||
| --------- | ------------------------------- | ------ | -------------------------------------------- | ------- | | ||||||
| `enabled` | `DD_TRACE_KAFKA_ENABLED` | `Bool` | Whether the integration should create spans. | `true` | | ||||||
|
||||||
### Kicks | ||||||
|
||||||
The Kicks integration is a server-side middleware which will trace job executions. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I noticed most of these were copy-pasted from the sneakers docs, so we should probably propagate the improvements to both) |
||||||
|
||||||
<div class="alert alert-warning"> | ||||||
Kicks is a continuation of Sneakers and both cannot be active at the same time, as they share their Ruby class namespace. Configurations to the Sneakers integration will be safely merged with any Kicks configuration. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</div> | ||||||
|
||||||
You can enable it through `Datadog.configure`: | ||||||
|
||||||
```ruby | ||||||
require 'datadog' | ||||||
|
||||||
Datadog.configure do |c| | ||||||
c.tracing.instrument :kicks, **options | ||||||
end | ||||||
``` | ||||||
|
||||||
`options` are the following keyword arguments: | ||||||
|
||||||
| Key | Env Var | Type | Description | Default | | ||||||
| ---------- | - | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | ||||||
| `enabled` | `DD_TRACE_SNEAKERS_ENABLED` | `Bool` | Whether the integration should create spans. | `true` | | ||||||
| `tag_body` | | `Bool` | Enable tagging of job message. `true` for on, `false` for off. | `false` | | ||||||
| `on_error` | | `Proc` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { \|span, error\| span.set_error(error) unless span.nil? }` | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### MongoDB | ||||||
|
||||||
The integration traces any `Command` that is sent from the [MongoDB Ruby Driver](https://github.com/mongodb/mongo-ruby-driver) to a MongoDB cluster. By extension, Object Document Mappers (ODM) such as Mongoid are automatically instrumented if they use the official Ruby driver. To activate the integration, simply: | ||||||
|
@@ -1935,6 +1961,10 @@ end | |||||
|
||||||
The Sneakers integration is a server-side middleware which will trace job executions. | ||||||
|
||||||
<div class="alert alert-warning"> | ||||||
Kicks is a continuation of Sneakers and both cannot be active at the same time, as they share their Ruby class namespace. Configurations to the Sneakers integration will be safely merged with any Kicks configuration. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</div> | ||||||
|
||||||
You can enable it through `Datadog.configure`: | ||||||
|
||||||
```ruby | ||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.