Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bash example #4

Open
wants to merge 1 commit into
base: feat-add-githubactionseventreceiver
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions receiver/githubactionsreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ generate_job_span_id() {
local run_id=$1
local run_attempt=$2
local job_name=$3
echo -n "${run_id}${run_attempt}${job_name}" | openssl dgst -sha256 | sed 's/^.* //' | cut -c-16
echo -n "${run_id}${run_attempt}${job_name}" | openssl dgst -sha256 | sed 's/^.* //' | cut -c17-32
}

generate_step_span_id() {
Expand All @@ -150,7 +150,7 @@ generate_step_span_id() {
local job_name=$3
local step_name=$4
input="${run_id}${run_attempt}${job_name}${step_name}"
echo -n "$input" | openssl dgst -sha256 | sed 's/^.* //' | cut -c-16
echo -n "$input" | openssl dgst -sha256 | sed 's/^.* //' | cut -c17-32
}

# https://docs.github.com/en/actions/learn-github-actions/variables
Expand All @@ -159,8 +159,8 @@ job_span_id=$(generate_job_span_id ${GITHUB_RUN_ID} ${GITHUB_RUN_ATTEMPT} ${GITH
step_span_id=$(generate_step_span_id ${GITHUB_RUN_ID} ${GITHUB_RUN_ATTEMPT} ${GITHUB_JOB} "your-step-name")

echo "Trace ID: ${trace_id}"
echo "Job Span ID: ${parent_span_id}"
echo "Step Span ID: ${span_id:0:16}"
echo "Job Span ID: ${job_span_id}"
echo "Step Span ID: ${step_span_id}"
```

##### Generating IDs in Other Languages
Expand Down