Skip to content

Commit

Permalink
Merge branch 'main' into 588
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyCpp committed Nov 17, 2021
2 parents 7a3b8c7 + e606cf1 commit 8a07715
Show file tree
Hide file tree
Showing 11 changed files with 283 additions and 107 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Expand Up @@ -12,7 +12,6 @@ members = [
"opentelemetry-stackdriver",
"opentelemetry-zipkin",
"opentelemetry-zpages",
"examples/actix-udp",
"examples/actix-http",
"examples/actix-http-tracing",
"examples/actix-udp",
Expand Down
14 changes: 14 additions & 0 deletions deny.toml
@@ -1,3 +1,10 @@
exclude=[
"actix-http",
"actix-http-tracing",
"actix-udp",
"actix-udp-example"
]

[licenses]
unlicensed = "deny"
allow = [
Expand All @@ -17,4 +24,11 @@ version = "*"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]

[advisories]
ignore = [
# time/chrono problems, have not been a problem in practice, not much we can do at this moment.
"RUSTSEC-2020-0071",
"RUSTSEC-2020-0159"
]
2 changes: 1 addition & 1 deletion examples/actix-udp/README.md
Expand Up @@ -19,5 +19,5 @@ $ firefox http://localhost:16686/

Fire a request:
```bash
curl http://localhost:8088
curl http://localhost:8080
```
9 changes: 8 additions & 1 deletion examples/actix-udp/src/main.rs
Expand Up @@ -12,6 +12,13 @@ fn init_tracer() -> Result<sdktrace::Tracer, TraceError> {
opentelemetry_jaeger::new_pipeline()
.with_agent_endpoint("localhost:6831")
.with_service_name("trace-udp-demo")
.with_trace_config(opentelemetry::sdk::trace::config().with_resource(
opentelemetry::sdk::Resource::new(vec![
opentelemetry::KeyValue::new("service.name", "my-service"), // this will not override the trace-udp-demo
opentelemetry::KeyValue::new("service.namespace", "my-namespace"),
opentelemetry::KeyValue::new("exporter", "jaeger"),
]),
))
.install_simple()
}

Expand Down Expand Up @@ -42,7 +49,7 @@ async fn main() -> std::io::Result<()> {
})
.route("/", web::get().to(index))
})
.bind("127.0.0.1:8088")
.bind("127.0.0.1:8080")
.unwrap()
.run()
.await
Expand Down
11 changes: 6 additions & 5 deletions examples/basic/src/main.rs
@@ -1,7 +1,8 @@
use futures::stream::{Stream, StreamExt};
use opentelemetry::global;
use opentelemetry::global::shutdown_tracer_provider;
use opentelemetry::sdk::{metrics::PushController, trace as sdktrace};
use opentelemetry::sdk::trace::Config;
use opentelemetry::sdk::{metrics::PushController, trace as sdktrace, Resource};
use opentelemetry::trace::TraceError;
use opentelemetry::{
baggage::BaggageExt,
Expand All @@ -15,10 +16,10 @@ use std::time::Duration;
fn init_tracer() -> Result<sdktrace::Tracer, TraceError> {
opentelemetry_jaeger::new_pipeline()
.with_service_name("trace-demo")
.with_tags(vec![
KeyValue::new("exporter", "jaeger"),
KeyValue::new("float", 312.23),
])
.with_trace_config(Config::default().with_resource(Resource::new(vec![
KeyValue::new("service.name", "new_service"),
KeyValue::new("exporter", "otlp-jaeger"),
])))
.install_batch(opentelemetry::runtime::Tokio)
}

Expand Down
8 changes: 6 additions & 2 deletions examples/multiple-span-processors/src/main.rs
@@ -1,6 +1,7 @@
use opentelemetry::global::{self, shutdown_tracer_provider};
use opentelemetry::sdk::export::trace::stdout::Exporter as StdoutExporter;
use opentelemetry::sdk::trace::{BatchSpanProcessor, TracerProvider};
use opentelemetry::sdk::trace::{BatchSpanProcessor, Config, TracerProvider};
use opentelemetry::sdk::Resource;
use opentelemetry::trace::{mark_span_as_active, TraceError, Tracer};
use opentelemetry::KeyValue;
use std::io::stdout;
Expand All @@ -11,7 +12,10 @@ fn init_tracer() -> Result<(), TraceError> {
let jaeger_processor = BatchSpanProcessor::builder(
opentelemetry_jaeger::new_pipeline()
.with_service_name("trace-demo")
.with_tags(vec![KeyValue::new("exporter", "jaeger")])
.with_trace_config(
Config::default()
.with_resource(Resource::new(vec![KeyValue::new("exporter", "jaeger")])),
)
.init_async_exporter(opentelemetry::runtime::Tokio)?,
opentelemetry::runtime::Tokio,
)
Expand Down

0 comments on commit 8a07715

Please sign in to comment.