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 init attributes in constructor and sync tracing to work with new … #4206

Conversation

ArtAhmetaj
Copy link
Contributor

@ArtAhmetaj ArtAhmetaj commented Oct 15, 2023

Which problem is this PR solving?

This PR fixes issue #4188 in which the span processor on start method lacks attributes since they are set after with an accessor method (setAttributes) and not on the constructor itself.

Short description of the changes

The PR adds constructor attributes to the span which are optional and if they are added from this layer the spanProcessor.onStart method will have context of attributes whenever it is called, this doest not break compatibility since setAttributes is still a valid public method and also the changes needed on wrappers like the Tracer are done.
Spans have added tests on all constructor tests I could find, the current tests should validate tracer functionality correctly.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • United tested over the build

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

This bug fix should not be noticable since the wrapper tracer call for starting a span should not change functionality (it is only the internal span constructor changing), would like input if I have to change the documentation for the Span constructor itself considering it is @deprecated.

@ArtAhmetaj ArtAhmetaj requested a review from a team October 15, 2023 11:43
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 15, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@ilyamor
Copy link

ilyamor commented Nov 7, 2023

hey @ArtAhmetaj
how can we advance this pr towards approval/merge

@satazor
Copy link
Contributor

satazor commented Nov 8, 2023

Pinging @dyladan, @mayurkale22 and @pichlermarc in an attempt to make this PR gain some traction.

The current implementation makes it impossible to make transformations in onStart of processors that need to access the initial attributes of a span. This pull-request makes it possible.

@Flarna
Copy link
Member

Flarna commented Nov 9, 2023

Your tests seem to verify only the Span constructor but not that you really see the attributes in SpanProcessor#onStart() which is the main intend here to my understanding.
Maybe add such a test or convert one of the new test?

@satazor
Copy link
Contributor

satazor commented Nov 9, 2023

@ArtAhmetaj checking if you are picking this up. I can pick this up if you don't have the time.

@satazor
Copy link
Contributor

satazor commented Nov 9, 2023

I took the liberty to follow up on this PR at #4277 since I have urgency to have this fixed upstream.

@Flarna could you take a look at it?

ArtAhmetaj and others added 2 commits November 24, 2023 22:03
Add spacing on init attributes line

Co-authored-by: Gerhard Stöbich <[email protected]>
Replace truthy value check with loose null check

Co-authored-by: Gerhard Stöbich <[email protected]>
@ArtAhmetaj ArtAhmetaj closed this Nov 24, 2023
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.

4 participants