@@ -29,16 +29,19 @@ use tracing::error;
29
29
use crate :: {
30
30
alerts:: { ALERTS , AlertError , AlertsSummary , get_alerts_summary} ,
31
31
correlation:: { CORRELATIONS , CorrelationError } ,
32
- event:: format:: LogSource ,
33
- handlers:: http:: { cluster:: fetch_daily_stats, logstream:: error:: StreamError } ,
32
+ handlers:: {
33
+ TelemetryType ,
34
+ http:: { cluster:: fetch_daily_stats, logstream:: error:: StreamError } ,
35
+ } ,
34
36
parseable:: PARSEABLE ,
35
37
rbac:: { Users , map:: SessionKey , role:: Action } ,
36
38
stats:: Stats ,
37
39
storage:: { ObjectStorageError , ObjectStoreFormat , STREAM_ROOT_DIRECTORY , StreamType } ,
38
40
users:: { dashboards:: DASHBOARDS , filters:: FILTERS } ,
39
41
} ;
40
42
41
- type StreamMetadataResponse = Result < ( String , Vec < ObjectStoreFormat > , DataSetType ) , PrismHomeError > ;
43
+ type StreamMetadataResponse =
44
+ Result < ( String , Vec < ObjectStoreFormat > , TelemetryType ) , PrismHomeError > ;
42
45
43
46
#[ derive( Debug , Serialize , Default ) ]
44
47
pub struct DatedStats {
@@ -48,17 +51,10 @@ pub struct DatedStats {
48
51
storage : u64 ,
49
52
}
50
53
51
- #[ derive( Debug , Serialize ) ]
52
- enum DataSetType {
53
- Logs ,
54
- Metrics ,
55
- Traces ,
56
- }
57
-
58
54
#[ derive( Debug , Serialize ) ]
59
55
pub struct DataSet {
60
56
title : String ,
61
- dataset_type : DataSetType ,
57
+ dataset_type : TelemetryType ,
62
58
}
63
59
64
60
#[ derive( Debug , Serialize ) ]
@@ -208,7 +204,7 @@ fn get_top_5_streams_by_ingestion(
208
204
209
205
async fn get_stream_metadata (
210
206
stream : String ,
211
- ) -> Result < ( String , Vec < ObjectStoreFormat > , DataSetType ) , PrismHomeError > {
207
+ ) -> Result < ( String , Vec < ObjectStoreFormat > , TelemetryType ) , PrismHomeError > {
212
208
let path = RelativePathBuf :: from_iter ( [ & stream, STREAM_ROOT_DIRECTORY ] ) ;
213
209
let obs = PARSEABLE
214
210
. storage
@@ -237,18 +233,7 @@ async fn get_stream_metadata(
237
233
) ) ) ;
238
234
}
239
235
240
- // let log_source = &stream_jsons[0].clone().log_source;
241
- let log_source_format = stream_jsons
242
- . iter ( )
243
- . find ( |sj| !sj. log_source . is_empty ( ) )
244
- . map ( |sj| sj. log_source [ 0 ] . log_source_format . clone ( ) )
245
- . unwrap_or_default ( ) ;
246
-
247
- let dataset_type = match log_source_format {
248
- LogSource :: OtelMetrics => DataSetType :: Metrics ,
249
- LogSource :: OtelTraces => DataSetType :: Traces ,
250
- _ => DataSetType :: Logs ,
251
- } ;
236
+ let dataset_type = stream_jsons[ 0 ] . telemetry_type ;
252
237
253
238
Ok ( ( stream, stream_jsons, dataset_type) )
254
239
}
0 commit comments