File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Aspire.Dashboard/Components/Controls Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -170,13 +170,18 @@ protected override async Task OnParametersSetAsync()
170170
171171 private OtlpInstrument ? GetInstrument ( )
172172 {
173+ var endDate = DateTime . UtcNow ;
174+ // Get more data than is being displayed. Histogram graph uses some historical data to calculate bucket counts.
175+ // It's ok to get more data than is needed here. An additional date filter is applied when building chart values.
176+ var startDate = endDate . Subtract ( Duration + TimeSpan . FromSeconds ( 30 ) ) ;
177+
173178 var instrument = TelemetryRepository . GetInstrument ( new GetInstrumentRequest
174179 {
175180 ApplicationServiceId = ApplicationId ,
176181 MeterName = MeterName ,
177182 InstrumentName = InstrumentName ,
178- StartTime = DateTime . UtcNow . Subtract ( Duration ) ,
179- EndTime = DateTime . UtcNow ,
183+ StartTime = startDate ,
184+ EndTime = endDate ,
180185 } ) ;
181186
182187 if ( instrument == null )
You can’t perform that action at this time.
0 commit comments