Skip to content

Commit

Permalink
fix curl command naming
Browse files Browse the repository at this point in the history
  • Loading branch information
plengauer committed Sep 20, 2023
1 parent 82ece32 commit 614684c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: opentelemetry-bash
Version: 0.7.1
Version: 0.7.2
Architecture: all
Depends: bash, awk, apt, python3, python3-pip, python3-venv
Priority: extra
Expand Down
8 changes: 4 additions & 4 deletions package/usr/bin/opentelemetry_bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function otel_instrumented_wget {
local target=$(\echo ${url#*//*/}/)
local host=$(\echo ${url} | \awk -F/ '{print $3}')
local method=GET
name="wget $@" kind=CLIENT \
name="wget $*" kind=CLIENT \
attributes="http.url=$url,http.host=$host,http.target=$target,http.method=$method" \
command="wget $@" \
command="wget $*" \
otel_observe \wget --header="traceparent: $OTEL_TRACEPARENT" "$@"
}
alias wget=otel_instrumented_wget
Expand All @@ -31,9 +31,9 @@ function otel_instrumented_curl {
local target=$(\echo ${url#*//*/}/)
local host=$(\echo ${url} | \awk -F/ '{print $3}')
local method=$(\echo $@ | \awk '{for(i=1;i<=NF;i++) if ($i == "-X") print $(i+1)}')
name="curl $@" kind=CLIENT \
name="curl $*" kind=CLIENT \
attributes="http.url=$url,http.host=$host,http.target=$target,http.method=$method" \
command="wget $@" \
command="curl $*" \
otel_observe \curl -H "traceparent: $OTEL_TRACEPARENT" "$@"
}
alias curl=otel_instrumented_curl
Expand Down

0 comments on commit 614684c

Please sign in to comment.