diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c30403..15424cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Next] +## [0.6.1] - 2023-05-30 + +### Changed + +- `country` is actually added as an attribute to traces + ## [0.6.0] - 2023-05-26 ### Added @@ -60,7 +66,8 @@ If you are using Jaeger to collect traces locally on your machine, you will need COLLECTOR_OTLP_HTTP_HOST_PORT: 55681 ``` -[Next]: https://github.com/primait/prima_tracing.rs/compare/0.6.0...HEAD +[Next]: https://github.com/primait/prima_tracing.rs/compare/0.6.1...HEAD +[0.6.1]: https://github.com/primait/prima_tracing.rs/compare/0.6.0...0.6.1 [0.6.0]: https://github.com/primait/prima_tracing.rs/compare/0.5.0...0.6.0 [0.5.0]: https://github.com/primait/prima_tracing.rs/compare/0.4.0...0.5.0 [0.4.0]: https://github.com/primait/prima_tracing.rs/compare/0.3.1...0.4.0 diff --git a/Cargo.toml b/Cargo.toml index 9e43eff..dacfb5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "prima-tracing" -version = "0.6.0" -license = "MIT OR Apache-2.0" -readme = "README.md" authors = ["Enrico Risa "] -edition = "2021" description = "Prima.it opentelemetry standard library" +edition = "2021" +license = "MIT OR Apache-2.0" +name = "prima-tracing" +readme = "README.md" repository = "https://github.com/primait/prima_tracing.rs" +version = "0.6.1" [features] default = [] @@ -15,13 +15,13 @@ prima-logger-datadog = ["datadog"] prima-logger-json = ["json-logger"] prima-telemetry = ["traces"] -json-logger = [] datadog = ["json-logger", "opentelemetry", "tracing-opentelemetry"] +json-logger = [] traces = ["tracing-opentelemetry", "opentelemetry", "opentelemetry-otlp"] # feature sets most likely used in given environment -live = [ "json-logger", "datadog", "traces" ] -dev = [ "traces" ] +dev = ["traces"] +live = ["json-logger", "datadog", "traces"] rt-tokio-current-thread = ["opentelemetry/rt-tokio-current-thread"] @@ -37,23 +37,23 @@ required-features = ["json-logger"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -opentelemetry = { version = "0.19", features = ["rt-tokio"], optional = true } -opentelemetry-otlp = { version = "0.12", features = ["http-proto", "reqwest-client"], default-features = false, optional = true } -tracing = { version = "0.1", features = ["max_level_debug", "release_max_level_info"] } -tracing-opentelemetry = { version = "0.19", optional = true } -tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tracing-log = { version = "0.1" } +opentelemetry = {version = "0.19", features = ["rt-tokio"], optional = true} +opentelemetry-otlp = {version = "0.12", features = ["http-proto", "reqwest-client"], default-features = false, optional = true} +tracing = {version = "0.1", features = ["max_level_debug", "release_max_level_info"]} +tracing-log = {version = "0.1"} +tracing-opentelemetry = {version = "0.19", optional = true} +tracing-subscriber = {version = "0.3", features = ["env-filter"]} # serialization/deserialization -serde = { version = "^1.0", features = ["derive"] } +serde = {version = "^1.0", features = ["derive"]} # json serialization serde_json = "^1.0" # dates -chrono = { version = "^0.4", default-features = false, features = ["serde", "clock"] } +chrono = {version = "^0.4", default-features = false, features = ["serde", "clock"]} [dev-dependencies] actix-web = "4.0.1" -tracing-actix-web = { version = "0.7.0", features = ["opentelemetry_0_19"] } prima_bridge = "0.13" -tokio = { version = "1.17", features = ["rt", "macros", "rt-multi-thread"] } +tokio = {version = "1.17", features = ["rt", "macros", "rt-multi-thread"]} +tracing-actix-web = {version = "0.7.0", features = ["opentelemetry_0_19"]} diff --git a/src/telemetry.rs b/src/telemetry.rs index 107e0ab..2750210 100644 --- a/src/telemetry.rs +++ b/src/telemetry.rs @@ -41,6 +41,10 @@ pub fn configure(config: &SubscriberConfig) -> Tracer { "environment", config.env.to_string(), )])) + .with_resource(Resource::new(vec![KeyValue::new( + "country", + config.country.to_string(), + )])) .with_resource(Resource::new(vec![KeyValue::new( "service.name", telemetry.service_name.clone(),