1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-11-28 08:38:51 +02:00
Commit Graph

4 Commits

Author SHA1 Message Date
Sam Xie
230bdd10f0
Add SpanContextFromContext() (#1255)
* SpanFromContext returns nil if span not exists

* Add tests for SpanContextFromContext

* Update CHANGELOG

* Update trace.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* SpanFromContext() continue to return a noopSpan{}

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-10-21 17:30:28 -04:00
Tyler Yahn
ec300b28ad
Update Span API event methods (#1254)
* Update Span API event methods

Remove the context argument from the event methods. It is unused and can
be added back in as a passed option if needed in the future.

Update AddEvent to accept a required name and a set of options. These
options are the new EventOption type that can be used to configure a
SpanConfig Timestamp and Attributes.

Remove the AddEventWithTimestamp method as it is redundant to calling
AddEvent with a WithTimestamp option.

Update RecordError to also accept the EventOptions.

* Add changes to CHANGELOG

* Add LifeCycleOption

Use the LifeCycleOption to encapsulate the options passed to a span for
life cycle events.
2020-10-16 08:09:27 -07:00
Tyler Yahn
a46f88ee8d
Fix lint issues in otel package (#1243)
* Fix lint issues in otel package

Add documentation for the shadowed `Meter` for the time being.

Do not export `ErrInvalidHexID`, `ErrInvalidTraceIDLength`,
`ErrInvalidSpanIDLength`, `ErrInvalidSpanIDLength`, or `ErrNilSpanID`.
These are not used externally and we should reduce the API prior to a GA
release to allow flexibility going forward.

Add and update comments for all SpanKind conforming to golint spec.

* Update CHANGELOG
2020-10-12 08:43:26 -07:00
Tyler Yahn
27c84d689d
Move trace api package into otel (#1229)
* Move trace API to otel

* Move tracetest to oteltest

* Update package documentation

* Remove old api/trace package

* Lint

* Add changes to CHANGELOG

* Add tests for rest of trace API

* Apply suggestions from code review

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Documentation fixes

Includes resolutions for review issues.

* Correct CHANGELOG post release

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2020-10-08 19:58:56 -07:00