Skip to content

Instantly share code, notes, and snippets.

Last active November 24, 2016 16:23
What would you like to do?
Instana Test Trace Generation Script


To run this script, copy the files to a local directory and run:

bundle install

bundle exec ruby test_trace.rb

# frozen_string_literal: true
source ""
gem "instana"
#! /usr/bin/env ruby
ENV['INSTANA_GEM_DEV'] = true.to_s
require 'bundler/setup'
Bundler.require(:default, :development)
require "instana"
::Instana.logger.warn "Hello Instana. Sleeping for a few seconds to allow instana agent to announce and initialize."
sleep 3
if Instana.agent.ready?
Instana.logger.warn "Instana agent is ready to go!"
Instana.logger.warn "Instana: Sending 100 test traces to Instana."
100.times do Instana.tracer.start_or_continue_trace(:test) do sleep 1; end end
Instana.logger.warn "Aaaaannddd they're gone..."
Instana.logger.warn "Instana agent is reporting not ready status :-("
Instana.logger.warn "End of script"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment