Skip to content

Collect more historical data from cloud-based brokers#5522

Open
mikeminutillo wants to merge 1 commit into
masterfrom
collect-more-data-cloud
Open

Collect more historical data from cloud-based brokers#5522
mikeminutillo wants to merge 1 commit into
masterfrom
collect-more-data-cloud

Conversation

@mikeminutillo

Copy link
Copy Markdown
Member
  • AWS 365 days
  • Azure 90 days

Matches a similar change made in the endpoint throughput tool.

@mikeminutillo mikeminutillo requested a review from PhilBastian June 8, 2026 06:46
@mikeminutillo mikeminutillo self-assigned this Jun 8, 2026
: endpoint.LastCollectedDate.AddDays(1);

await foreach (var queueThroughput in brokerThroughputQuery.GetThroughputPerDay(queueName, startDate, stoppingToken))
await foreach (var queueThroughput in brokerThroughputQuery.GetThroughputPerDay(queueName, endpoint.LastCollectedDate.AddDays(1), stoppingToken))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a side issue, but can we validate the .AddDays(1)? I remember looking at this a while back and working out that every time the ServiceControl service is restarted for any reason, we lose a day of data collection for some transports

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would happen for RabbitMQ and SQL, which do not use this date at all. Their broker queries start when they are called and run for 24 hours before returning. If they stop mid-collection, all of the collected data is lost and the timer starts again.

For Azure and SQS (which do use this date), I believe the behavior is correct. Query for the last date we have data for and then start collection from the next day.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would still mean that if, on ASB or SQS, someone closed ServiceControl at 1AM on 1/1 and started it again 2 days later, we would lose 23 hours of data from 1/1 and only start again from 2/1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't. The behavior of Azure and SQS is to collect data from the day after the last recorded date up to yesterday. We never get partial days of data. So in the example you gave, we would not have recorded anything for the day when the service stops at 1am. But when you restart 2 days later we'll query for that day and the day after.

{
startDate = earliestQueryDate;
}
var endDate = today.AddDays(-1); // Query date up to but not including today

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment exists here but not on ASB, however it doesn't explain why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants