Skip to content

Add support for the kicks gem#4253

Closed
marcotc wants to merge 14 commits into
masterfrom
kicks
Closed

Add support for the kicks gem#4253
marcotc wants to merge 14 commits into
masterfrom
kicks

Conversation

@marcotc

@marcotc marcotc commented Jan 2, 2025

Copy link
Copy Markdown
Member

Fixes #4191

Kicks is a fork/continuation of the sneakers gem (announcement).

Change log entry
Yes. Add support for the kicks gem

Additional Notes:

They kept everything the same, even the file paths (require 'sneakers') and module names (::Sneakers).

I created an alias for instrument :kicks to instrument :sneakers, to allow users to use the name that matches their installed gem name. They share the same internal objects and configuration settings.

How to test the change?

@github-actions github-actions Bot added integrations Involves tracing integrations tracing labels Jan 2, 2025
@github-actions

github-actions Bot commented Jan 2, 2025

Copy link
Copy Markdown

Thank you for updating Change log entry section 👏

Visited at: 2025-01-09 11:52:07 UTC

Comment thread appraisal/generate.rb Outdated
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jan 3, 2025

Copy link
Copy Markdown
Contributor

Datadog Report

Branch report: kicks
Commit report: 265d516
Test service: dd-trace-rb

✅ 0 Failed, 22124 Passed, 1477 Skipped, 5m 39.56s Total Time

@pr-commenter

pr-commenter Bot commented Jan 3, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-01-08 19:59:51

Comparing candidate commit 265d516 in PR branch kicks with baseline commit e3ea38f in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.

Comment thread appraisal/generate.rb
@codecov-commenter

codecov-commenter commented Jan 8, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.73%. Comparing base (9440c03) to head (265d516).
⚠️ Report is 3511 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4253      +/-   ##
==========================================
- Coverage   97.73%   97.73%   -0.01%     
==========================================
  Files        1352     1352              
  Lines       82409    82464      +55     
  Branches     4224     4229       +5     
==========================================
+ Hits        80545    80595      +50     
- Misses       1864     1869       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marcotc
marcotc marked this pull request as ready for review January 8, 2025 21:45
@marcotc
marcotc requested review from a team as code owners January 8, 2025 21:45
Comment thread docs/GettingStarted.md

### Kicks

The Kicks integration is a server-side middleware which will trace job executions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Kicks integration is a server-side middleware which will trace job executions.
The Kicks integration is a server-side middleware that traces job executions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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)

Comment thread docs/GettingStarted.md
The Kicks 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Kicks is a continuation of Sneakers. Because Kicks and Sneakers share a Ruby class namespace, they cannot both be active at the same time. Configurations to the Sneakers integration is safely merged with any Kicks configuration.

Comment thread docs/GettingStarted.md
| ---------- | - | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `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? }` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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? }` |
| `on_error` | | `Proc` | Custom error handler invoked when a job raises an error. Provides `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? }` |

Comment thread docs/GettingStarted.md
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Kicks is a continuation of Sneakers. Because Kicks and Sneakers share a Ruby class namespace, they cannot both be active at the same time. Configurations to the Sneakers integration is safely merged with any Kicks configuration.

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM Looks really nice :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually noticed that this file was still being ignored in the Steepfile, but can safely be enabled (passes typecheck), so may be worth including that in this PR ;)

Comment on lines 20 to +22
# @public_api Changing the integration name or integration options can cause breaking changes
register_as :sneakers, auto_patch: true

register_as_alias :sneakers, :kicks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that for register_as_alias the auto_patch is always false -- is that because it reuses the auto_patch from the register_as? (If so, maybe that's a useful comment to leave somewhere, perhaps in the register_as_alias?)

Comment thread docs/GettingStarted.md

### Kicks

The Kicks integration is a server-side middleware which will trace job executions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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)

Comment thread appraisal/ruby-3.3.rb
gem 'roda', '>= 2.0.0'
gem 'semantic_logger', '~> 4.0'
gem 'sidekiq', '~> 7'
gem 'sneakers', '>= 2.12.0'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 sneakers under contrib

@TonyCTHsu TonyCTHsu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this approach to support kicks.

However, I am a little bit concern about

  1. kicks gem decided to rename the modules and paths in the future
  2. The span data is decorated with the obsolete name sneakers can cause confusion

I am overall supportive because (1) might not happen in the future and (2) we could make the risk explicit in the documentation.

I might even push to deprecate sneakers integration and replace it completely with kicks in the next major release.

Comment thread appraisal/ruby-3.3.rb
gem 'roda', '>= 2.0.0'
gem 'semantic_logger', '~> 4.0'
gem 'sidekiq', '~> 7'
gem 'sneakers', '>= 2.12.0'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcotc Do you struggle to remove sneakers from other runtimes? Do you need my help on this?

# The first version of Kicks is 3.0.0. We currently support all versions of Kicks.
#
# @see https://github.com/jondot/sneakers/commit/9780692624c666b6db8266d2d5710f709cb0f2e2
def self.version

@TonyCTHsu TonyCTHsu Jan 9, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They kept everything the same, even the file paths (require 'sneakers') and module names (::Sneakers).

kicks even continue the semantic version to avoid conflict with the obsolete gem.

Correct me if I am wrong. Due to this, I assume the easiest path to support kicks is to change self.version with the conditional logic of kicks from Gem.loaded_specs. Do we need register_as_alias to support kicks?

Comment thread appraisal/jruby-9.2.rb
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we don't need to invoke build_coverage_matrix with latest: false, since this method call only generate a single group.

Prefer the following for explicitness

appraisal 'sneakers-min' do 
  gem 'sneakers', '= 2.12.0'
end

Comment thread appraisal/generate.rb
# @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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
range = range..range if range.is_a?(Integer)
range = Array(range)

@ivoanjo

ivoanjo commented Jan 9, 2025

Copy link
Copy Markdown
Member
  1. kicks gem decided to rename the modules and paths in the future

I'm guessing they would rename on a major version, so we'd probably want to support the 3.x series (with sneakers naming) for a while?

Looking at their readme, it seems the main objective was "original author was unresponsive, community had a few pending patches":

image

...so yeah doesn't look like the kind of project that will refactor just for the sake of making the name prettier ;)

@brightball

Copy link
Copy Markdown

Just wanted to give a nudge here that my team is eagerly waiting to use this as soon as you merge.

@javierjulio

Copy link
Copy Markdown

This and any improvements would be helpful to have as we use Sneakers. We migrated to the Kicks gem which was a like for like change. It resulted in no code changes. Just swapping out the gem names in our Gemfile. Does this implement error tracking for Kicks? We use Datadog Error Tracking with a custom Sneakers error_reporters set but we are noticing the Datadog active_span is nil so Sneakers errors by default are not being reported in Datadog.

@Strech

Strech commented Jan 16, 2026

Copy link
Copy Markdown
Member

@codex find critical bugs and corner cases

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • Not run (not requested).

View task →

@ivoanjo

ivoanjo commented Feb 6, 2026

Copy link
Copy Markdown
Member

Superceded by #5305

@ivoanjo ivoanjo closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kicks integration

8 participants