From 757030dc78051d90dd1c33c1d292c4d4e8fa63cb Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 9 Nov 2020 10:57:34 -0800 Subject: [PATCH] Update Span End method documentation (#1310) * Update Span End method documentation Updates to the Span after End is called result it potentially inconsistent views of the Span between the code defining it and the ultimate receiver of the Span data. This corrects the documented language of the API to prevent this from happening. * Add changes to changelog --- CHANGELOG.md | 1 + trace/trace.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f25da31..8fb0f4994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Fix `Code.UnmarshalJSON` to work with valid json only. (#1276) - The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and `host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235) +- Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) ### Removed diff --git a/trace/trace.go b/trace/trace.go index a5fe7066a..76016e5bb 100644 --- a/trace/trace.go +++ b/trace/trace.go @@ -246,8 +246,10 @@ type Span interface { // nil. Tracer() Tracer - // End completes the Span. Updates are not allowed the Span after End is - // called other than setting the status. + // End completes the Span. The Span is considered complete and ready to be + // delivered through the rest of the telemetry pipeline after this method + // is called. Therefore, updates to the Span are not allowed after this + // method has been called. End(options ...SpanOption) // AddEvent adds an event with the provided name and options.