Skip to content

Commit

Permalink
Merge branch 'main' into update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Feb 15, 2024
2 parents 2467682 + cad63b6 commit 51a63ca
Show file tree
Hide file tree
Showing 52 changed files with 748 additions and 3,688 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-10-10
toolchain: nightly-2024-02-07
components: rustfmt
override: true
- name: external-type-check
Expand All @@ -70,7 +70,7 @@ jobs:
non-default-examples:
strategy:
matrix:
example: [opentelemetry-otlp/examples/external-otlp-grpcio-async-std, opentelemetry-otlp/examples/basic-otlp]
example: [opentelemetry-otlp/examples/basic-otlp]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
**/*.rs.bk
Cargo.lock
/.idea/

.cosine
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ members = [
"opentelemetry-zipkin",
"opentelemetry-otlp/examples/basic-otlp",
"opentelemetry-otlp/examples/basic-otlp-http",
"opentelemetry-otlp/examples/external-otlp-grpcio-async-std",
"opentelemetry-otlp/tests/integration_test",
"examples/metrics-basic",
"examples/metrics-advanced",
Expand All @@ -43,7 +42,6 @@ env_logger = "0.10" # env_logger requires a newer MSRV
futures-core = "0.3"
futures-executor = "0.3"
futures-util = "0.3"
grpcio = "0.12"
hyper = "0.14"
http = "0.2"
isahc = "1.4"
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "opentelemetry-http"
version = "0.10.0"
description = "Helper implementations for exchange of traces and metrics over HTTP"
description = "Helper implementations for sending HTTP requests. Uses include propagating and extracting context over http, exporting telemetry, requesting sampling strategies."
homepage = "https://github.com/open-telemetry/opentelemetry-rust"
repository = "https://github.com/open-telemetry/opentelemetry-rust"
keywords = ["opentelemetry", "tracing", "metrics"]
keywords = ["opentelemetry", "tracing", "context", "propagation"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.65"
Expand Down
12 changes: 11 additions & 1 deletion opentelemetry-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ pub use bytes::Bytes;
pub use http::{Request, Response};
use opentelemetry::propagation::{Extractor, Injector};

/// Helper for injecting headers into HTTP Requests. This is used for OpenTelemetry context
/// propagation over HTTP.
/// See [this](https://github.com/open-telemetry/opentelemetry-rust/blob/main/examples/tracing-http-propagator/README.md)
/// for example usage.
pub struct HeaderInjector<'a>(pub &'a mut http::HeaderMap);

impl<'a> Injector for HeaderInjector<'a> {
Expand All @@ -20,6 +24,10 @@ impl<'a> Injector for HeaderInjector<'a> {
}
}

/// Helper for extracting headers from HTTP Requests. This is used for OpenTelemetry context
/// propagation over HTTP.
/// See [this](https://github.com/open-telemetry/opentelemetry-rust/blob/main/examples/tracing-http-propagator/README.md)
/// for example usage.
pub struct HeaderExtractor<'a>(pub &'a http::HeaderMap);

impl<'a> Extractor for HeaderExtractor<'a> {
Expand All @@ -39,7 +47,9 @@ impl<'a> Extractor for HeaderExtractor<'a> {

pub type HttpError = Box<dyn std::error::Error + Send + Sync + 'static>;

/// A minimal interface necessary for export spans over HTTP.
/// A minimal interface necessary for sending requests over HTTP.
/// Used primarily for exporting telemetry over HTTP. Also used for fetching
/// sampling strategies for JaegerRemoteSampler
///
/// Users sometime choose HTTP clients that relay on a certain async runtime. This trait allows
/// users to bring their choice of HTTP client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ mod collector_client_tests {
use opentelemetry::trace::TraceError;
use opentelemetry_sdk::runtime::Tokio;

// Ignore this test as it is flaky and the opentelemetry-jaeger is on-track for deprecation
#[ignore]
#[test]
fn test_bring_your_own_client() -> Result<(), TraceError> {
let invalid_uri_builder = new_collector_pipeline()
Expand Down
2 changes: 2 additions & 0 deletions opentelemetry-jaeger/src/exporter/config/collector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ mod tests {
assert!(valid_uri.is_ok());
}

// Ignore this test as it is flaky and the opentelemetry-jaeger is on-track for deprecation
#[ignore]
#[test]
fn test_collector_exporter() {
let exporter = new_collector_pipeline()
Expand Down
2 changes: 2 additions & 0 deletions opentelemetry-otlp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## vNext

- Remove support for grpcio transport (#1534)

## v0.14.0

### Added
Expand Down
6 changes: 0 additions & 6 deletions opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
async-trait = { workspace = true }
futures-core = { workspace = true }
grpcio = { workspace = true, optional = true }
opentelemetry = { version = "0.21", default-features = false, path = "../opentelemetry" }
opentelemetry_sdk = { version = "0.21", default-features = false, path = "../opentelemetry-sdk" }
opentelemetry-http = { version = "0.10", path = "../opentelemetry-http", optional = true }
Expand Down Expand Up @@ -70,11 +69,6 @@ gzip-tonic = ["tonic/gzip"]
tls = ["tonic/tls"]
tls-roots = ["tls", "tonic/tls-roots"]

# grpc using grpcio
grpc-sys = ["grpcio", "opentelemetry-proto/gen-grpcio"]
openssl = ["grpcio/openssl"]
openssl-vendored = ["grpcio/openssl-vendored"]

# http binary
http-proto = ["prost", "opentelemetry-http", "opentelemetry-proto/gen-tonic-messages", "http", "trace", "metrics"]
reqwest-blocking-client = ["reqwest/blocking", "opentelemetry-http/reqwest"]
Expand Down
22 changes: 3 additions & 19 deletions opentelemetry-otlp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use opentelemetry::trace::Tracer;

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// use tonic as grpc layer here.
// If you want to use grpcio. enable `grpc-sys` feature and use with_grpcio function here.
let tracer = opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(opentelemetry_otlp::new_exporter().tonic())
Expand All @@ -71,7 +70,7 @@ automatically.
```toml
[dependencies]
opentelemetry_sdk = { version = "*", features = ["async-std"] }
opentelemetry-otlp = { version = "*", features = ["grpc-sys"] }
opentelemetry-otlp = { version = "*", features = ["grpc-tonic"] }
```

```rust
Expand All @@ -84,26 +83,11 @@ let tracer = opentelemetry_otlp::new_pipeline()

## Kitchen Sink Full Configuration

[Example](https://docs.rs/opentelemetry-otlp/latest/opentelemetry_otlp/#kitchen-sink-full-configuration)
[Example](https://docs.rs/opentelemetry-otlp/latest/opentelemetry_otlp/#kitchen-sink-full-configuration)
showing how to override all configuration options.

Generally there are two parts of configuration. One is metrics config
Generally there are two parts of configuration. One is metrics config
or tracing config. Users can config it via [`OtlpTracePipeline`]
or [`OtlpMetricPipeline`]. The other is exporting configuration.
Users can set those configurations using [`OtlpExporterPipeline`] based
on the choice of exporters.

# Grpc libraries comparison

Multiple gRPC transport layers are available. [`tonic`](https://crates.io/crates/tonic) is the default gRPC transport
layer and is enabled by default. [`grpcio`](https://crates.io/crates/grpcio) is optional.

| gRPC transport layer | [hyperium/tonic](https://github.com/hyperium/tonic) | [tikv/grpc-rs](https://github.com/tikv/grpc-rs) |
|---|---|---|
| Feature | --features=default | --features=grpc-sys |
| gRPC library | [`tonic`](https://crates.io/crates/tonic) | [`grpcio`](https://crates.io/crates/grpcio) |
| Transport | [hyperium/hyper](https://github.com/hyperium/hyper) (Rust) | [grpc/grpc](https://github.com/grpc/grpc) (C++ binding) |
| TLS support | yes | yes |
| TLS library | rustls | OpenSSL |
| TLS optional | yes | yes |
| Supported .proto generator | [`prost`](https://crates.io/crates/prost) | [`prost`](https://crates.io/crates/prost), [`protobuf`](https://crates.io/crates/protobuf) |

This file was deleted.

This file was deleted.

101 changes: 0 additions & 101 deletions opentelemetry-otlp/examples/external-otlp-grpcio-async-std/src/main.rs

This file was deleted.

76 changes: 0 additions & 76 deletions opentelemetry-otlp/src/exporter/grpcio/logs.rs

This file was deleted.

Loading

0 comments on commit 51a63ca

Please sign in to comment.