Skip to content

Commit

Permalink
Merge pull request #56 from philipcristiano/dependabot/cargo/opentele…
Browse files Browse the repository at this point in the history
…metry-b8293c8c66

build(deps): bump the opentelemetry group with 3 updates
  • Loading branch information
github-actions[bot] authored Nov 21, 2023
2 parents 3143750 + 95e3cf6 commit 5c4aaa1
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 81 deletions.
104 changes: 50 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ clap = { version = "4.4.8", features = ["derive", "env"]}
maud = { version = "0.25.0", features = ["axum"] }
once_cell = "1.18.0"
openidconnect = "3.4.0"
opentelemetry = { version = "0.20.0", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.13.0", features = ["grpc-tonic", "http-proto"] }
opentelemetry-semantic-conventions = "0.12.0"
opentelemetry_sdk = "0.20.0"
opentelemetry = { version = "0.21.0", features = [] }
opentelemetry-otlp = { version = "0.14.0", features = ["grpc-tonic", "http-proto"] }
opentelemetry-semantic-conventions = "0.13.0"
opentelemetry_sdk = { version = "0.21.1", features = ["rt-tokio"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.34.0", features = ["full"]}
tokio = { version = "1.34.0", features = ["full"] }
toml = "0.8.8"
tonic = { version = "0.10.2", features = ["tls", "tls-roots"] }
tower-cookies = { version = "0.9.0", features = ["signed", "private"]}
tower-http = { version = "0.4.4", features = ["tracing", "trace"] }
tracing = "0.1.40"
tracing-opentelemetry = "0.21.0"
tracing-opentelemetry = "0.22.0"
tracing-subscriber = { version = "0.3.18", features = ["fmt", "json", "env-filter", "std", "registry"] }
url = "2.4.1"
29 changes: 8 additions & 21 deletions src/app_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ use tracing_subscriber::filter::LevelFilter;
use tracing_subscriber::prelude::*;
use tracing_subscriber::registry;

use opentelemetry::{global, runtime, Key, KeyValue};
use opentelemetry::KeyValue;
use opentelemetry_sdk::{
metrics::{
reader::{DefaultAggregationSelector, DefaultTemporalitySelector},
Aggregation, Instrument, MeterProvider, PeriodicReader, Stream,
},
runtime,
trace::{BatchConfig, RandomIdGenerator, Sampler, Tracer},
Resource,
};
use opentelemetry_semantic_conventions::{
resource::{SERVICE_NAME, SERVICE_VERSION},
SCHEMA_URL,
};
use opentelemetry_semantic_conventions::resource::{SERVICE_NAME, SERVICE_VERSION};
use tracing_opentelemetry::OpenTelemetryLayer;

pub fn logging(level: Level, is_json: bool) {
Expand All @@ -31,7 +25,7 @@ pub fn tracing(level: Level) {
let subscriber = registry()
.with(
OpenTelemetryLayer::new(init_tracer())
.with_exception_field_propagation(true)
.with_error_records_to_exceptions(true)
.with_filter(LevelFilter::from_level(level)),
)
.with(
Expand All @@ -44,18 +38,11 @@ pub fn tracing(level: Level) {
tracing::info!("Tracing resource {:?}", resource());
}

// Create a Resource that captures information about the entity for which telemetry is recorded.
//fn resource() -> Resource {
// Resource::from_schema_url([KeyValue::new(SERVICE_NAME, "app_init")], SCHEMA_URL)
//}
fn resource() -> Resource {
Resource::from_schema_url(
[
KeyValue::new(SERVICE_NAME, env!("CARGO_PKG_NAME")),
KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")),
],
SCHEMA_URL,
)
Resource::new(vec![
KeyValue::new(SERVICE_NAME, env!("CARGO_PKG_NAME")),
KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")),
])
}

// Construct Tracer for OpenTelemetryLayer
Expand Down

0 comments on commit 5c4aaa1

Please sign in to comment.