From 2203f85906f260a93cb73003ba85cbc03f1d6571 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Mon, 18 Nov 2024 15:53:38 -0800 Subject: [PATCH] fix path --- crates/common/src/consts.rs | 1 + crates/llm_gateway/src/filter_context.rs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/common/src/consts.rs b/crates/common/src/consts.rs index b8348ad4..0e6c5b64 100644 --- a/crates/common/src/consts.rs +++ b/crates/common/src/consts.rs @@ -30,3 +30,4 @@ pub const ARCH_MODEL_PREFIX: &str = "Arch"; pub const HALLUCINATION_TEMPLATE: &str = "It seems I'm missing some information. Could you provide the following details "; pub const OTEL_COLLECTOR_HTTP: &str = "opentelemetry_collector_http"; +pub const OTEL_POST_PATH: &str = "/v1/trace"; diff --git a/crates/llm_gateway/src/filter_context.rs b/crates/llm_gateway/src/filter_context.rs index c058af5a..2f73151d 100644 --- a/crates/llm_gateway/src/filter_context.rs +++ b/crates/llm_gateway/src/filter_context.rs @@ -1,6 +1,7 @@ use crate::stream_context::StreamContext; use common::configuration::Configuration; use common::consts::OTEL_COLLECTOR_HTTP; +use common::consts::OTEL_POST_PATH; use common::http::CallArgs; use common::http::Client; use common::llm_providers::LlmProviders; @@ -156,10 +157,10 @@ impl RootContext for FilterContext { debug!("trace: {}", trace_str); let call_args = CallArgs::new( OTEL_COLLECTOR_HTTP, - "/v1/traces", + OTEL_POST_PATH, vec![ - (":method", "POST"), - (":path", "/v1/traces"), + (":method", http::Method::POST.as_str()), + (":path", OTEL_POST_PATH), (":authority", OTEL_COLLECTOR_HTTP), ("content-type", "application/json"), ],