Add Hanami 1.x instrumentation
Setup Guide
Install
in Gemfile
gem 'ddtrace', require: 'ddtrace/auto_instrument'
Configuration
in config/initializers/datadog.rb
Datadog.configure do |c|
# Do your custom configuration
end
What does this Hanami instrumentation provide?
Instrument Hanami 1.x, internally activating rack to instrument rack, which is usually the root span and could handle distributing tracing.
3 spans are generated by a Hanami instrumentation, which are routing, action, render.
-
routingstarts recording from endpoint lookup til the response is returned -
actioncovers the time for an action execution, including callbacks such asbeforeandafter -
renderdescribes the duration when an output is provided(from action or rack middleware) to be rendered.
https://github.com/DataDog/dd-trace-rb/issues/979
The example flamegraph pattern looks like below

Since this PR is already big as-is, here's a suggestion: consider doing a separate PR to just add Hanami as a test app (even if it doesn't work until we actually add the instrumentation).
That way we can focus more on the actual changes and how instrumentation looks vs getting lost in the noise of bootstrapping an example Hanami application. 😄
Codecov Report
:exclamation: No coverage uploaded for pull request base (
feature/hanami-integration-app@295858e). Click here to learn what that means. The diff coverage isn/a.
@@ Coverage Diff @@
## feature/hanami-integration-app #2230 +/- ##
=================================================================
Coverage ? 97.59%
=================================================================
Files ? 1106
Lines ? 57541
Branches ? 0
=================================================================
Hits ? 56156
Misses ? 1385
Partials ? 0
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more