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

Remove MILLIS from BatchSpanProcessor variables and define semantics for... #1325

Merged
merged 6 commits into from
Jan 21, 2021

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Jan 7, 2021

… duration values.

Fixes #1312

Changes

Removes MILLIS from BatchSpanProcessor time variables in favor of defining durations to always be interpreted as milliseconds.

@@ -2,6 +2,22 @@

The goal of this specification is to unify the environment variable names between different OpenTelemetry SDK implementations. SDKs MAY choose to allow configuration via the environment variables in this specification, but are not required to. If they do, they SHOULD use the names listed in this document.

## Special configuration types

### Duration
Copy link
Contributor Author

@anuraaga anuraaga Jan 7, 2021

Choose a reason for hiding this comment

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

@mwear I'm imagining Endpoint to also be added to this list after #1234 (awesome PR number!)

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure this is worth it. In Go this can be parsed with stdlib, but that's not always the case in other langs, so it introduces an extra burden on SDK implementations with not a lot of benefits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yurishkuro We're discussing on #1312. @jsuereth has started working on adding it to all the languages and not sure how best to proceed with it without a definition of the unit strings. open-telemetry/opentelemetry-java#2439 I'm personally fine with anything that makes the variable names consistent :)


### Duration

Any value that represents a duration, for example a timeout, MUST interpret a purely numeric value as a number of
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI - I didn't notice you already had this PR. I described this a bit differently: https://github.com/open-telemetry/opentelemetry-specification/compare/master...jsuereth:wip-duration-defaults?expand=1

I think your specification is a lot smaller, but is missing the bit about PositiveInteger, i.e. I think we also need to limit the numeric value so it's reasonable to contribute a parser in all languages.

Suggested change:

Any value that represents a duration, for example a timeout, MUST interpret a purely positive integer value as a number of milliseconds. Formatted strings with a positive integer followed immediately by a unit string MAY be interpreted for the following units:

Copy link
Contributor

Choose a reason for hiding this comment

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

Formatted strings with a positive integer followed immediately by a unit string MAY be interpreted for the following units:

I'm afraid that languages not supporting this specific sentence will soon be approached by users asking: "Hey, why doesn't this work? In Go it does but it doesn't in X language", converting it the de facto required.

(I know this is a small piece of work - but if we allow this to creep, we then may allow other 20 small additions and drag the release more than it is - and, well, we can easily add support for this parsing by the time we do the next release, which should include stable metrics :) )

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand the concern.

  1. I'm not sure how else you would phrase this in a way to ALLOW Go's handling of duration and also allow parsing units in the future to become required (post-GA). If you have a recommendation for how we allow this change to occur post-GA, let us know. Currently, I think having _MILLIS in env names actually prevents this format from being a good idea post-GA so at a minimum I'd like to remove that from the ENV variable.
  2. I think it's on the maintainers of those langauge maintainers to PUNT the request or ask community for PRs. i.e. This spec change is intended to NOT force languages to implement parsers, but allow them to come post GA, but will need discipline from maintainers to focus on more important issues.
  3. I'm more than happy to contribute parsers for this to languages which need it, feel free to assign it to me. Anything I can do to help maintainers focus on stable metrics :)

@bogdandrutu
Copy link
Member

@jsuereth looks like you requested changes, is there any concrete issue/reason that we need to solve?

@jsuereth
Copy link
Contributor

@bogdandrutu Yeah, here's the quote:

FYI - I didn't notice you already had this PR. I described this a bit differently: https://github.com/open-telemetry/opentelemetry-specification/compare/master...jsuereth:wip-duration-defaults?expand=1

I think your specification is a lot smaller, but is missing the bit about PositiveInteger, i.e. I think we also need to limit the numeric value so it's reasonable to contribute a parser in all languages.

Suggested change:

Any value that represents a duration, for example a timeout, MUST interpret a purely positive integer value as a number of milliseconds. Formatted strings with a positive integer followed immediately by a unit string MAY be interpreted for the following units:

@carlosalberto
Copy link
Contributor

I think your specification is a lot smaller, but is missing the bit about PositiveInteger, i.e. I think we also need to limit the numeric value so it's reasonable to contribute a parser in all languages.

Based on the comments from @jkwatson and @yurishkuro (and how, even if such parsers are contributed anytime soon, this could add required cycles to the SIGs), I still think the best option is to:

  1. Remove the _MILLIS prefix and define the expected/recommended value range, all in MS by default (as part of this issue/related PR).
  2. Depending on the parser effort in the main SIGs, adopt the actual parsing of values (in a different issue marked as Allowed-for-GA, which means that it could still happen before Tracing goes stable - else, have it after the release).

@anuraaga
Copy link
Contributor Author

@jsuereth Sorry for missing the comment about positive numbers! Will address

@carlosalberto So do you want to leave out discussion of duration units in this PR? What happens if different languages end up with different units? Maybe a low enough probability not to matter though.

@carlosalberto
Copy link
Contributor

So do you want to leave out discussion of duration units in this PR?

Not quite, but have milliseconds being the default. IIRC the parsers @jsuereth mentioned take milliseconds as the default, unless I'm wrong?

@jsuereth
Copy link
Contributor

@carlosalberto The parser I contributed to Java (and plan for other languages) takes milliseconds as the default.

I think your plan for "allow-for-GA" with specific changes is exactly in line with what I was hoping to accomplish!

Parsers can be added when it makes sense to do so.

@anuraaga
Copy link
Contributor Author

@carlosalberto Ah ok - I just added the note about negative numbers not being supported. I think my wording of MUST vs MAY captured the aspect of the default being numeric milis, let me know if this is still missing anything.

@carlosalberto
Copy link
Contributor

Based on the discussion we had today at the Spec call, we decided to go with:

  1. Remove _MILLIS for all related environment variables and have milliseconds as the actual default unit.
  2. Fill a follow-up issue (allowed for GA) to have the duration unit parsing in place. We will merge this as soon as the main SIGs have support in place. See Add duration unit parsing for environment variables #1351

@anuraaga Please amend appropriately ;)

@anuraaga anuraaga changed the title Remove MILLIS from BatchSpanProcessor variables and allow support for… Remove MILLIS from BatchSpanProcessor variables and define semantics for... Jan 20, 2021
@anuraaga
Copy link
Contributor Author

@carlosalberto Ok updated to only talk about the number.

@carlosalberto
Copy link
Contributor

@anuraaga Thanks for the update!

@open-telemetry/specs-approvers please review/approve ;)

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Copy link
Contributor

@tedsuo tedsuo left a comment

Choose a reason for hiding this comment

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

LGTM. Appreciate the simplification and, dare I say it, standardization.

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.

OTLP Exporter timeout env var not consistent with batch span processor
9 participants