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

Implement timeout for force_flush and shutdown. #362

Merged
merged 11 commits into from Nov 20, 2020

Conversation

TommyCpp
Copy link
Contributor

@TommyCpp TommyCpp commented Nov 14, 2020

  • Add the envionment variable support for export timeout.
  • Add support of time out when exporting.
  • Added TraceError enum, still need to add other error type.

Note that the spec only has configuration for maximum time to export data. So the timeout is based on the export time.

Also included the update from otel-proto

Note that the spec only has configuration for maximum time to export data. So the timeout is based on the export time.
Note that the spec only has configuration for maximum time to export data. So the timeout is based on the export time.
@codecov
Copy link

codecov bot commented Nov 14, 2020

Codecov Report

Merging #362 (1cc920d) into master (310df35) will increase coverage by 0.64%.
The diff coverage is 80.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #362      +/-   ##
==========================================
+ Coverage   54.56%   55.20%   +0.64%     
==========================================
  Files          70       71       +1     
  Lines        5914     6048     +134     
==========================================
+ Hits         3227     3339     +112     
- Misses       2687     2709      +22     
Impacted Files Coverage Δ
opentelemetry/src/api/trace/mod.rs 0.00% <0.00%> (ø)
opentelemetry/src/exporter/trace/mod.rs 64.19% <0.00%> (-3.34%) ⬇️
opentelemetry/src/sdk/trace/span_processor.rs 83.15% <84.56%> (+2.10%) ⬆️
opentelemetry/src/sdk/trace/provider.rs 75.51% <100.00%> (+0.51%) ⬆️
opentelemetry/src/testing/trace.rs 75.75% <0.00%> (+4.54%) ⬆️

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 310df35...1cc920d. Read the comment docs.

* Block force_flush until the export results returned from worker.

* Return ExportResult for force_flush and shutdown.
# Conflicts:
#	opentelemetry/src/sdk/trace/span_processor.rs
@TommyCpp TommyCpp marked this pull request as ready for review November 15, 2020 14:29
@TommyCpp TommyCpp requested a review from a team as a code owner November 15, 2020 14:29
Copy link
Member

@frigus02 frigus02 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 like the correct approach to me. I didn't manage to review the tests, yet. Will try to do this later today.

opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
Copy link
Member

@frigus02 frigus02 left a comment

Choose a reason for hiding this comment

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

There is a clippy warning:

casting integer literal to usize is unnecessary

Otherwise this looks good to me 👍

@jtescher
Copy link
Member

Looks like cargo fmt check is failing still

@linux-foundation-easycla

This comment has been minimized.

opentelemetry/src/api/trace/mod.rs Outdated Show resolved Hide resolved
opentelemetry/src/api/trace/mod.rs Show resolved Hide resolved
opentelemetry/Cargo.toml Outdated Show resolved Hide resolved
opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
opentelemetry/src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
@jtescher
Copy link
Member

Looks good thanks @TommyCpp, if there are changes we want to do for #364 we can do them in a subsequent PR

@jtescher jtescher merged commit 6062ea2 into open-telemetry:master Nov 20, 2020
@TommyCpp TommyCpp deleted the timeout branch November 23, 2020 00:30
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

4 participants