From 50272011d0faeedae0bbca5dda4c8305b1dd278f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:37:05 +0100 Subject: [PATCH] feat(deps): update rust crate axum to 0.8 (#197) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.toml | 2 +- .../src/middleware/trace_extractor.rs | 4 ++-- deny.toml | 7 +++++-- ...testing_tracing_opentelemetry__call_with_w3c_trace.snap | 6 +++--- ...cing_opentelemetry__call_with_w3c_trace_otel_spans.snap | 6 +++--- ...g_tracing_opentelemetry__extract_route_from_nested.snap | 6 +++--- ...pentelemetry__extract_route_from_nested_otel_spans.snap | 6 +++--- ...testing_tracing_opentelemetry__filled_http_headers.snap | 6 +++--- ...cing_opentelemetry__filled_http_headers_otel_spans.snap | 6 +++--- ...pentelemetry__filled_http_route_for_existing_route.snap | 6 +++--- ...y__filled_http_route_for_existing_route_otel_spans.snap | 6 +++--- ...tracing_opentelemetry__status_code_on_close_for_ok.snap | 6 +++--- ...ntelemetry__status_code_on_close_for_ok_otel_spans.snap | 6 +++--- 13 files changed, 38 insertions(+), 35 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 31c5071..5ef0b2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ rust-version = "1.80.0" [workspace.dependencies] assert2 = "0.3" -axum = { version = "0.7", default-features = false } +axum = { version = "0.8", default-features = false } http = "^1" hyper = "1" insta = { version = "1.40", features = ["yaml", "redactions"] } diff --git a/axum-tracing-opentelemetry/src/middleware/trace_extractor.rs b/axum-tracing-opentelemetry/src/middleware/trace_extractor.rs index a294f0e..535e600 100644 --- a/axum-tracing-opentelemetry/src/middleware/trace_extractor.rs +++ b/axum-tracing-opentelemetry/src/middleware/trace_extractor.rs @@ -212,7 +212,7 @@ mod tests { let mut fake_env = FakeEnvironment::setup().await; { let mut svc = Router::new() - .route("/users/:id", get(|| async { StatusCode::OK })) + .route("/users/{id}", get(|| async { StatusCode::OK })) .route( "/status/500", get(|| async { StatusCode::INTERNAL_SERVER_ERROR }), @@ -231,7 +231,7 @@ mod tests { .nest( "/nest", Router::new() - .route("/:nest_id", get(|| async {})) + .route("/{nest_id}", get(|| async {})) .fallback(|| async { (StatusCode::NOT_FOUND, "inner fallback") }), ) .fallback(|| async { (StatusCode::NOT_FOUND, "outer fallback") }) diff --git a/deny.toml b/deny.toml index 9771fa0..54eff16 100644 --- a/deny.toml +++ b/deny.toml @@ -208,8 +208,11 @@ deny = [ skip = [ #"ansi_term@0.11.0", #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, - "tower@0.4", # axum 0.7 use tower 0.5, but hyper still use 0.4 - "sync_wrapper", # axum direct and transive dependency use multiple version + "axum@0.7", # tonic depend on axum 0.7 + "axum-core@0.4", # tonic depend on axum 0.7 + "matchit@0.7", # tonic depend on axum 0.7 + "tower@0.4", # axum 0.7 use tower 0.5, but hyper still use 0.4 + # "sync_wrapper", # axum direct and transive dependency use multiple version "regex-syntax", "regex-automata", "indexmap", diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace.snap index eceb7ea..a422f42 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace.snap @@ -1,6 +1,7 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: tracing_events +snapshot_kind: text --- - fields: message: new @@ -27,11 +28,11 @@ expression: tracing_events span: http.request.method: GET http.response.status_code: 200 - http.route: "/users/:id" + http.route: "/users/{id}" name: HTTP request network.protocol.version: "1.1" otel.kind: Server - otel.name: "GET /users/:id" + otel.name: "GET /users/{id}" server.address: "" span.type: web url.path: /users/123 @@ -40,4 +41,3 @@ expression: tracing_events spans: [] target: "otel::tracing" timestamp: "[timestamp]" - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace_otel_spans.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace_otel_spans.snap index 4bdd5ff..655b9d8 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace_otel_spans.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__call_with_w3c_trace_otel_spans.snap @@ -1,12 +1,13 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: otel_spans +snapshot_kind: text --- - trace_id: "[trace_id:lg32]" span_id: "[span_id:lg16]" trace_state: "" parent_span_id: "[span_id:lg16]" - name: "GET /users/:id" + name: "GET /users/{id}" kind: SPAN_KIND_SERVER start_time_unix_nano: "[timestamp]" end_time_unix_nano: "[timestamp]" @@ -17,7 +18,7 @@ expression: otel_spans code.namespace: "Some(AnyValue { value: Some(StringValue(\"tracing_opentelemetry_instrumentation_sdk::http::http_server\")) })" http.request.method: "Some(AnyValue { value: Some(StringValue(\"GET\")) })" http.response.status_code: "Some(AnyValue { value: Some(StringValue(\"200\")) })" - http.route: "Some(AnyValue { value: Some(StringValue(\"/users/:id\")) })" + http.route: "Some(AnyValue { value: Some(StringValue(\"/users/{id}\")) })" idle_ns: ignore network.protocol.version: "Some(AnyValue { value: Some(StringValue(\"1.1\")) })" server.address: "Some(AnyValue { value: Some(StringValue(\"\")) })" @@ -35,4 +36,3 @@ expression: otel_spans status: message: "" code: STATUS_CODE_UNSET - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested.snap index 4797012..97a110f 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested.snap @@ -1,6 +1,7 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: tracing_events +snapshot_kind: text --- - fields: message: new @@ -27,11 +28,11 @@ expression: tracing_events span: http.request.method: GET http.response.status_code: 200 - http.route: "/nest/:nest_id" + http.route: "/nest/{nest_id}" name: HTTP request network.protocol.version: "1.1" otel.kind: Server - otel.name: "GET /nest/:nest_id" + otel.name: "GET /nest/{nest_id}" server.address: "" span.type: web url.path: /nest/123 @@ -40,4 +41,3 @@ expression: tracing_events spans: [] target: "otel::tracing" timestamp: "[timestamp]" - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested_otel_spans.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested_otel_spans.snap index b38b838..2afd248 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested_otel_spans.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__extract_route_from_nested_otel_spans.snap @@ -1,12 +1,13 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: otel_spans +snapshot_kind: text --- - trace_id: "[trace_id:lg32]" span_id: "[span_id:lg16]" trace_state: "" parent_span_id: "[span_id:lg0]" - name: "GET /nest/:nest_id" + name: "GET /nest/{nest_id}" kind: SPAN_KIND_SERVER start_time_unix_nano: "[timestamp]" end_time_unix_nano: "[timestamp]" @@ -17,7 +18,7 @@ expression: otel_spans code.namespace: "Some(AnyValue { value: Some(StringValue(\"tracing_opentelemetry_instrumentation_sdk::http::http_server\")) })" http.request.method: "Some(AnyValue { value: Some(StringValue(\"GET\")) })" http.response.status_code: "Some(AnyValue { value: Some(StringValue(\"200\")) })" - http.route: "Some(AnyValue { value: Some(StringValue(\"/nest/:nest_id\")) })" + http.route: "Some(AnyValue { value: Some(StringValue(\"/nest/{nest_id}\")) })" idle_ns: ignore network.protocol.version: "Some(AnyValue { value: Some(StringValue(\"1.1\")) })" server.address: "Some(AnyValue { value: Some(StringValue(\"\")) })" @@ -35,4 +36,3 @@ expression: otel_spans status: message: "" code: STATUS_CODE_UNSET - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers.snap index 0886afe..f51c660 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers.snap @@ -1,6 +1,7 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: tracing_events +snapshot_kind: text --- - fields: message: new @@ -27,11 +28,11 @@ expression: tracing_events span: http.request.method: GET http.response.status_code: 200 - http.route: "/users/:id" + http.route: "/users/{id}" name: HTTP request network.protocol.version: "1.1" otel.kind: Server - otel.name: "GET /users/:id" + otel.name: "GET /users/{id}" server.address: "" span.type: web url.path: /users/123 @@ -40,4 +41,3 @@ expression: tracing_events spans: [] target: "otel::tracing" timestamp: "[timestamp]" - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers_otel_spans.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers_otel_spans.snap index c970f10..9c0b4c7 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers_otel_spans.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_headers_otel_spans.snap @@ -1,12 +1,13 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: otel_spans +snapshot_kind: text --- - trace_id: "[trace_id:lg32]" span_id: "[span_id:lg16]" trace_state: "" parent_span_id: "[span_id:lg0]" - name: "GET /users/:id" + name: "GET /users/{id}" kind: SPAN_KIND_SERVER start_time_unix_nano: "[timestamp]" end_time_unix_nano: "[timestamp]" @@ -17,7 +18,7 @@ expression: otel_spans code.namespace: "Some(AnyValue { value: Some(StringValue(\"tracing_opentelemetry_instrumentation_sdk::http::http_server\")) })" http.request.method: "Some(AnyValue { value: Some(StringValue(\"GET\")) })" http.response.status_code: "Some(AnyValue { value: Some(StringValue(\"200\")) })" - http.route: "Some(AnyValue { value: Some(StringValue(\"/users/:id\")) })" + http.route: "Some(AnyValue { value: Some(StringValue(\"/users/{id}\")) })" idle_ns: ignore network.protocol.version: "Some(AnyValue { value: Some(StringValue(\"1.1\")) })" server.address: "Some(AnyValue { value: Some(StringValue(\"\")) })" @@ -35,4 +36,3 @@ expression: otel_spans status: message: "" code: STATUS_CODE_UNSET - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route.snap index c89b22c..946920e 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route.snap @@ -1,6 +1,7 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: tracing_events +snapshot_kind: text --- - fields: message: new @@ -27,11 +28,11 @@ expression: tracing_events span: http.request.method: GET http.response.status_code: 200 - http.route: "/users/:id" + http.route: "/users/{id}" name: HTTP request network.protocol.version: "1.1" otel.kind: Server - otel.name: "GET /users/:id" + otel.name: "GET /users/{id}" server.address: example.com span.type: web url.path: /users/123 @@ -40,4 +41,3 @@ expression: tracing_events spans: [] target: "otel::tracing" timestamp: "[timestamp]" - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route_otel_spans.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route_otel_spans.snap index 78b1558..760e569 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route_otel_spans.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__filled_http_route_for_existing_route_otel_spans.snap @@ -1,12 +1,13 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: otel_spans +snapshot_kind: text --- - trace_id: "[trace_id:lg32]" span_id: "[span_id:lg16]" trace_state: "" parent_span_id: "[span_id:lg0]" - name: "GET /users/:id" + name: "GET /users/{id}" kind: SPAN_KIND_SERVER start_time_unix_nano: "[timestamp]" end_time_unix_nano: "[timestamp]" @@ -17,7 +18,7 @@ expression: otel_spans code.namespace: "Some(AnyValue { value: Some(StringValue(\"tracing_opentelemetry_instrumentation_sdk::http::http_server\")) })" http.request.method: "Some(AnyValue { value: Some(StringValue(\"GET\")) })" http.response.status_code: "Some(AnyValue { value: Some(StringValue(\"200\")) })" - http.route: "Some(AnyValue { value: Some(StringValue(\"/users/:id\")) })" + http.route: "Some(AnyValue { value: Some(StringValue(\"/users/{id}\")) })" idle_ns: ignore network.protocol.version: "Some(AnyValue { value: Some(StringValue(\"1.1\")) })" server.address: "Some(AnyValue { value: Some(StringValue(\"example.com\")) })" @@ -35,4 +36,3 @@ expression: otel_spans status: message: "" code: STATUS_CODE_UNSET - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok.snap index eceb7ea..a422f42 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok.snap @@ -1,6 +1,7 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: tracing_events +snapshot_kind: text --- - fields: message: new @@ -27,11 +28,11 @@ expression: tracing_events span: http.request.method: GET http.response.status_code: 200 - http.route: "/users/:id" + http.route: "/users/{id}" name: HTTP request network.protocol.version: "1.1" otel.kind: Server - otel.name: "GET /users/:id" + otel.name: "GET /users/{id}" server.address: "" span.type: web url.path: /users/123 @@ -40,4 +41,3 @@ expression: tracing_events spans: [] target: "otel::tracing" timestamp: "[timestamp]" - diff --git a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok_otel_spans.snap b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok_otel_spans.snap index a3486c3..0747a97 100644 --- a/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok_otel_spans.snap +++ b/testing-tracing-opentelemetry/src/snapshots/testing_tracing_opentelemetry__status_code_on_close_for_ok_otel_spans.snap @@ -1,12 +1,13 @@ --- source: testing-tracing-opentelemetry/src/lib.rs expression: otel_spans +snapshot_kind: text --- - trace_id: "[trace_id:lg32]" span_id: "[span_id:lg16]" trace_state: "" parent_span_id: "[span_id:lg0]" - name: "GET /users/:id" + name: "GET /users/{id}" kind: SPAN_KIND_SERVER start_time_unix_nano: "[timestamp]" end_time_unix_nano: "[timestamp]" @@ -17,7 +18,7 @@ expression: otel_spans code.namespace: "Some(AnyValue { value: Some(StringValue(\"tracing_opentelemetry_instrumentation_sdk::http::http_server\")) })" http.request.method: "Some(AnyValue { value: Some(StringValue(\"GET\")) })" http.response.status_code: "Some(AnyValue { value: Some(StringValue(\"200\")) })" - http.route: "Some(AnyValue { value: Some(StringValue(\"/users/:id\")) })" + http.route: "Some(AnyValue { value: Some(StringValue(\"/users/{id}\")) })" idle_ns: ignore network.protocol.version: "Some(AnyValue { value: Some(StringValue(\"1.1\")) })" server.address: "Some(AnyValue { value: Some(StringValue(\"\")) })" @@ -35,4 +36,3 @@ expression: otel_spans status: message: "" code: STATUS_CODE_UNSET -