Skip to content

Commit

Permalink
fix handling of empty headers in otel-cli call
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Oct 3, 2024
1 parent 01de8e2 commit 46916e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/rapids-otel-wrap
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ type otel-cli >/dev/null 2>&1 && {
if [ -n "${RAPIDS_OTEL_ATTRS}" ]; then \
attrs="--attrs ${RAPIDS_OTEL_ATTRS}"; \
fi
if [ -n "OTEL_EXPORTER_OTLP_HEADERS" ]; then \
headers="--otlp-headers ${OTEL_EXPORTER_OTLP_HEADERS}"; \
fi
# TRACEPARENT gets picked up as an env var automatically
# https://github.com/equinix-labs/otel-cli?tab=readme-ov-file#examples
otel-cli span -n "$1" -s "${RAPIDS_SERVICE_NAME}" \
--endpoint "${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT}" \
--start "$start" --end "$(date ${TIME_FORMAT})" \
--otlp-headers "${OTEL_EXPORTER_OTLP_HEADERS}" \
--protocol http/protobuf \
--status-code "${RETURN_STATUS}" \
"${attrs}"
${attrs} ${headers}
}
cleanup "$@"
exit "${RETURN_STATUS}"

0 comments on commit 46916e9

Please sign in to comment.