1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-12 02:28:07 +02:00
opentelemetry-go/sdk/trace
Anthony Mirabella ca3f74d976
Add Span#RecordError method to simplify adding error events to spans (#473)
* Add `Span#Error` method to simplify setting an error status and message.

* `Span#Error` should no-op on nil errors

* Record errors as a span event rather than status/attributes.

The implementation in the SDK package now relies on existing API methods.

* Add WithErrorStatus() ErrorOption to allow setting span status on error.

* Apply suggestions from code review

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Address code review feedback

* Clean up RecordError tests

* Ensure complete and unique error type is recorded for defined types
* Avoid duplicating logic under test in tests

* Move TestError to internal/testing package, improve RecordError test scenarios

Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
2020-02-28 13:44:53 -08:00
..
internal Namespace import path under "/otel" (#274) 2019-11-01 11:40:29 -07:00
attributesMap.go specialize simplelru(span's lruMap) for attributes only (#328) 2019-11-18 10:51:57 -08:00
batch_span_processor_test.go Replace span relationship with a potentially remote parent context (#451) 2020-02-04 08:55:03 -08:00
batch_span_processor.go Consistently use pointer receivers for core.Number (#375) 2019-12-09 13:03:11 -08:00
benchmark_test.go Drop SetAttribute from Span (#361) 2019-12-03 16:58:55 +11:00
config.go Namespace import path under "/otel" (#274) 2019-11-01 11:40:29 -07:00
doc.go Fix URL to opentelemetry.io (#464) 2020-02-05 07:18:40 -08:00
evictedqueue_test.go Trace sdk (#65) 2019-08-02 13:52:55 -07:00
evictedqueue.go Trace sdk (#65) 2019-08-02 13:52:55 -07:00
id_generator.go Namespace import path under "/otel" (#274) 2019-11-01 11:40:29 -07:00
provider.go Consistently use pointer receivers for core.Number (#375) 2019-12-09 13:03:11 -08:00
sampling_test.go Add AlwaysParentSample sampler (#455) 2020-02-03 10:22:52 -08:00
sampling.go Add AlwaysParentSample sampler (#455) 2020-02-03 10:22:52 -08:00
simple_span_processor_test.go Replace span relationship with a potentially remote parent context (#451) 2020-02-04 08:55:03 -08:00
simple_span_processor.go Move export types into trace and metric-specific subdirs (#289) 2019-11-05 13:08:55 -08:00
span_processor_test.go Rename GetTracer to Tracer (#347) 2019-11-25 09:46:07 -08:00
span_processor.go Move export types into trace and metric-specific subdirs (#289) 2019-11-05 13:08:55 -08:00
span.go Add Span#RecordError method to simplify adding error events to spans (#473) 2020-02-28 13:44:53 -08:00
trace_go11.go Trace sdk (#65) 2019-08-02 13:52:55 -07:00
trace_nongo11.go Trace sdk (#65) 2019-08-02 13:52:55 -07:00
trace_test.go Add Span#RecordError method to simplify adding error events to spans (#473) 2020-02-28 13:44:53 -08:00
trace.go Namespace import path under "/otel" (#274) 2019-11-01 11:40:29 -07:00
tracer.go Add StartOptions to Tracer.WithSpan() (#472) 2020-02-10 21:07:32 -05:00
util_test.go Namespace import path under "/otel" (#274) 2019-11-01 11:40:29 -07:00