From a5148e9cb4832a248b1178d06c196fe30b50f6c7 Mon Sep 17 00:00:00 2001 From: Nathan Lincoln Date: Wed, 10 Jan 2024 15:59:11 -0600 Subject: [PATCH] doc --- trace/trace.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/trace/trace.go b/trace/trace.go index c606fb3a..0586bea0 100644 --- a/trace/trace.go +++ b/trace/trace.go @@ -124,6 +124,23 @@ type addFieldOptions struct { isOverridable *bool } +// Overridable will allow spans created within the same process to override this field with a different value. +// +// Overriding a field on a span does not override the entire subtree - in the following hypothetical +// trace, overriding a field on the parent span will not override that field in the child span. +// +// root +// parent +// child +// +// Overridable fields are sent to downstream services, but we cannot encode the "overrideability" +// +// of the field in the propagation context, so the field will cease to be overrideable in the downstream +// service. +// +// Overridable is best suited to niche cases where you are not propagating the span context, +// +// or cases where you only wish to overwrite the field in a small number of cases, usually in leaf spans. func Overridable(overridable bool) addFieldOptions { return addFieldOptions{isOverridable: &overridable} }