1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-02 08:52:21 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
Anthony Mirabella
a547cc3bfe
Use a constant padding for 64-bit B3 trace IDs (#701) 2020-05-06 11:09:41 -04:00
Anthony Mirabella
0a9b2e0d8c
left-pad 64-bit B3 trace IDs (#698) 2020-05-05 14:20:09 -04:00
tensorchen
2ffbd869d7 Rename TraceFlagsSampled, TraceFlagsUnused 2020-05-06 01:41:54 +08:00
tensorchen
bae2298a36 Rename trace.TraceID & trace.TraceIDFromHex 2020-05-03 13:48:38 +08:00
tensorchen
c6c155de6f Move SpanContext from core package into trace 2020-05-02 20:17:11 +08:00
Krzesimir Nowak
c23e09c7f7
Fix clobbering of the span context if extraction fails (#656)
* Do not put span context into go context if extraction failed

This causes problems if multiple trace propagators are chained,
because the first propagator in chain may extract a valid span
context, then next propagator will overwrite it with an empty span
context when required headers in supplier are missing.

* Test for clobbering propagators

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-04-27 11:37:40 -07:00
Shouri Piratla
669d4b3a6c
TraceID and SpanID implementations for Stringer Interface (#642)
* TraceID and SpanID implementations for Stringer Interface

* Hex encode while stringifying

* Modify format specifiers wherever SpanID is used

* comment changes

* Remove TraceIdString() and SpanIdString()

* Comments Fixes
2020-04-16 15:42:48 -07:00
Tyler Yahn
a485d0ec64
Update License header for all source files (#586)
* Update License header for all source files

- Add Apache 2.0 header to source files that did not have one.
- Update all existing headers dated to 2019 to be 2020
- Remove comma from License header to comply with the Apache 2.0
  guidelines.

* Update Copyright notice

Use the standard Copyright notices outlined by the
[CNCF](https://github.com/cncf/foundation/blob/master/copyright-notices.md#copyright-notices)
2020-03-23 22:41:10 -07:00
Rahul Patel
547d584da8
Add global propagators (#494)
* Add global propagators

The default global propagators are set to the chained W3C trace and
correlation context propagators.

* Use global propagators in plugins

The httptrace and grpcplugins should also get some API for setting a
propagator to use (the othttp plugin already has such an API), but
that can come in some other PR.

* Decrease indentation in trace propagators

* Drop obsolete TODOs

Now we do "something" with correlation context - it ends up in the
context, and we put the context into the request, so the chained HTTP
handler can access it too.

The other TODO was about tag.Upsert which is long gone.

* Do not unnecessarily update the request context

The request context already contains the span (and we add some
attribute there), so inserting it into context again is pointless.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-03-05 10:12:10 -08:00
Krzesimir Nowak
cf7a4d909c
Refactor propagators (#467)
* Remove binary propagators

They are in process of being dropped from the specification and we
haven't be using them anywhere in the project. Can reintroduce them
later.

* Rename Supplier to HTTPSupplier

The supplier is used only in HTTP propagators currently. It's not
clear if it will be useful for binary propagators if they get to be
specified at some point.

* Rework propagation interfaces

The biggest change here is that HTTP extractors return a new context
with whatever information the propagator is able to retrieve from the
supplier. Such interface does not hardcode any extractor's
functionality (like it was before by explicitly returning a span
context and correlation context) and makes it easy to chain multiple
propagators.

Injection part hasn't changed.

* Add Propagators interface

This interface (and its default implementation) is likely going to be
the propagation API used the most. Single injectors, extractors or
propagators are likely going to be used just as parameters to the
Option functions that configure the Propagators implementation.

* Drop noop propagator

It's rather pointless - just create an empty Propagators instance.

* Fix wrong name in docs

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-02-13 23:16:04 -08:00
Krzesimir Nowak
6b4acf47b8 Reorganize propagation code (shrink PR 381) (#444)
* Rename distributedcontext package to correlation

Correlation is the name we agreed upon.

* Move trace propagators to api/trace

The trace propagators tests had to be moved to a testtrace subpackage
to avoid import cycles between api/trace and internal/trace.

Needed to shut up golint about stutter in trace.TraceContext -
TraceContext is a name of a W3C spec, so this stutter is
expected. It's certainly still better than golint's suggestion of
having trace.Context.

* Rename api/propagators to api/propagation

This package will not contain any propagators in the long run, just
the interface definitions.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-01-28 10:13:46 -08:00