@@ -219,10 +219,11 @@ pub async fn ingest_internal_stream(
219219 Ok ( ( ) )
220220}
221221
222- // Common validation and setup for OTEL ingestion
222+ // Common validation and setup for OTEL ingestion. The endpoint determines the log source, so
223+ // clients do not need to provide x-p-log-source.
223224pub async fn setup_otel_stream (
224225 req : & HttpRequest ,
225- expected_log_source : LogSource ,
226+ log_source : LogSource ,
226227 known_fields : & [ & str ] ,
227228 telemetry_type : TelemetryType ,
228229 dataset_tags : Vec < DatasetTag > ,
@@ -232,18 +233,6 @@ pub async fn setup_otel_stream(
232233 return Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) ) ;
233234 } ;
234235
235- let Some ( log_source) = req. headers ( ) . get ( LOG_SOURCE_KEY ) else {
236- return Err ( PostError :: Header ( ParseHeaderError :: MissingLogSource ) ) ;
237- } ;
238-
239- let log_source = LogSource :: from ( log_source. to_str ( ) . unwrap ( ) ) ;
240- if log_source != expected_log_source {
241- return Err ( PostError :: IncorrectLogSource (
242- expected_log_source,
243- telemetry_type. to_string ( ) ,
244- ) ) ;
245- }
246-
247236 let stream_name = stream_name. to_str ( ) . unwrap ( ) . to_owned ( ) ;
248237
249238 let log_source_entry = LogSourceEntry :: new (
@@ -531,8 +520,6 @@ pub enum PostError {
531520 OtelNotSupported ( String ) ,
532521 #[ error( "The stream {0} is reserved for internal use and cannot be ingested into" ) ]
533522 InternalStream ( String ) ,
534- #[ error( r#"Please use "x-p-log-source: {0}" for ingesting otel {1} data"# ) ]
535- IncorrectLogSource ( LogSource , String ) ,
536523 #[ error( "Ingestion is not allowed in Query mode" ) ]
537524 IngestionNotAllowed ,
538525 #[ error( "Missing field for time partition in json: {0}" ) ]
@@ -563,7 +550,6 @@ impl actix_web::ResponseError for PostError {
563550 | Header ( _)
564551 | Invalid ( _)
565552 | InternalStream ( _)
566- | IncorrectLogSource ( _, _)
567553 | IngestionNotAllowed
568554 | MissingTimePartition ( _)
569555 | KnownFormat ( _)
0 commit comments