@@ -40,8 +40,15 @@ use crate::{
40
40
users:: { dashboards:: DASHBOARDS , filters:: FILTERS } ,
41
41
} ;
42
42
43
- type StreamMetadataResponse =
44
- Result < ( String , Vec < ObjectStoreFormat > , TelemetryType ) , PrismHomeError > ;
43
+ type StreamMetadataResponse = Result <
44
+ (
45
+ String ,
46
+ Vec < ObjectStoreFormat > ,
47
+ TelemetryType ,
48
+ Option < String > ,
49
+ ) ,
50
+ PrismHomeError ,
51
+ > ;
45
52
46
53
#[ derive( Debug , Serialize , Default ) ]
47
54
pub struct DatedStats {
@@ -55,6 +62,8 @@ pub struct DatedStats {
55
62
pub struct DataSet {
56
63
title : String ,
57
64
dataset_type : TelemetryType ,
65
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
66
+ time_partition : Option < String > ,
58
67
}
59
68
60
69
#[ derive( Debug , Serialize ) ]
@@ -120,7 +129,7 @@ pub async fn generate_home_response(
120
129
121
130
for result in stream_metadata_results {
122
131
match result {
123
- Ok ( ( stream, metadata, dataset_type) ) => {
132
+ Ok ( ( stream, metadata, dataset_type, time_partition ) ) => {
124
133
// Skip internal streams if the flag is false
125
134
if !include_internal
126
135
&& metadata
@@ -133,6 +142,7 @@ pub async fn generate_home_response(
133
142
datasets. push ( DataSet {
134
143
title : stream,
135
144
dataset_type,
145
+ time_partition,
136
146
} ) ;
137
147
}
138
148
Err ( e) => {
@@ -204,7 +214,15 @@ fn get_top_5_streams_by_ingestion(
204
214
205
215
async fn get_stream_metadata (
206
216
stream : String ,
207
- ) -> Result < ( String , Vec < ObjectStoreFormat > , TelemetryType ) , PrismHomeError > {
217
+ ) -> Result <
218
+ (
219
+ String ,
220
+ Vec < ObjectStoreFormat > ,
221
+ TelemetryType ,
222
+ Option < String > ,
223
+ ) ,
224
+ PrismHomeError ,
225
+ > {
208
226
let path = RelativePathBuf :: from_iter ( [ & stream, STREAM_ROOT_DIRECTORY ] ) ;
209
227
let obs = PARSEABLE
210
228
. storage
@@ -234,8 +252,9 @@ async fn get_stream_metadata(
234
252
}
235
253
236
254
let dataset_type = stream_jsons[ 0 ] . telemetry_type ;
255
+ let time_partition = stream_jsons[ 0 ] . time_partition . clone ( ) ;
237
256
238
- Ok ( ( stream, stream_jsons, dataset_type) )
257
+ Ok ( ( stream, stream_jsons, dataset_type, time_partition ) )
239
258
}
240
259
241
260
async fn stats_for_date (
0 commit comments