Skip to content

Commit

Permalink
feat: move jaeger and zipkin propagators into their own crate and ren…
Browse files Browse the repository at this point in the history
…ame them.
  • Loading branch information
TommyCpp committed Dec 5, 2020
1 parent 098cf80 commit df18ae4
Show file tree
Hide file tree
Showing 29 changed files with 790 additions and 759 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -129,3 +129,7 @@ See the [code owners](CODEOWNERS) file.

See the [community membership document in OpenTelemetry community
repo](https://github.com/open-telemetry/community/blob/master/community-membership.md).

## FAQ
### Where should I put third party propagators/exporters, contrib or standalone crates?
As of now, the specification classify the propagators into three categories: Fully opened standards, platform-specific standards, proprietary headers. The conclusion is only the fully opened standards should live in SDK packages/repos. So here, only fully opened standards should live as independent crate. For more detail and discussion, see [this pr](https://github.com/open-telemetry/opentelemetry-specification/pull/1144).
2 changes: 0 additions & 2 deletions opentelemetry-contrib/Cargo.toml
Expand Up @@ -26,8 +26,6 @@ datadog = ["indexmap", "rmp", "async-trait", "thiserror"]
reqwest-blocking-client = ["reqwest/blocking", "opentelemetry/reqwest"]
reqwest-client = ["reqwest", "opentelemetry/reqwest"]
surf-client = ["surf", "opentelemetry/surf"]
jaeger = []
zipkin = []
aws-xray = []

[dependencies]
Expand Down
8 changes: 0 additions & 8 deletions opentelemetry-contrib/src/trace/propagator/mod.rs
Expand Up @@ -13,15 +13,7 @@
//! This module also provides relative types for those propagators.
#[cfg(feature = "aws-xray")]
mod aws;
#[cfg(feature = "zipkin")]
mod b3;
pub mod binary;
#[cfg(feature = "jaeger")]
mod jaeger;

#[cfg(feature = "aws-xray")]
pub use aws::XrayPropagator;
#[cfg(feature = "zipkin")]
pub use b3::{B3Encoding, B3Propagator};
#[cfg(feature = "jaeger")]
pub use jaeger::JaegerPropagator;
4 changes: 4 additions & 0 deletions opentelemetry-jaeger/Cargo.toml
Expand Up @@ -34,6 +34,10 @@ tokio = { version = "0.2", features = ["udp", "sync"], optional = true }
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4.18", optional = true }
thiserror = "1.0"
lazy_static = "1.4"

[dev-dependencies]
opentelemetry = { version = "0.10", default-features = false, features = ["trace", "testing"], path = "../opentelemetry" }

[dependencies.web-sys]
version = "0.3.4"
Expand Down
8 changes: 7 additions & 1 deletion opentelemetry-jaeger/README.md
Expand Up @@ -4,7 +4,7 @@

# OpenTelemetry Jaeger

[`Jaeger`] integration for applications instrumented with [`OpenTelemetry`].
[`Jaeger`] integration for applications instrumented with [`OpenTelemetry`]. This includes a jaeger exporter and a jaeger propagator.

[![Crates.io: opentelemetry-jaeger](https://img.shields.io/crates/v/opentelemetry-jaeger.svg)](https://crates.io/crates/opentelemetry-jaeger)
[![Documentation](https://docs.rs/opentelemetry-jaeger/badge.svg)](https://docs.rs/opentelemetry-jaeger)
Expand Down Expand Up @@ -43,8 +43,10 @@ exporting telemetry:

```rust
use opentelemetry::tracer;
use opentelemetry::global;

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
let (tracer, _uninstall) = opentelemetry_jaeger::new_pipeline().install()?;

tracer.in_span("doing_work", |cx| {
Expand Down Expand Up @@ -84,8 +86,10 @@ in the [jaeger variables spec].

```rust
use opentelemetry::tracer;
use opentelemetry::global;

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
// export OTEL_SERVICE_NAME=my-service-name
let (tracer, _uninstall) = opentelemetry_jaeger::new_pipeline().from_env().install()?;

Expand Down Expand Up @@ -142,8 +146,10 @@ Example showing how to override all configuration options. See the
```rust
use opentelemetry::{KeyValue, Tracer};
use opentelemetry::sdk::{trace, IdGenerator, Resource, Sampler};
use opentelemetry::global;

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
let (tracer, _uninstall) = opentelemetry_jaeger::new_pipeline()
.from_env()
.with_agent_endpoint("localhost:6831")
Expand Down
@@ -1,9 +1,9 @@
//! # UDP Jaeger Agent Client
use crate::thrift::{
use crate::exporter::thrift::{
agent::{self, TAgentSyncClient},
jaeger,
};
use crate::transport::{TBufferChannel, TNoopChannel};
use crate::exporter::transport::{TBufferChannel, TNoopChannel};
use std::fmt;
use std::net::{ToSocketAddrs, UdpSocket};
use thrift::{
Expand Down
Expand Up @@ -23,7 +23,7 @@ struct WasmHttpClient {
#[cfg(feature = "collector_client")]
mod collector_client {
use super::*;
use crate::thrift::jaeger;
use crate::exporter::thrift::jaeger;
use http::{Request, Uri};
use isahc::{
auth::{Authentication, Credentials},
Expand Down Expand Up @@ -106,7 +106,7 @@ mod collector_client {
#[cfg(all(feature = "wasm_collector_client", not(feature = "collector_client")))]
mod wasm_collector_client {
use super::*;
use crate::thrift::jaeger;
use crate::exporter::thrift::jaeger;
use futures_util::future;
use http::Uri;
use js_sys::Uint8Array;
Expand Down
File renamed without changes.

0 comments on commit df18ae4

Please sign in to comment.