diff --git a/src/otlp.rs b/src/otlp.rs index 043a651b..7b849613 100644 --- a/src/otlp.rs +++ b/src/otlp.rs @@ -21,7 +21,7 @@ //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. use crate::prelude::*; -use opentelemetry::{global, KeyValue}; +use opentelemetry::{global, trace::TracerProvider, KeyValue}; use opentelemetry_http::{HeaderExtractor, Request}; use opentelemetry_otlp::WithExportConfig; use opentelemetry_sdk::{propagation::TraceContextPropagator, Resource}; @@ -31,7 +31,7 @@ use tower_http::{ trace::{MakeSpan, TraceLayer}, }; use tracing::Span; -use tracing_opentelemetry::OpenTelemetrySpanExt; +use tracing_opentelemetry::{OpenTelemetryLayer, OpenTelemetrySpanExt}; use tracing_subscriber::layer::SubscriberExt; pub fn init_tracing() { @@ -58,8 +58,9 @@ pub fn init_tracing() { .install_batch(opentelemetry_sdk::runtime::Tokio) .unwrap(); - let layer = tracing_opentelemetry::layer().with_tracer(tracer_provider); - let subscriber = subscriber.with(layer); + let subscriber = subscriber.with(OpenTelemetryLayer::new( + tracer_provider.tracer("feedback-fusion"), + )); tracing::subscriber::set_global_default(subscriber).ok(); } } diff --git a/src/services/v1/response.rs b/src/services/v1/response.rs index 62260934..a98d5ee2 100644 --- a/src/services/v1/response.rs +++ b/src/services/v1/response.rs @@ -144,7 +144,7 @@ pub async fn get_responses( "Select responses by id" )? .into_iter() - .group_by(|value| value.response().clone()) + .chunk_by(|value| value.response().clone()) .into_iter() .map(|(key, value)| { let value = FieldResponseList {