@@ -160,7 +160,7 @@ pub async fn setup_otel_stream(
160
160
expected_log_source : LogSource ,
161
161
known_fields : & [ & str ] ,
162
162
telemetry_type : TelemetryType ,
163
- ) -> Result < ( String , LogSource , LogSourceEntry ) , PostError > {
163
+ ) -> Result < ( String , LogSource , LogSourceEntry , Option < String > ) , PostError > {
164
164
let Some ( stream_name) = req. headers ( ) . get ( STREAM_NAME_HEADER_KEY ) else {
165
165
return Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) ) ;
166
166
} ;
@@ -190,7 +190,7 @@ pub async fn setup_otel_stream(
190
190
telemetry_type,
191
191
)
192
192
. await ?;
193
-
193
+ let mut time_partition = None ;
194
194
// Validate stream compatibility
195
195
if let Ok ( stream) = PARSEABLE . get_stream ( & stream_name) {
196
196
match log_source {
@@ -217,13 +217,15 @@ pub async fn setup_otel_stream(
217
217
}
218
218
_ => { }
219
219
}
220
+
221
+ time_partition = stream. get_time_partition ( ) ;
220
222
}
221
223
222
224
PARSEABLE
223
225
. add_update_log_source ( & stream_name, log_source_entry. clone ( ) )
224
226
. await ?;
225
227
226
- Ok ( ( stream_name, log_source, log_source_entry) )
228
+ Ok ( ( stream_name, log_source, log_source_entry, time_partition ) )
227
229
}
228
230
229
231
// Common content processing for OTEL ingestion
@@ -278,7 +280,7 @@ pub async fn handle_otel_logs_ingestion(
278
280
req : HttpRequest ,
279
281
body : web:: Bytes ,
280
282
) -> Result < HttpResponse , PostError > {
281
- let ( stream_name, log_source, _) = setup_otel_stream (
283
+ let ( stream_name, log_source, _, _ ) = setup_otel_stream (
282
284
& req,
283
285
LogSource :: OtelLogs ,
284
286
& OTEL_LOG_KNOWN_FIELD_LIST ,
@@ -298,7 +300,7 @@ pub async fn handle_otel_metrics_ingestion(
298
300
req : HttpRequest ,
299
301
body : web:: Bytes ,
300
302
) -> Result < HttpResponse , PostError > {
301
- let ( stream_name, log_source, _) = setup_otel_stream (
303
+ let ( stream_name, log_source, _, _ ) = setup_otel_stream (
302
304
& req,
303
305
LogSource :: OtelMetrics ,
304
306
& OTEL_METRICS_KNOWN_FIELD_LIST ,
@@ -318,7 +320,7 @@ pub async fn handle_otel_traces_ingestion(
318
320
req : HttpRequest ,
319
321
body : web:: Bytes ,
320
322
) -> Result < HttpResponse , PostError > {
321
- let ( stream_name, log_source, _) = setup_otel_stream (
323
+ let ( stream_name, log_source, _, _ ) = setup_otel_stream (
322
324
& req,
323
325
LogSource :: OtelTraces ,
324
326
& OTEL_TRACES_KNOWN_FIELD_LIST ,
0 commit comments