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

Allowing custom TRACE_ID to be set #202

Open
jaswanthm opened this issue Apr 5, 2023 · 2 comments
Open

Allowing custom TRACE_ID to be set #202

jaswanthm opened this issue Apr 5, 2023 · 2 comments
Labels
type: enhancement New feature or request

Comments

@jaswanthm
Copy link

Is your feature request related to a problem? Please describe.
I'm currently trying to create spans from within the tests. The idea is to achieve it by having the build level trace as the parent. Unfortunately, because I'm using Otel libraries (opentelemetry-js to be specific), the existing TRACE_ID and SPAN_ID doesn't pass its validation.

Otel validation for trace and span ID

const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;

(Current TRACE_ID setup - https://github.com/honeycombio/gha-buildevents/blob/main/src/index.ts#L104)

Describe the solution you'd like
The current Trace_ID is really good and has all the relevant information while debugging, etc. But it would be great to have an option to set custom trace and span IDs.

One option is for the user to override TRACE_ID and SPAN_ID from the build scripts. This way, a new trace_id or span_id is created will only be created only if these variables doesn't exist.

This is just one option that came to my mind. Happy to take other suggestions.

Describe alternatives you've considered
The other option is to use the generic buildevents library directly to pass in trace and span IDs directly, but that would be repeating the work this action does.

@jaswanthm jaswanthm added the type: enhancement New feature or request label Apr 5, 2023
@jaswanthm
Copy link
Author

I also realised that the core buildevents library also doesn't provide otel compliant TRACE and SPAN ids. So as a workaround, I found https://github.com/equinix-labs/otel-cli to temporarily create my own spans and traces manually.

@jaswanthm
Copy link
Author

Another linked issue regarding otel compliance - honeycombio/buildevents#171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant