Skip to content

Commit

Permalink
use binary
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Gardner <[email protected]>
  • Loading branch information
agardnerIT committed Jul 27, 2023
1 parent ed4db5b commit 0ed41f7
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions samples/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/bin/bash

# Download tracepusher binary
# Do this ONCE, outside of the shell script!
# This binary shown below is for MacOS
# Change tracepusher_binary as appropriate for your environment
# windows = tracepusher_${tracepusher_version}.exe
# linux = tracepusher_linux_x64_${tracepusher_version}
#
# If you can't sudo, remove that line and run tracepusher
# from the local directory
# ie. change "tracepusher" to "./tracepusher" on lines 45 and 65
#
# == DOWNLOAD CODE - DO THIS ONCE ==
# tracepusher_version=0.8.0
# tracepusher_binary=tracepusher_darwin_${tracepusher_version}
# wget --quiet -O tracepusher https://github.com/agardnerIT/tracepusher/releases/download/${tracepusher_version}/${tracepusher_binary}
# chmod +x tracepusher
# sudo mv tracepusher /usr/local/bin

trace_id=$(openssl rand -hex 16)
span_id=$(openssl rand -hex 8)

Expand All @@ -23,7 +41,7 @@ do
duration=$(( $time_end - $time_start ))
echo "loop time_start: ${time_start}. time_end: ${time_end}. duration: ${duration}"

python3 tracepusher.py \
tracepusher \
--endpoint=http://localhost:4318 \
--service-name=serviceA \
--span-name="subspan${counter}" \
Expand All @@ -43,11 +61,11 @@ time_end=$SECONDS
echo "main time_start: ${main_time_start}. time_end: ${time_end}"

echo "pushing main_trace with duration: ${time_end} and trace_id: ${trace_id} and span_id=${span_id} and time shifted"
python3 tracepusher.py \
tracepusher \
--endpoint=http://localhost:4318 \
--service-name=serviceA \
--span-name="main_span" \
--duration=${time_end} \
--trace-id=${trace_id} \
--span-id=${span_id} \
--time-shift=True
--time-shift=True

0 comments on commit 0ed41f7

Please sign in to comment.