-
Notifications
You must be signed in to change notification settings - Fork 895
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
Remove MILLIS from BatchSpanProcessor variables and define semantics for... #1325
Conversation
b9b7e5e
to
6d82f8c
Compare
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
… SDKs to parse duration strings.
6d82f8c
to
4d7293d
Compare
|
||
### Duration | ||
|
||
Any value that represents a duration, for example a timeout, MUST interpret a purely numeric value as a number of |
There was a problem hiding this comment.
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:
There was a problem hiding this comment.
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 :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the concern.
- 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. - 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.
- 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 :)
@jsuereth looks like you requested changes, is there any concrete issue/reason that we need to solve? |
@bogdandrutu Yeah, here's the quote:
|
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:
|
@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. |
Not quite, but have milliseconds being the default. IIRC the parsers @jsuereth mentioned take milliseconds as the default, unless I'm wrong? |
@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. |
@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. |
Based on the discussion we had today at the Spec call, we decided to go with:
@anuraaga Please amend appropriately ;) |
@carlosalberto Ok updated to only talk about the number. |
@anuraaga Thanks for the update! @open-telemetry/specs-approvers please review/approve ;) |
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
There was a problem hiding this 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.
… duration values.
Fixes #1312
Changes
Removes MILLIS from BatchSpanProcessor time variables in favor of defining durations to always be interpreted as milliseconds.