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

Move force_flush from tracer provider API to SDK #588 #658

Merged
merged 1 commit into from Mar 20, 2022

Conversation

rohithv1997
Copy link
Contributor

Removed force_flush from TracerProvider trait in API and added it as pub fn in TracerProvider implementation in SDK

@rohithv1997 rohithv1997 requested a review from a team as a code owner October 25, 2021 11:25
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 25, 2021

CLA Signed

The committers are authorized under a signed CLA.

@rohithv1997
Copy link
Contributor Author

PR for #588

@rohithv1997
Copy link
Contributor Author

rohithv1997 commented Oct 25, 2021

CLA Signed

The committers are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #658 (f8bf60e) into main (535a1d9) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #658     +/-   ##
=======================================
+ Coverage   69.6%   69.8%   +0.1%     
=======================================
  Files        109     109             
  Lines       8824    8807     -17     
=======================================
  Hits        6150    6150             
+ Misses      2674    2657     -17     
Impacted Files Coverage Δ
opentelemetry-api/src/global/trace.rs 40.2% <ø> (+5.0%) ⬆️
opentelemetry-api/src/trace/noop.rs 68.4% <ø> (+2.1%) ⬆️
opentelemetry-api/src/trace/tracer_provider.rs 100.0% <ø> (ø)
opentelemetry-sdk/src/trace/provider.rs 83.9% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 535a1d9...f8bf60e. Read the comment docs.

@TommyCpp
Copy link
Contributor

/easycla

@rohithv1997
Copy link
Contributor Author

rohithv1997 commented Oct 26, 2021

@rust-approvers - PR is available for review. How do I mark this PR as available for review?

@TommyCpp
Copy link
Contributor

I think I know why your CLA check failed. You have a commit associated with other account/email so that one also have to sign the CLA.

@TommyCpp TommyCpp self-assigned this Oct 26, 2021
@rohithv-tw
Copy link
Contributor

@TommyCpp - have signed the cla from the account linked with the commit. i will retrigger cla bot again

@rohithv-tw
Copy link
Contributor

/easycla

@@ -370,6 +363,10 @@ impl GlobalTracerProvider {
provider: Arc::new(provider),
}
}

fn force_flush(&self) -> Vec<TraceResult<()>> {
Vec::new()
Copy link
Contributor

Choose a reason for hiding this comment

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

We still need to ask the underlying TracerProvider to force push the spans instead of making it a noop here right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TommyCpp - Yes. But since we removed force_flush from the TracerProvider trait, I didnt know where to place this pub fn

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I guess we need to first figure out whether global is part of SDK or API. i.e should we allow users to provide their own implementation of TracerProvider

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to allow users to bring their own implementation and be able to use global. In that case, we need to downcast the Box<dyn TracerProvider>. That may cause some perf issue as it's dynamic reflection. @jtescher any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TommyCpp - i believe we can ask the users to use TracerProvider::Create rather than providing option for users to create custom tracer providers because the issue linked was to decouple TracerProvider::Create from the underlying functionality.
Exposing ability to create custom TracerProviders also will include exposing traits that provide SDK functionality, which is opposite of what we have done as part of this issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the global is part of the API. As the API asks implementation to provide a way to register any TracerProvider in API.

Normally, the TracerProvider is expected to be accessed from a central place. Thus, the API SHOULD provide a way to set/register and access a global default TracerProvider

To that end, we should probably remove force_flush method from the global module. However, I believe many users want to use force_flush to make sure their spans are sent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Thanks

Copy link
Member

Choose a reason for hiding this comment

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

Yeah let's remove it for now as it's not in the API spec

@hdost
Copy link
Contributor

hdost commented Feb 18, 2022

@rohithv1997 there was recently a split in the packages, you may need to rebase this

@rohithv-tw
Copy link
Contributor

@hdost - will do so. thanks!

Co-authored-by: Rohith VenkataRamanaNanthan <rohith.v@thoughtworks.com>
@hdost
Copy link
Contributor

hdost commented Mar 14, 2022

Might be good to also update the changelog about the breaking change.

@TommyCpp TommyCpp removed their assignment Mar 14, 2022
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

6 participants