Skip to content

Commit

Permalink
[PLATFORM-1112]: Check country tag not appearing in traces (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiemontese authored May 30, 2023
1 parent 14187ed commit 3405761
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "prima-tracing"
version = "0.6.0"
license = "MIT OR Apache-2.0"
readme = "README.md"
authors = ["Enrico Risa <[email protected]>"]
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 = []
Expand All @@ -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"]

Expand All @@ -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"]}
4 changes: 4 additions & 0 deletions src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pub fn configure<T>(config: &SubscriberConfig<T>) -> 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(),
Expand Down

0 comments on commit 3405761

Please sign in to comment.