From c8b13aba7e12cecf5c9c09ca8d6add45bf8ddd93 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Sat, 12 Sep 2020 22:36:40 -0700 Subject: [PATCH 01/15] SDK Trace: Adding span collection limits Fixes #182 To help safeguard against a common error, adding default limits to the number of events per span in the SDK. --- spec-compliance-matrix.md | 4 ++++ specification/trace/sdk.md | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 1cb5d4dd5b9..776feaf7288 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -14,6 +14,8 @@ status of the feature is not known. |[TracerProvider](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracerprovider-operations)| |Create TracerProvider | + | + | + | + | + | + | + | + | + | + | |Get a Tracer | + | + | + | + | + | + | + | + | + | + | +|Set a collection limit | | | | | | | | | | | +|Get a collection limit | | | | | | | | | | | |Safe for concurrent calls | + | + | + | | + | + | + | + | + | + | |[Tracer](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracer-operations)| |Create a new Span | + | + | + | + | + | + | + | + | + | + | @@ -37,6 +39,8 @@ status of the feature is not known. |IsRecording | + | + | + | + | + | + | + | | + | + | |Set status | + | + | + | + | + | + | + | + | + | + | |Safe for concurrent calls | + | + | + | | + | + | + | + | + | + | +|Set a collection limit | | | | | | | | | | | +|Discard events greater than collection limit | | | | | | | | | | | |[Span attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-attributes)| |SetAttribute | + | + | + | + | + | + | + | + | + | + | |Set order preserved | + | - | + | + | + | + | + | + | + | + | diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 45996d19020..7ba089c2168 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -236,7 +236,27 @@ Thus, the SDK specification defines sets of possible requirements for that the [span creation API](api.md#span-creation) returned (or will return) to the user (for example, the `Span` could be one of the parameters passed to such a function, or a getter could be provided). - + +## Span Event Limits + +Erroneous code can add unintended events to a span. If these containers are +unbounded, they can quickly exhaust available memory, resulting in crashes that +are difficult to recover from safely. + +To protect against such errors, SDK Spans MUST discard attributes, links, and +events that would increase the size of each collection beyond a limit configured +in the `TracerProvider`, or for the span specifically. + +There MUST be a log message emitted by the SDK for each object discarded. + +The following interfaces MUST exist: + +- `TracerProvider`: a method to set a maximum collection size +- `TracerProvider`: a method to retrieve the maximum collection size +- `Span`: a method to set a maximum collection size for the span + +The default for this limit SHOULD be 1000. A value of 0 indicates no limit. + ## Span processor Span processor is an interface which allows hooks for span start and end method From 89dc5b51f5b9d47c8214b8b16aa15c8d77f13498 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Sat, 12 Sep 2020 22:50:38 -0700 Subject: [PATCH 02/15] Adding to the changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d96cd1ef85..93e3c68f2e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ New: ([#697](https://github.com/open-telemetry/opentelemetry-specification/pull/697)) * API was extended to allow adding arbitrary event attributes ([#874](https://github.com/open-telemetry/opentelemetry-specification/pull/874)) * `exception.escaped` was added ([#784](https://github.com/open-telemetry/opentelemetry-specification/pull/784)) +- Add default limits to the number of events in SDK Spans + ([#942](https://github.com/open-telemetry/opentelemetry-specification/pull/942)) Updates: From 73803aacaac0c21a5a481496f25c7dd0c6b41d0e Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Sun, 13 Sep 2020 21:44:49 -0700 Subject: [PATCH 03/15] Addressing feedback Adding optional additional configurations for span limits. Modifying the unmlimited value to -1 to enable restricting collections to 0 elements. --- specification/trace/sdk.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 7ba089c2168..d753e3239e7 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -255,7 +255,11 @@ The following interfaces MUST exist: - `TracerProvider`: a method to retrieve the maximum collection size - `Span`: a method to set a maximum collection size for the span -The default for this limit SHOULD be 1000. A value of 0 indicates no limit. +Implementations MAY additionally have configuration for limits on each +collection, which would take precedence over the general collection limit. + +The default for this limit SHOULD be 1000. A value of -1 indicates no limit, +while a value of 0 would result in no events being collected. ## Span processor From c7ff3ca527894f25ae7a519448bfa91777a7b18e Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Wed, 16 Sep 2020 07:56:17 -0700 Subject: [PATCH 04/15] Addressing feedback - modifying logging messaging to SHOULD, to imply configurability - clarifying collections types rather than using "each" --- specification/trace/sdk.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index d753e3239e7..29b2fd6f297 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -7,6 +7,7 @@ * [Sampling](#sampling) * [Tracer Creation](#tracer-creation) * [Additional Span Interfaces](#additional-span-interfaces) +* [Limits on Span Collections](#limits-on-span-collections) * [Span Processor](#span-processor) * [Span Exporter](#span-exporter) @@ -215,7 +216,7 @@ Thus, the SDK specification defines sets of possible requirements for It must also be able to reliably determine whether the Span has ended (some languages might implement this by having an end timestamp of `null`, others might have an explicit `hasEnded` boolean). - + A function receiving this as argument might not be able to modify the Span. Note: Typically this will be implemented with a new interface or @@ -237,30 +238,33 @@ Thus, the SDK specification defines sets of possible requirements for (for example, the `Span` could be one of the parameters passed to such a function, or a getter could be provided). -## Span Event Limits +## Limits on Span Collections -Erroneous code can add unintended events to a span. If these containers are -unbounded, they can quickly exhaust available memory, resulting in crashes that -are difficult to recover from safely. +Erroneous code can add unintended attributes, events, and links to a span. If +these collections are unbounded, they can quickly exhaust available memory, +resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MUST discard attributes, links, and events that would increase the size of each collection beyond a limit configured in the `TracerProvider`, or for the span specifically. -There MUST be a log message emitted by the SDK for each object discarded. +There SHOULD be a log message emitted by the SDK for the first time a span has +discarded a span due to a limit. This message should be emitted once for +attributes, events, and links, and MUST be configurable on or off, with +a default of on. The following interfaces MUST exist: - `TracerProvider`: a method to set a maximum collection size - `TracerProvider`: a method to retrieve the maximum collection size -- `Span`: a method to set a maximum collection size for the span - -Implementations MAY additionally have configuration for limits on each -collection, which would take precedence over the general collection limit. The default for this limit SHOULD be 1000. A value of -1 indicates no limit, while a value of 0 would result in no events being collected. +Implementations MAY also enable configuration for the maximum size of individual +collections: attributes, events, and links. These limits would take precedence +over the general collection limit. + ## Span processor Span processor is an interface which allows hooks for span start and end method From f9d32044b4f6c69418a814f968c31ac0686d3ee9 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Wed, 16 Sep 2020 20:55:05 -0700 Subject: [PATCH 05/15] Update specification/trace/sdk.md Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- specification/trace/sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 29b2fd6f297..f2632ac31ae 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -248,8 +248,8 @@ To protect against such errors, SDK Spans MUST discard attributes, links, and events that would increase the size of each collection beyond a limit configured in the `TracerProvider`, or for the span specifically. -There SHOULD be a log message emitted by the SDK for the first time a span has -discarded a span due to a limit. This message should be emitted once for +There SHOULD be a log message emitted by the SDK for the first time a span is +discarded due to a limit. This message should be emitted once for attributes, events, and links, and MUST be configurable on or off, with a default of on. From afb4b4d96e6fccc87378baa6c30dfc17f00e342e Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Wed, 16 Sep 2020 21:11:16 -0700 Subject: [PATCH 06/15] Clarifying limits are in elements, not bytes Ensuring there is no ambiguation between limits being in bytes, or numbers of elements in a collection. --- specification/trace/sdk.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index f2632ac31ae..f5fb5ce1dbd 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -245,8 +245,8 @@ these collections are unbounded, they can quickly exhaust available memory, resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MUST discard attributes, links, and -events that would increase the size of each collection beyond a limit configured -in the `TracerProvider`, or for the span specifically. +events that would increase the number of elements of each collection beyond a +limit configured in the `TracerProvider`. There SHOULD be a log message emitted by the SDK for the first time a span is discarded due to a limit. This message should be emitted once for @@ -255,15 +255,15 @@ a default of on. The following interfaces MUST exist: -- `TracerProvider`: a method to set a maximum collection size -- `TracerProvider`: a method to retrieve the maximum collection size +- `TracerProvider`: a method to set a maximum collection count +- `TracerProvider`: a method to retrieve the maximum collection count -The default for this limit SHOULD be 1000. A value of -1 indicates no limit, -while a value of 0 would result in no events being collected. +The default for this limit SHOULD be 1000 elements. A value of -1 indicates no +limit, while a value of 0 would result in no events being collected. -Implementations MAY also enable configuration for the maximum size of individual -collections: attributes, events, and links. These limits would take precedence -over the general collection limit. +Implementations MAY also enable configuration for the maximum element count of +individual collections: attributes, events, and links. These limits would take +precedence over the general collection limit. ## Span processor From 204c1a13061bfa9e1c35c36daf5a3ae5d04c19d0 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Fri, 25 Sep 2020 22:23:05 -0700 Subject: [PATCH 07/15] Removing customizable span collection limit Addressing feedback arguing for a non-configurable limit, as is the case with other limits present in OpenTelemetry. --- CHANGELOG.md | 2 +- spec-compliance-matrix.md | 3 --- specification/trace/sdk.md | 16 ++-------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93e3c68f2e0..78fadb23fbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ New: ([#697](https://github.com/open-telemetry/opentelemetry-specification/pull/697)) * API was extended to allow adding arbitrary event attributes ([#874](https://github.com/open-telemetry/opentelemetry-specification/pull/874)) * `exception.escaped` was added ([#784](https://github.com/open-telemetry/opentelemetry-specification/pull/784)) -- Add default limits to the number of events in SDK Spans +- Add limits to the number of attributes, events, and links in SDK Spans ([#942](https://github.com/open-telemetry/opentelemetry-specification/pull/942)) Updates: diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 776feaf7288..b2ccab9c23e 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -14,8 +14,6 @@ status of the feature is not known. |[TracerProvider](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracerprovider-operations)| |Create TracerProvider | + | + | + | + | + | + | + | + | + | + | |Get a Tracer | + | + | + | + | + | + | + | + | + | + | -|Set a collection limit | | | | | | | | | | | -|Get a collection limit | | | | | | | | | | | |Safe for concurrent calls | + | + | + | | + | + | + | + | + | + | |[Tracer](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracer-operations)| |Create a new Span | + | + | + | + | + | + | + | + | + | + | @@ -39,7 +37,6 @@ status of the feature is not known. |IsRecording | + | + | + | + | + | + | + | | + | + | |Set status | + | + | + | + | + | + | + | + | + | + | |Safe for concurrent calls | + | + | + | | + | + | + | + | + | + | -|Set a collection limit | | | | | | | | | | | |Discard events greater than collection limit | | | | | | | | | | | |[Span attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-attributes)| |SetAttribute | + | + | + | + | + | + | + | + | + | + | diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index f5fb5ce1dbd..0857d2ad5d6 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -245,26 +245,14 @@ these collections are unbounded, they can quickly exhaust available memory, resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MUST discard attributes, links, and -events that would increase the number of elements of each collection beyond a -limit configured in the `TracerProvider`. +events that would increase the number of elements of each collection beyond +1000. There SHOULD be a log message emitted by the SDK for the first time a span is discarded due to a limit. This message should be emitted once for attributes, events, and links, and MUST be configurable on or off, with a default of on. -The following interfaces MUST exist: - -- `TracerProvider`: a method to set a maximum collection count -- `TracerProvider`: a method to retrieve the maximum collection count - -The default for this limit SHOULD be 1000 elements. A value of -1 indicates no -limit, while a value of 0 would result in no events being collected. - -Implementations MAY also enable configuration for the maximum element count of -individual collections: attributes, events, and links. These limits would take -precedence over the general collection limit. - ## Span processor Span processor is an interface which allows hooks for span start and end method From e55234b0e50b0d49b11f8998261650f496088f3c Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Fri, 25 Sep 2020 22:40:11 -0700 Subject: [PATCH 08/15] fixing lint --- specification/trace/sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index d5a5720d5b7..c83ed21e785 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -36,7 +36,7 @@ The OpenTelemetry API has two properties responsible for the data collection: specification](https://www.w3.org/TR/trace-context/#sampled-flag). This flag indicates that the `Span` has been `sampled` and will be exported. [Span Exporters](#span-exporter) MUST receive those spans which have `Sampled` flag set to true and they SHOULD NOT receive the ones - that do not. + that do not. The flag combination `SampledFlag == false` and `IsRecording == true` means that the current `Span` does record information, but most likely the child @@ -250,7 +250,7 @@ these collections are unbounded, they can quickly exhaust available memory, resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MUST discard attributes, links, and -events that would increase the number of elements of each collection beyond +events that would increase the number of elements of each collection beyond 1000. There SHOULD be a log message emitted by the SDK for the first time a span is From 3366d1feae1babdcdb1a9d48b2e0cbd61aa5ff8e Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Mon, 28 Sep 2020 10:54:53 -0700 Subject: [PATCH 09/15] Update specification/trace/sdk.md Co-authored-by: Nikita Salnikov-Tarnovski --- specification/trace/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index c83ed21e785..fad36331414 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -251,7 +251,7 @@ resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MUST discard attributes, links, and events that would increase the number of elements of each collection beyond -1000. +1000. SDKs MAY provide a way to change this limit. There SHOULD be a log message emitted by the SDK for the first time a span is discarded due to a limit. This message should be emitted once for From dbc18fde13951a9a9889b39c272b6fe14890b315 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Mon, 28 Sep 2020 22:05:28 -0700 Subject: [PATCH 10/15] Update specification/trace/sdk.md Co-authored-by: Sergey Kanzhelev --- specification/trace/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index fad36331414..c930ebe960d 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -251,7 +251,7 @@ resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MUST discard attributes, links, and events that would increase the number of elements of each collection beyond -1000. SDKs MAY provide a way to change this limit. +the recommended limit of 1000 elements. SDKs MAY provide a way to change this limit. There SHOULD be a log message emitted by the SDK for the first time a span is discarded due to a limit. This message should be emitted once for From 54ff69574bc961b6356872ff546a647e8777a034 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Mon, 28 Sep 2020 22:05:58 -0700 Subject: [PATCH 11/15] adding collection limits for attributes, links Adding collection limits for spans in the compliance matrix for attributes and links as well as events. --- spec-compliance-matrix.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 15f12fbc614..7705edd43d5 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -40,7 +40,9 @@ status of the feature is not known. |IsRecording | + | + | + | + | + | + | + | | + | + | |Set status | + | + | + | + | + | + | + | + | + | + | |Safe for concurrent calls | + | + | + | | + | + | + | + | + | + | -|Discard events greater than collection limit | | | | | | | | | | | +|events collection size limit | | | | | | | | | | | +|attribute collection size limit | | | | | | | | | | | +|links collection size limit | | | | | | | | | | | |[Span attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-attributes)| |SetAttribute | + | + | + | + | + | + | + | + | + | + | |Set order preserved | + | - | + | + | + | + | + | + | + | + | From 3a1eca3b867a73a10d7a5b31e56c07cc0407d732 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 6 Oct 2020 06:09:14 -0700 Subject: [PATCH 12/15] Making collection limits optional Addressing feedback to make collection limits optional for now. The motivation is to allow innovation around safe SDK behavior, while providing a guideline and awareness for the issue. Reducing the logging on discarded attributes, events, or links to once per process to further reduce spam. --- spec-compliance-matrix.md | 3 --- specification/sdk-environment-variables.md | 8 ++++++++ specification/trace/sdk.md | 13 ++++++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index d09276dd717..e5e2be8d8dd 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -40,9 +40,6 @@ status of the feature is not known. |IsRecording | + | + | + | + | + | + | + | | + | + | |Set status | + | + | + | + | + | + | + | + | + | + | |Safe for concurrent calls | + | + | + | [-](https://github.com/open-telemetry/opentelemetry-python/issues/1157) | + | + | + | + | + | + | -|events collection size limit | | | | | | | | | | | -|attribute collection size limit | | | | | | | | | | | -|links collection size limit | | | | | | | | | | | |[Span attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-attributes)| |SetAttribute | + | + | + | + | + | + | + | + | + | + | |Set order preserved | + | - | + | + | + | + | + | + | + | + | diff --git a/specification/sdk-environment-variables.md b/specification/sdk-environment-variables.md index 3671f6f3d7e..64c72765d37 100644 --- a/specification/sdk-environment-variables.md +++ b/specification/sdk-environment-variables.md @@ -22,6 +22,14 @@ Additional values can be specified in the respective SDK's documentation, in cas | OTEL_BSP_MAX_QUEUE_SIZE | Maximum queue size | 2048 | | | OTEL_BSP_MAX_EXPORT_BATCH_SIZE | Maximum batch size | 512 | Must be less than or equal to OTEL_BSP_MAX_QUEUE_SIZE | +## Span Collection Limits + +| Name | Description | Default | Notes | +| ------------------------------- | ------------------------------------ | ------- | ----- | +| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | Maximum allowed span attribute count | 1000 | | +| OTEL_SPAN_EVENT_COUNT_LIMIT | Maximum allowed span event count | 1000 | | +| OTEL_SPAN_LINK_COUNT_LIMIT | Maximum allowed span link count | 1000 | | + ## OTLP Exporter See [OpenTelemetry Protocol Exporter Configuration Options](./protocol/exporter.md). diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 97c6a58f7c6..c239869184e 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -249,13 +249,16 @@ Erroneous code can add unintended attributes, events, and links to a span. If these collections are unbounded, they can quickly exhaust available memory, resulting in crashes that are difficult to recover from safely. -To protect against such errors, SDK Spans MUST discard attributes, links, and +To protect against such errors, SDK Spans MAY discard attributes, links, and events that would increase the number of elements of each collection beyond -the recommended limit of 1000 elements. SDKs MAY provide a way to change this limit. +the recommended limit of 1000 elements. SDKs MAY provide a way to change this limit, -There SHOULD be a log message emitted by the SDK for the first time a span is -discarded due to a limit. This message should be emitted once for -attributes, events, and links, and MUST be configurable on or off, with +If there is a configurable limit, the SDK MAY honor the environment variables +specified in [SDK environment variables](../sdk-environment-variables.md#span-collection-limits). + +There SHOULD be a log message emitted by the SDK the first time per process where +a span attribute, event, or link is discarded due to a limit. This message should be +once per attributes, events, and links, and MUST be configurable on or off, with a default of on. ## Span processor From 7f8d849f067f1ac084c747ebc2814bd877af0573 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 6 Oct 2020 06:14:38 -0700 Subject: [PATCH 13/15] Updating log recommendations. Giving the SDK implementors more freedom in how they choose to log, while setting guidelines on the frequency. --- specification/trace/sdk.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index c239869184e..725a53a0d40 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -256,10 +256,9 @@ the recommended limit of 1000 elements. SDKs MAY provide a way to change this li If there is a configurable limit, the SDK MAY honor the environment variables specified in [SDK environment variables](../sdk-environment-variables.md#span-collection-limits). -There SHOULD be a log message emitted by the SDK the first time per process where -a span attribute, event, or link is discarded due to a limit. This message should be -once per attributes, events, and links, and MUST be configurable on or off, with -a default of on. +There SHOULD be a log emitted to indicate to the user that an attribute, event, +or link was discarded due to such a limit. To prevent excessive logging, the log +should not be emitted once per span, or per discarded attribute, event, or links. ## Span processor From a351e1f20f5642e48ab51f8ea52a3033b95c05af Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 6 Oct 2020 20:58:36 -0700 Subject: [PATCH 14/15] adding back limits to spec-compliance-matrix To help make consumers aware of which SDKS implement span collection limits. --- spec-compliance-matrix.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index e5e2be8d8dd..dcd31725728 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -40,6 +40,9 @@ status of the feature is not known. |IsRecording | + | + | + | + | + | + | + | | + | + | |Set status | + | + | + | + | + | + | + | + | + | + | |Safe for concurrent calls | + | + | + | [-](https://github.com/open-telemetry/opentelemetry-python/issues/1157) | + | + | + | + | + | + | +|events collection size limit | | | | | | | | | | | +|attribute collection size limit | | | | | | | | | | | +|links collection size limit | | | | | | | | | | | |[Span attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-attributes)| |SetAttribute | + | + | + | + | + | + | + | + | + | + | |Set order preserved | + | - | + | + | + | + | + | + | + | + | @@ -124,6 +127,9 @@ status of the feature is not known. |OTEL_EXPORTER_JAEGER_* | | | | [-](https://github.com/open-telemetry/opentelemetry-python/issues/1056) | + | - | - | | - | - | |OTEL_EXPORTER_ZIPKIN_* | | | | + | | - | - | | - | - | |OTEL_EXPORTER | | | | [-](https://github.com/open-telemetry/opentelemetry-python/issues/1155) | | | | | | | +|OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | | | | | | | | | | | +|OTEL_SPAN_EVENT_COUNT_LIMIT | | | | | | | | | | | +|OTEL_SPAN_LINK_COUNT_LIMIT | | | | | | | | | | | ## Exporters From c42d18d0b256f4bda0a80bb03f2bbd4c4b823e55 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Wed, 7 Oct 2020 21:36:31 -0700 Subject: [PATCH 15/15] Apply suggestions from code review Co-authored-by: Nikita Salnikov-Tarnovski --- specification/trace/sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 725a53a0d40..30bbcb54dcc 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -251,9 +251,9 @@ resulting in crashes that are difficult to recover from safely. To protect against such errors, SDK Spans MAY discard attributes, links, and events that would increase the number of elements of each collection beyond -the recommended limit of 1000 elements. SDKs MAY provide a way to change this limit, +the recommended limit of 1000 elements. SDKs MAY provide a way to change this limit. -If there is a configurable limit, the SDK MAY honor the environment variables +If there is a configurable limit, the SDK SHOULD honor the environment variables specified in [SDK environment variables](../sdk-environment-variables.md#span-collection-limits). There SHOULD be a log emitted to indicate to the user that an attribute, event,