-
Notifications
You must be signed in to change notification settings - Fork 896
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
Clarify boundaries of numeric env vars #4331
base: main
Are you sure you want to change the base?
Changes from all commits
143a790
291ec6b
e2df979
c3a0b21
55d2972
d064caa
970b693
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ aliases: | |
* [Numeric](#numeric) | ||
+ [Integer](#integer) | ||
+ [Duration](#duration) | ||
- [Timeout](#timeout) | ||
* [String](#string) | ||
+ [Enum](#enum) | ||
- [General SDK Configuration](#general-sdk-configuration) | ||
|
@@ -82,6 +83,7 @@ Variables accepting numeric values are sub-classified into: | |
|
||
* [Integer](#integer) | ||
* [Duration](#duration) | ||
* [Timeout](#duration) | ||
|
||
The following guidance applies to all numeric types. | ||
|
||
|
@@ -115,13 +117,23 @@ Individual SDKs MAY choose to support a larger range of values. | |
|
||
#### Duration | ||
|
||
Any value that represents a duration, for example a timeout, MUST be an integer | ||
representing a number of milliseconds. The value is non-negative - if a negative | ||
value is provided, the implementation MUST generate a warning, gracefully ignore | ||
the setting and use the default value if it is defined. | ||
Any value that represents a duration MUST be an integer representing a number of | ||
milliseconds. The value is non-negative - if a negative value is provided, the | ||
implementation MUST generate a warning, gracefully ignore the setting and use | ||
the default value if it is defined. | ||
|
||
For example, the value `12000` indicates 12000 milliseconds, i.e., 12 seconds. | ||
|
||
##### Timeout | ||
|
||
Timeout is a sub-classification of [duration](#duration): All timeouts are also | ||
durations, but not all durations are timeouts. | ||
|
||
For variables that represent a timeout (e.g. exporter timeout), implementations | ||
jack-berg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
SHOULD interpret a value of zero as indefinite. In practice, implementations MAY | ||
treat indefinite as "a very long time" and substitute a very large duration ( | ||
e.g. the maximum milliseconds representable by a 32-bit integer). | ||
|
||
### String | ||
|
||
String values are sub-classified into: | ||
|
@@ -188,21 +200,21 @@ Depending on the value of `OTEL_TRACES_SAMPLER`, `OTEL_TRACES_SAMPLER_ARG` may b | |
|
||
## Batch Span Processor | ||
|
||
| Name | Description | Default | Type | Notes | | ||
|--------------------------------|------------------------------------------------------------------|---------|--------------|-------------------------------------------------------| | ||
| OTEL_BSP_SCHEDULE_DELAY | Delay interval (in milliseconds) between two consecutive exports | 5000 | [Duration][] | | | ||
| OTEL_BSP_EXPORT_TIMEOUT | Maximum allowed time (in milliseconds) to export data | 30000 | [Duration][] | | | ||
| OTEL_BSP_MAX_QUEUE_SIZE | Maximum queue size | 2048 | [Integer][] | | | ||
| OTEL_BSP_MAX_EXPORT_BATCH_SIZE | Maximum batch size | 512 | [Integer][] | Must be less than or equal to OTEL_BSP_MAX_QUEUE_SIZE | | ||
| Name | Description | Default | Type | Notes | | ||
|--------------------------------|------------------------------------------------------------------|---------|--------------|-----------------------------------------------------------------------------------| | ||
| OTEL_BSP_SCHEDULE_DELAY | Delay interval (in milliseconds) between two consecutive exports | 5000 | [Duration][] | | | ||
| OTEL_BSP_EXPORT_TIMEOUT | Maximum allowed time (in milliseconds) to export data | 30000 | [Timeout][] | | | ||
| OTEL_BSP_MAX_QUEUE_SIZE | Maximum queue size | 2048 | [Integer][] | Valid values are positive. | | ||
| OTEL_BSP_MAX_EXPORT_BATCH_SIZE | Maximum batch size | 512 | [Integer][] | Must be less than or equal to OTEL_BSP_MAX_QUEUE_SIZE. Valid values are positive. | | ||
|
||
## Batch LogRecord Processor | ||
|
||
| Name | Description | Default | Type | Notes | | ||
|---------------------------------|------------------------------------------------------------------|---------|--------------|--------------------------------------------------------| | ||
| OTEL_BLRP_SCHEDULE_DELAY | Delay interval (in milliseconds) between two consecutive exports | 1000 | [Duration][] | | | ||
| OTEL_BLRP_EXPORT_TIMEOUT | Maximum allowed time (in milliseconds) to export data | 30000 | [Duration][] | | | ||
| OTEL_BLRP_MAX_QUEUE_SIZE | Maximum queue size | 2048 | [Integer][] | | | ||
| OTEL_BLRP_MAX_EXPORT_BATCH_SIZE | Maximum batch size | 512 | [Integer][] | Must be less than or equal to OTEL_BLRP_MAX_QUEUE_SIZE | | ||
| Name | Description | Default | Type | Notes | | ||
|---------------------------------|------------------------------------------------------------------|---------|--------------|------------------------------------------------------------------------------------| | ||
| OTEL_BLRP_SCHEDULE_DELAY | Delay interval (in milliseconds) between two consecutive exports | 1000 | [Duration][] | | | ||
| OTEL_BLRP_EXPORT_TIMEOUT | Maximum allowed time (in milliseconds) to export data | 30000 | [Timeout][] | | | ||
| OTEL_BLRP_MAX_QUEUE_SIZE | Maximum queue size | 2048 | [Integer][] | Valid values are positive. | | ||
| OTEL_BLRP_MAX_EXPORT_BATCH_SIZE | Maximum batch size | 512 | [Integer][] | Must be less than or equal to OTEL_BLRP_MAX_QUEUE_SIZE. Valid values are positive. | | ||
|
||
## Attribute Limits | ||
|
||
|
@@ -211,32 +223,32 @@ which that SDK implements truncation mechanism. | |
|
||
See the SDK [Attribute Limits](../common/README.md#attribute-limits) section for the definition of the limits. | ||
|
||
| Name | Description | Default | Type | | ||
|-----------------------------------|--------------------------------------|----------|-------------| | ||
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | Maximum allowed attribute value size | no limit | [Integer][] | | ||
| OTEL_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute count | 128 | [Integer][] | | ||
| Name | Description | Default | Type | Notes | | ||
|-----------------------------------|--------------------------------------|----------|-------------|--------------------------------| | ||
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | Maximum allowed attribute value size | no limit | [Integer][] | Valid values are non-negative. | | ||
| OTEL_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute count | 128 | [Integer][] | Valid values are non-negative. | | ||
|
||
## Span Limits | ||
|
||
See the SDK [Span Limits](../trace/sdk.md#span-limits) section for the definition of the limits. | ||
|
||
| Name | Description | Default | Type | | ||
|----------------------------------------|------------------------------------------------|----------|-------------| | ||
| OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT | Maximum allowed attribute value size | no limit | [Integer][] | | ||
| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | Maximum allowed span attribute count | 128 | [Integer][] | | ||
| OTEL_SPAN_EVENT_COUNT_LIMIT | Maximum allowed span event count | 128 | [Integer][] | | ||
| OTEL_SPAN_LINK_COUNT_LIMIT | Maximum allowed span link count | 128 | [Integer][] | | ||
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute per span event count | 128 | [Integer][] | | ||
| OTEL_LINK_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute per span link count | 128 | [Integer][] | | ||
| Name | Description | Default | Type | Notes | | ||
|----------------------------------------|------------------------------------------------|----------|-------------|--------------------------------| | ||
| OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT | Maximum allowed attribute value size | no limit | [Integer][] | Valid values are non-negative. | | ||
| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | Maximum allowed span attribute count | 128 | [Integer][] | Valid values are non-negative. | | ||
| OTEL_SPAN_EVENT_COUNT_LIMIT | Maximum allowed span event count | 128 | [Integer][] | Valid values are non-negative. | | ||
| OTEL_SPAN_LINK_COUNT_LIMIT | Maximum allowed span link count | 128 | [Integer][] | Valid values are non-negative. | | ||
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute per span event count | 128 | [Integer][] | Valid values are non-negative. | | ||
| OTEL_LINK_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute per span link count | 128 | [Integer][] | Valid values are non-negative. | | ||
Comment on lines
+237
to
+242
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we say anything useful about the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The zero value is valid here. Are you suggesting a change in semantics or improved phrasing to make it more clear that zero is valid? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, I wasn't sure if but re-reading it seems that none is the obvious interpretation and may not need clarification sort of related, it's a bit odd that the default value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't disagree - but I'm reluctant to try to tackle that in this PR 😛. A user can use effectively express the default config with something like the max value of a 32 bit integer (2,147,483,647). Obviously its a lot more cumbersome than -1. |
||
|
||
## LogRecord Limits | ||
|
||
See the SDK [LogRecord Limits](../logs/sdk.md#logrecord-limits) section for the definition of the limits. | ||
|
||
| Name | Description | Default | Type | | ||
|---------------------------------------------|--------------------------------------------|----------|-------------| | ||
| OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT | Maximum allowed attribute value size | no limit | [Integer][] | | ||
| OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT | Maximum allowed log record attribute count | 128 | [Integer][] | | ||
| Name | Description | Default | Type | Notes | | ||
|---------------------------------------------|--------------------------------------------|----------|-------------|--------------------------------| | ||
| OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT | Maximum allowed attribute value size | no limit | [Integer][] | Valid values are non-negative. | | ||
| OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT | Maximum allowed log record attribute count | 128 | [Integer][] | Valid values are non-negative. | | ||
|
||
## OTLP Exporter | ||
|
||
|
@@ -247,7 +259,7 @@ See [OpenTelemetry Protocol Exporter Configuration Options](../protocol/exporter | |
| Name | Description | Default | Type | | ||
|-------------------------------|------------------------------------------------------------------------------------|--------------------------------------|-------------| | ||
| OTEL_EXPORTER_ZIPKIN_ENDPOINT | Endpoint for Zipkin traces | `http://localhost:9411/api/v2/spans` | [String][] | | ||
| OTEL_EXPORTER_ZIPKIN_TIMEOUT | Maximum time (in milliseconds) the Zipkin exporter will wait for each batch export | 10000 | [Integer][] | | ||
| OTEL_EXPORTER_ZIPKIN_TIMEOUT | Maximum time (in milliseconds) the Zipkin exporter will wait for each batch export | 10000 | [Timeout][] | | ||
|
||
Additionally, the following environment variables are reserved for future | ||
usage in Zipkin Exporter configuration: | ||
|
@@ -327,9 +339,9 @@ Additional known values for `OTEL_LOGS_EXPORTER` are: | |
|
||
### Exemplar | ||
|
||
| Name | Description | Default | Type | Notes | | ||
|--------------------------------|-----------------------------------------------------|-----------------|----------|-------| | ||
| `OTEL_METRICS_EXEMPLAR_FILTER` | Filter for which measurements can become Exemplars. | `"trace_based"` | [Enum][] | | | ||
| Name | Description | Default | Type | | ||
|--------------------------------|-----------------------------------------------------|-----------------|----------| | ||
| `OTEL_METRICS_EXEMPLAR_FILTER` | Filter for which measurements can become Exemplars. | `"trace_based"` | [Enum][] | | ||
|
||
Known values for `OTEL_METRICS_EXEMPLAR_FILTER` are: | ||
|
||
|
@@ -342,10 +354,10 @@ Known values for `OTEL_METRICS_EXEMPLAR_FILTER` are: | |
Environment variables specific for the push metrics exporters (OTLP, stdout, in-memory) | ||
that use [periodic exporting MetricReader](../metrics/sdk.md#periodic-exporting-metricreader). | ||
|
||
| Name | Description | Default | Type | Notes | | ||
|-------------------------------|-------------------------------------------------------------------------------|---------|--------------|-------| | ||
| `OTEL_METRIC_EXPORT_INTERVAL` | The time interval (in milliseconds) between the start of two export attempts. | 60000 | [Duration][] | | | ||
| `OTEL_METRIC_EXPORT_TIMEOUT` | Maximum allowed time (in milliseconds) to export data. | 30000 | [Duration][] | | | ||
| Name | Description | Default | Type | | ||
|-------------------------------|-------------------------------------------------------------------------------|---------|--------------| | ||
| `OTEL_METRIC_EXPORT_INTERVAL` | The time interval (in milliseconds) between the start of two export attempts. | 60000 | [Duration][] | | ||
| `OTEL_METRIC_EXPORT_TIMEOUT` | Maximum allowed time (in milliseconds) to export data. | 30000 | [Timeout][] | | ||
|
||
## Declarative configuration | ||
|
||
|
@@ -399,5 +411,6 @@ OTEL_{LANGUAGE}_{FEATURE} | |
[Float]: #float | ||
[Integer]: #integer | ||
[Duration]: #duration | ||
[Timeout]: #timeout | ||
[String]: #string | ||
[Enum]: #enum |
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.
is this important? I ask because it seems that
0
duration is defined as zero milliseconds, and so it's hard for me to think of timeouts as a "subclass" of duration since they don't have that behaviorThere 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.
From duration we get:
From timeout's perspective, the useful bits which are inherited are:
You make a good point that the zero value semantics are different for duration and timeout. We could keep it as is, where timeout essentially overrides the duration zero value semantics. Copy the bits of duration semantics we care about into timeout.
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.
this would make sense to me if the timeout restricted ("narrowed") the behavior of its "super type", but that's not the case here, so it doesn't seem like a duration in my mind (a timeout can't be used in places where a duration would be used). probably I'm thinking too much OOP