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

Add support for traces metadata #1104

Merged
merged 4 commits into from Dec 15, 2023
Merged

Add support for traces metadata #1104

merged 4 commits into from Dec 15, 2023

Conversation

ka3de
Copy link
Collaborator

@ka3de ka3de commented Nov 17, 2023

What?

Adds support for traces metadata, which allows users to specify extra key-value fields to be included as attributes for the generated traces.

Why?

Allows to define extra attributes that can then be used to query traces from the backend (e.g.: Tempo).

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Related: #1100

@ka3de ka3de force-pushed the feat/tracing branch 3 times, most recently from f4cdfc8 to 0f0e214 Compare December 11, 2023 11:09
Base automatically changed from feat/tracing to main December 11, 2023 14:02
@ka3de ka3de force-pushed the feat/traces-metadata branch 3 times, most recently from d63dc27 to 45c0f53 Compare December 15, 2023 09:25
@ka3de
Copy link
Collaborator Author

ka3de commented Dec 15, 2023

I wanted to extend the TestTracing integration test in order to verify that the attributes that we set in the spans are actually set, but unfortunately, due to OTEL's interfaces and unexported types and functions it's been impossible to extract the attributes from a trace.SpanStartOption.

@ka3de ka3de marked this pull request as ready for review December 15, 2023 09:39
Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

This variable can be used to set extra metadata to be included when
generating the iteration's root span.
Traces metadata are included in the root module so they can be parsed
just once and shared for every VU. Parsing must happen in the
NewModuleInstance call so we can use the VU's InitEnv environment lookup
function, as well as aborth the test early if there is a format error.
This extra metadata, defined as string key-value pairs, will be included
as attributes for every span generated from the tracer implementation.
Because the traces registry and its underlying tracer are only
initialized on the first iterStart event for each VU, the browser
registry must keep a reference to the traces metadata until this event
is fired and the traces registry and tracer can be initialized.
@ka3de ka3de merged commit a84a546 into main Dec 15, 2023
17 checks passed
@ka3de ka3de deleted the feat/traces-metadata branch December 15, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants