Skip to content

Commit

Permalink
Refactor propagators (#467)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
krnowak and jmacd authored Feb 14, 2020
1 parent c397451 commit cf7a4d9
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 415 deletions.
80 changes: 0 additions & 80 deletions api/propagation/binary_propagator.go

This file was deleted.

170 changes: 0 additions & 170 deletions api/propagation/binary_propagator_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions api/propagation/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package propagation contains interface definition for BinaryFormat and
// TextFormat propagators.
// Package propagation contains interface definition for HTTP propagators.
package propagation // import "go.opentelemetry.io/otel/api/propagation"
Loading

0 comments on commit cf7a4d9

Please sign in to comment.