type ReadOnlySpan … type ReadWriteSpan … type recordingSpan … var _ … var _ … // SpanContext returns the SpanContext of this span. func (s *recordingSpan) SpanContext() trace.SpanContext { … } // IsRecording returns if this span is being recorded. If this span has ended // this will return false. func (s *recordingSpan) IsRecording() bool { … } // SetStatus sets the status of the Span in the form of a code and a // description, overriding previous values set. The description is only // included in the set status when the code is for an error. If this span is // not being recorded than this method does nothing. func (s *recordingSpan) SetStatus(code codes.Code, description string) { … } // SetAttributes sets attributes of this span. // // If a key from attributes already exists the value associated with that key // will be overwritten with the value contained in attributes. // // If this span is not being recorded than this method does nothing. // // If adding attributes to the span would exceed the maximum amount of // attributes the span is configured to have, the last added attributes will // be dropped. func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) { … } var logDropAttrs … // addDroppedAttr adds incr to the count of dropped attributes. // // The first, and only the first, time this method is called a warning will be // logged. // // This method assumes s.mu.Lock is held by the caller. func (s *recordingSpan) addDroppedAttr(incr int) { … } // addOverCapAttrs adds the attributes attrs to the span s while // de-duplicating the attributes of s and attrs and dropping attributes that // exceed the limit. // // This method assumes s.mu.Lock is held by the caller. // // This method should only be called when there is a possibility that adding // attrs to s will exceed the limit. Otherwise, attrs should be added to s // without checking for duplicates and all retrieval methods of the attributes // for s will de-duplicate as needed. // // This method assumes limit is a value > 0. The argument should be validated // by the caller. func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) { … } // truncateAttr returns a truncated version of attr. Only string and string // slice attribute values are truncated. String values are truncated to at // most a length of limit. Each string slice value is truncated in this fashion // (the slice length itself is unaffected). // // No truncation is performed for a negative limit. func truncateAttr(limit int, attr attribute.KeyValue) attribute.KeyValue { … } // safeTruncate truncates the string and guarantees valid UTF-8 is returned. func safeTruncate(input string, limit int) string { … } // safeTruncateValidUTF8 returns a copy of the input string safely truncated to // limit. The truncation is ensured to occur at the bounds of complete UTF-8 // characters. If invalid encoding of UTF-8 is encountered, input is returned // with false, otherwise, the truncated input will be returned with true. func safeTruncateValidUTF8(input string, limit int) (string, bool) { … } // End ends the span. This method does nothing if the span is already ended or // is not being recorded. // // The only SpanOption currently supported is WithTimestamp which will set the // end time for a Span's life-cycle. // // If this method is called while panicking an error event is added to the // Span before ending it and the panic is continued. func (s *recordingSpan) End(options ...trace.SpanEndOption) { … } // monotonicEndTime returns the end time at present but offset from start, // monotonically. // // The monotonic clock is used in subtractions hence the duration since start // added back to start gives end as a monotonic time. See // https://golang.org/pkg/time/#hdr-Monotonic_Clocks func monotonicEndTime(start time.Time) time.Time { … } // RecordError will record err as a span event for this span. An additional call to // SetStatus is required if the Status of the Span should be set to Error, this method // does not change the Span status. If this span is not being recorded or err is nil // than this method does nothing. func (s *recordingSpan) RecordError(err error, opts ...trace.EventOption) { … } func typeStr(i interface{ … } func recordStackTrace() string { … } // AddEvent adds an event with the provided name and options. If this span is // not being recorded than this method does nothing. func (s *recordingSpan) AddEvent(name string, o ...trace.EventOption) { … } func (s *recordingSpan) addEvent(name string, o ...trace.EventOption) { … } // SetName sets the name of this span. If this span is not being recorded than // this method does nothing. func (s *recordingSpan) SetName(name string) { … } // Name returns the name of this span. func (s *recordingSpan) Name() string { … } // Name returns the SpanContext of this span's parent span. func (s *recordingSpan) Parent() trace.SpanContext { … } // SpanKind returns the SpanKind of this span. func (s *recordingSpan) SpanKind() trace.SpanKind { … } // StartTime returns the time this span started. func (s *recordingSpan) StartTime() time.Time { … } // EndTime returns the time this span ended. For spans that have not yet // ended, the returned value will be the zero value of time.Time. func (s *recordingSpan) EndTime() time.Time { … } // Attributes returns the attributes of this span. // // The order of the returned attributes is not guaranteed to be stable. func (s *recordingSpan) Attributes() []attribute.KeyValue { … } // dedupeAttrs deduplicates the attributes of s to fit capacity. // // This method assumes s.mu.Lock is held by the caller. func (s *recordingSpan) dedupeAttrs() { … } // dedupeAttrsFromRecord deduplicates the attributes of s to fit capacity // using record as the record of unique attribute keys to their index. // // This method assumes s.mu.Lock is held by the caller. func (s *recordingSpan) dedupeAttrsFromRecord(record *map[attribute.Key]int) { … } // Links returns the links of this span. func (s *recordingSpan) Links() []Link { … } // Events returns the events of this span. func (s *recordingSpan) Events() []Event { … } // Status returns the status of this span. func (s *recordingSpan) Status() Status { … } // InstrumentationScope returns the instrumentation.Scope associated with // the Tracer that created this span. func (s *recordingSpan) InstrumentationScope() instrumentation.Scope { … } // InstrumentationLibrary returns the instrumentation.Library associated with // the Tracer that created this span. func (s *recordingSpan) InstrumentationLibrary() instrumentation.Library { … } // Resource returns the Resource associated with the Tracer that created this // span. func (s *recordingSpan) Resource() *resource.Resource { … } func (s *recordingSpan) AddLink(link trace.Link) { … } // DroppedAttributes returns the number of attributes dropped by the span // due to limits being reached. func (s *recordingSpan) DroppedAttributes() int { … } // DroppedLinks returns the number of links dropped by the span due to limits // being reached. func (s *recordingSpan) DroppedLinks() int { … } // DroppedEvents returns the number of events dropped by the span due to // limits being reached. func (s *recordingSpan) DroppedEvents() int { … } // ChildSpanCount returns the count of spans that consider the span a // direct parent. func (s *recordingSpan) ChildSpanCount() int { … } // TracerProvider returns a trace.TracerProvider that can be used to generate // additional Spans on the same telemetry pipeline as the current Span. func (s *recordingSpan) TracerProvider() trace.TracerProvider { … } // snapshot creates a read-only copy of the current state of the span. func (s *recordingSpan) snapshot() ReadOnlySpan { … } func (s *recordingSpan) addChild() { … } func (*recordingSpan) private() { … } // runtimeTrace starts a "runtime/trace".Task for the span and returns a // context containing the task. func (s *recordingSpan) runtimeTrace(ctx context.Context) context.Context { … } type nonRecordingSpan … var _ … // SpanContext returns the wrapped SpanContext. func (s nonRecordingSpan) SpanContext() trace.SpanContext { … } // IsRecording always returns false. func (nonRecordingSpan) IsRecording() bool { … } // SetStatus does nothing. func (nonRecordingSpan) SetStatus(codes.Code, string) { … } // SetError does nothing. func (nonRecordingSpan) SetError(bool) { … } // SetAttributes does nothing. func (nonRecordingSpan) SetAttributes(...attribute.KeyValue) { … } // End does nothing. func (nonRecordingSpan) End(...trace.SpanEndOption) { … } // RecordError does nothing. func (nonRecordingSpan) RecordError(error, ...trace.EventOption) { … } // AddEvent does nothing. func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) { … } // AddLink does nothing. func (nonRecordingSpan) AddLink(trace.Link) { … } // SetName does nothing. func (nonRecordingSpan) SetName(string) { … } // TracerProvider returns the trace.TracerProvider that provided the Tracer // that created this span. func (s nonRecordingSpan) TracerProvider() trace.TracerProvider { … } func isRecording(s SamplingResult) bool { … } func isSampled(s SamplingResult) bool { … } type Status …