Skip to content

Commit fde5f9a

Browse files
committed
fix tests
1 parent aff7824 commit fde5f9a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

nix/common.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{
1616
cargoTOML = builtins.fromTOML (builtins.readFile ../Cargo.toml);
1717
outputHashes = {
18-
"azalia-0.1.0" = "sha256-+fvpmHxO/QPQlDU7GMARx3oIJuEcCjrDj4xfaUc4CX8=";
18+
"azalia-0.1.0" = "sha256-y0crnoet3Jg1+UA86K6ucPb6tv98f895vyjt02dgAAE=";
1919
};
2020

2121
rustflags = stdenv:

src/config/tracing.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ mod tests {
156156
S {
157157
tracing: Config::OpenTelemetry(otel::Config::default())
158158
},
159-
hcl::from_str("tracing \"opentelemetry\" {\n kind = \"grpc\"\n url = \"grpc://localhost:4318\"\n}\n")
160-
.unwrap()
159+
hcl::from_str("tracing \"opentelemetry\" {\n url = \"grpc://localhost:4318\"\n}\n").unwrap()
161160
);
162161

163162
assert_eq!(

src/config/tracing/otel.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub struct Config {
7676
pub labels: HashMap<String, String>,
7777

7878
/// Which kind of OpenTelemetry Collector we should configure for?
79-
#[serde(default)]
79+
#[serde(default, skip_serializing_if = "Option::is_none")]
8080
#[deprecated(
8181
since = "4.0.6",
8282
note = "this field will be removed in v4.1.0, ume will determine the kind of collector from the url's scheme"
@@ -96,8 +96,10 @@ impl TryFromEnv for Config {
9696
Ok(Config {
9797
kind: match env!("UME_TRACING_OTEL_COLLECTOR") {
9898
Ok(res) => match res.as_str() {
99-
"grpc" | "grpcs" | "" => Some(Kind::Grpc),
99+
"grpc" | "grpcs" => Some(Kind::Grpc),
100100
"http" | "https" => Some(Kind::Http),
101+
"" => None,
102+
101103
out => return Err(eyre!(format!("unknown otel collector kind [{out}]"))),
102104
},
103105

0 commit comments

Comments
 (0)