apple / swift-distributed-tracing

Instrumentation library for Swift server applications
https://swiftpackageindex.com/apple/swift-distributed-tracing/main/documentation/tracing
Apache License 2.0
222 stars 30 forks source link

Sparse documentation on `Span.isRecording` #81

Open fabianfett opened 1 year ago

fabianfett commented 1 year ago

The current documentation about Span.isRecording is:

    /// Returns true if this `Span` is recording information like events, attributes, status, etc.
    var isRecording: Bool { get }

Does that mean a Span implementation is allowed to drop all the events on the floor? Who consumes that property? Should clients read it before they try to attach massive amounts of data to the Span?

ktoso commented 1 year ago

Since this package is not a concrete specific "complete specification" but tries to serve a few such ambigious docs will be somewhat an inherent problem 🤔

The origin of this is from otel: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#isrecording so you can refer to these semantics as the source of truth for most impl that actually exist today.