Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pglombardo
Last active November 24, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pglombardo/230d02ec07f9f563e1d7b1ed8b4032a8 to your computer and use it in GitHub Desktop.
Save pglombardo/230d02ec07f9f563e1d7b1ed8b4032a8 to your computer and use it in GitHub Desktop.
Instana Test Trace Generation Script

Instructions

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 "https://rubygems.org"
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..."
else
Instana.logger.warn "Instana agent is reporting not ready status :-("
end
Instana.logger.warn "End of script"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment