1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-27 00:21:15 +02:00

trace: Add Span.AddLink method (#5032)

This commit is contained in:
qcheng
2024-03-28 16:35:15 +09:00
committed by GitHub
parent 321219b2a6
commit 554282d3e4
9 changed files with 112 additions and 2 deletions

View File

@ -629,7 +629,7 @@ func (s *recordingSpan) Resource() *resource.Resource {
return s.tracer.provider.resource
}
func (s *recordingSpan) addLink(link trace.Link) {
func (s *recordingSpan) AddLink(link trace.Link) {
if !s.IsRecording() || !link.SpanContext.IsValid() {
return
}
@ -803,6 +803,9 @@ 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) {}