:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(metrics): return protobuf acknowledgments in capture-apm-metrics (#115138)
posthog[bot]9b4f8cec1b3a
diff --git a/rust/capture-apm-metrics/src/service.rs b/rust/capture-apm-metrics/src/service.rsindex 683c568b854b..bdf53afebfee 100644--- a/rust/capture-apm-metrics/src/service.rs+++ b/rust/capture-apm-metrics/src/service.rs@@ -11,13 +11,13 @@ use axum::{extract::Query,extract::State,http::{HeaderMap, StatusCode},- response::Json,+ response::{Json, Response},};use bytes::Bytes;use capture_logs::authorizer::{Authorizer, Signal};use capture_logs::kafka::KafkaSink;use capture_logs::metric_record::{flatten_metric, KafkaMetricRow};-use capture_logs::service::parse_otel_metrics_message;+use capture_logs::service::{export_success_response, parse_otel_metrics_message};use common_compression::{decompress_gzip_capped, has_gzip_magic_header, CompressionError};use opentelemetry_proto::tonic::collector::metrics::v1::ExportMetricsServiceRequest;use prost::Message;@@ -102,7 +102,7 @@ pub async fn export_metrics_http(Query(query_params): Query<QueryParams>,headers: HeaderMap,body: Bytes,-) -> Result<Json<serde_json::Value>, (StatusCode, Json<serde_json::Value>)> {+) -> Result<Response, (StatusCode, Json<serde_json::Value>)> {let token =service.authorizer@@ -185,5 +185,5 @@ pub async fn export_metrics_http();}- Ok(Json(json!({})))+ Ok(export_success_response(&headers))}diff --git a/rust/capture-logs/src/service.rs b/rust/capture-logs/src/service.rsindex 29ffcafe0283..4b079ea5825b 100644--- a/rust/capture-logs/src/service.rs+++ b/rust/capture-logs/src/service.rs@@ -398,7 +398,7 @@ pub(crate) fn decode_body_if_gzip_magic(}/// Protobuf clients can't decode a JSON body.-fn export_success_response(headers: &HeaderMap) -> Response {+pub fn export_success_response(headers: &HeaderMap) -> Response {let is_protobuf = headers.get(CONTENT_TYPE).and_then(|v| v.to_str().ok())