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 config options from env for BatchSpanProcessor #228

Merged
merged 4 commits into from
Sep 26, 2020

Conversation

TommyCpp
Copy link
Contributor

part of #168

@TommyCpp TommyCpp requested a review from a team September 24, 2020 00:32
Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

Great start @TommyCpp, had a couple of questions but looking good

src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
@@ -269,6 +283,56 @@ impl BatchSpanProcessor {
config: Default::default(),
}
}

/// Create a new batch processor builder and set the config value based on environment variables.
pub fn from_env<E, S, SO, I, IO>(
Copy link
Member

Choose a reason for hiding this comment

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

Do you prefer the explicit from_env here? Has advantages of being clear when it is looking from env, alternative could be to have the batch config be options and fall back to checking env variables for any unset values sorta merging both constructors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess that depends on whether we should assume users always want to apply environment variable configuration. Personally I'd like know exactly where does the configuration comes from. But we could use environment variable to fill unset values in configs too.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I see the pros and cons of both (e.g. the jaeger exporter has an explicit from_env). I think it is fine for now to get feedback from the community on which is preferred.

…ller than max queue size.

* Add validation in `with_max_export_batch_size`, when input is larger than max queue size. Will lower it to be equal to max queue size.

* Address comments.
src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
src/sdk/trace/span_processor.rs Outdated Show resolved Hide resolved
Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

Thanks @TommyCpp

@jtescher jtescher merged commit 1689c73 into open-telemetry:master Sep 26, 2020
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.

2 participants