Skip to content

Commit

Permalink
Rename HttpTraceContextPropagtor to TraceContextPropagator (open-tele…
Browse files Browse the repository at this point in the history
  • Loading branch information
kichristensen authored and iredelmeier committed Nov 28, 2019
1 parent edf03e6 commit 2586c51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/api/distributed_context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
//! `Carrier`s that travel in-band across process boundaries.
pub mod binary_propagator;
pub mod http_b3_propagator;
pub mod http_trace_context_propagator;
pub mod trace_context_propagator;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! # HTTP Trace Context Propagator
//! # Trace Context Propagator
//!
//! The `traceparent` header represents the incoming request in a
//! tracing system in a common format, understood by all vendors.
Expand Down Expand Up @@ -27,12 +27,12 @@ static TRACEPARENT_HEADER: &str = "Traceparent";
/// Extracts and injects `SpanContext`s into `Carrier`s using the
/// trace-context format.
#[derive(Debug, Default)]
pub struct HTTPTraceContextPropagator {}
pub struct TraceContextPropagator {}

impl HTTPTraceContextPropagator {
/// Create a new `HTTPTraceContextPropagator`.
impl TraceContextPropagator {
/// Create a new `TraceContextPropagator`.
pub fn new() -> Self {
HTTPTraceContextPropagator {}
TraceContextPropagator {}
}

/// Extract span context from w3c trace-context header.
Expand Down Expand Up @@ -78,7 +78,7 @@ impl HTTPTraceContextPropagator {
}
}

impl api::HttpTextFormat for HTTPTraceContextPropagator {
impl api::HttpTextFormat for TraceContextPropagator {
/// Properly encodes the values of the `SpanContext` and injects them
/// into the `Carrier`.
fn inject(&self, context: api::SpanContext, carrier: &mut dyn api::Carrier) {
Expand Down Expand Up @@ -136,7 +136,7 @@ mod test {

#[test]
fn extract_w3c() {
let propagator = HTTPTraceContextPropagator::new();
let propagator = TraceContextPropagator::new();

for (header, expected_context) in extract_data() {
let mut carrier: HashMap<&'static str, String> = HashMap::new();
Expand All @@ -147,7 +147,7 @@ mod test {

#[test]
fn inject_w3c() {
let propagator = HTTPTraceContextPropagator::new();
let propagator = TraceContextPropagator::new();

for (expected_header, context) in inject_data() {
let mut carrier = HashMap::new();
Expand Down

0 comments on commit 2586c51

Please sign in to comment.