From a87ef9ed6469dfc0be8336279c3b566743be5bdf Mon Sep 17 00:00:00 2001 From: Andrey Marchenko Date: Tue, 19 Mar 2024 12:46:54 +0100 Subject: [PATCH] add a section on correctly using tracer with minitest/autorun --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 2f414437..d90a4b1d 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,25 @@ if ENV["DD_ENV"] == "ci" end ``` +> [!IMPORTANT] +> When using `minitest/autorun` the order of requires matters: `datadog/ci` must be +> always required before `minitest/autorun`. + +Example using `minitest/autorun` + +```ruby +require 'datadog/ci' +require 'minitest/autorun' + +if ENV["DD_ENV"] == "ci" + Datadog.configure do |c| + c.ci.enabled = true + c.service = 'my-ruby-app' + c.ci.instrument :minitest + end +end +``` + `options` are the following keyword arguments: | Key | Description | Default |