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

feat(opentelemetry-sdk-trace-base): Add optional forceFlush property to SpanExporter interface #3753

Merged
merged 39 commits into from
May 17, 2023

Conversation

JacksonWeber
Copy link
Contributor

Which problem is this PR solving?

Add mandatory forceFlush property to the SpanExporter interface to bring it in line with the spec.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #3067

Short description of the changes

Added the forceFlush property to the SpanExporter interface and implemented its functionality in the included exporters.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Added appropriate unit tests.

Checklist:

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

sgracias1 and others added 22 commits June 29, 2022 12:40
…to SpanExporter interface

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>
Signed-off-by: Sidartha Gracias <sgracias@cisco.com>
Signed-off-by: Sidartha Gracias <sgracias@cisco.com>
Signed-off-by: Sidartha Gracias <sgracias@cisco.com>
… for downstream exporters

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>
# Conflicts:
#	CHANGELOG.md
#	experimental/packages/otlp-exporter-base/src/OTLPExporterBase.ts
#	packages/opentelemetry-sdk-trace-base/src/export/SimpleSpanProcessor.ts
#	packages/opentelemetry-sdk-trace-base/test/common/export/SimpleSpanProcessor.test.ts
@JacksonWeber JacksonWeber requested a review from a team as a code owner April 24, 2023 23:13
@JacksonWeber JacksonWeber changed the title Issue 3067 feat(opentelemetry-sdk-trace-base): Add mandatory forceFlush property to SpanExporter interface Apr 24, 2023
@JacksonWeber
Copy link
Contributor Author

Going to be adding some updated implementations of the forceFlush() method in the appropriate exporters to ensure they wait for in-flight requests to be completed.

@JacksonWeber
Copy link
Contributor Author

I'm a bit confused what forceFlush() in an exporter like the InMemorySpanExporter is supposed to do when it looks like the SimpleSpanProcessor now collects any unresolvedExports and has its own forceFlush() method that will resolve the array of promises as of #3460.

@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #3753 (0576a9d) into main (17eca4c) will decrease coverage by 0.33%.
The diff coverage is 92.30%.

❗ Current head 0576a9d differs from pull request most recent head d22a10e. Consider uploading reports for the commit d22a10e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3753      +/-   ##
==========================================
- Coverage   93.29%   92.96%   -0.33%     
==========================================
  Files         257      295      +38     
  Lines        7705     9038    +1333     
  Branches     1546     1842     +296     
==========================================
+ Hits         7188     8402    +1214     
- Misses        517      636     +119     
Impacted Files Coverage Δ
...y-sdk-trace-base/src/export/ConsoleSpanExporter.ts 82.35% <50.00%> (ø)
...ackages/otlp-exporter-base/src/OTLPExporterBase.ts 95.23% <100.00%> (+0.23%) ⬆️
...ckages/opentelemetry-exporter-jaeger/src/jaeger.ts 95.06% <100.00%> (+0.12%) ⬆️
...ckages/opentelemetry-exporter-zipkin/src/zipkin.ts 100.00% <100.00%> (ø)
...-sdk-trace-base/src/export/InMemorySpanExporter.ts 100.00% <100.00%> (ø)
...y-sdk-trace-base/src/export/SimpleSpanProcessor.ts 92.50% <100.00%> (ø)

... and 41 files with indirect coverage changes

@JacksonWeber
Copy link
Contributor Author

JacksonWeber commented Apr 27, 2023

@pichlermarc @dyladan Should be ready for final review and merge now. Thanks for your help in this process!

@JacksonWeber
Copy link
Contributor Author

@pichlermarc @dyladan This should be all good to merge now that conflicts/tests are resolved. Thanks!

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

This looks good, thank you @JacksonWeber for getting this one to the finish line 🙂

I have a question for @dyladan @legendecas before approving though: in #3067 there was a discussion about how adding something to an interface is not considered a breaking change - is this still something that is agreed on? Seems to me like this would definitely cause some problems when released as a semver minor bump (i.e. a user's custom exporter not compiling anymore, runtime errors, type incompatibility).

@JacksonWeber
Copy link
Contributor Author

@pichlermarc Addressed your comment so the PR should be good now, but let me know, and thank you for your review on this work!

@pichlermarc pichlermarc changed the title feat(opentelemetry-sdk-trace-base): Add mandatory forceFlush property to SpanExporter interface feat(opentelemetry-sdk-trace-base): Add optional forceFlush property to SpanExporter interface May 11, 2023
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for addressing the comments. 🙂
(FYI I took the liberty to update the changelog entry to save ourselves once cycle 🙂 )

CHANGELOG.md Outdated Show resolved Hide resolved
@JacksonWeber
Copy link
Contributor Author

JacksonWeber commented May 11, 2023

@dyladan Just needs your review and it should be ready to merge 🙂

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

LGTM but the workflow is blocking

@@ -0,0 +1,56 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
Copy link
Member

Choose a reason for hiding this comment

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

Is this file supposed to be here?

@pichlermarc pichlermarc requested a review from dyladan May 17, 2023 19:08
@dyladan dyladan merged commit fcd75df into open-telemetry:main May 17, 2023
14 checks passed
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.

Implement SpanExporter#forceFlush
6 participants