Skip to content

feat(statsd): Measure number of project config attempts [INGEST-1324] #1281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2022

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented May 30, 2022

Track a metric for how often project configs are re-attempted, either because they received a "pending" response or an error response.

#skip-changelog

@jjbayer jjbayer changed the title feat(statsd): Measure number of project config attempts feat(statsd): Measure number of project config attempts [INGEST-1324] May 30, 2022
@jjbayer jjbayer marked this pull request as ready for review May 30, 2022 12:21
@jjbayer jjbayer requested a review from a team May 30, 2022 12:21
Comment on lines +269 to +272
metric!(
histogram(RelayHistograms::ProjectStateAttempts) =
channel.attempts
);
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work with retries? If relay makes an attempt and fails, this will record an attempt. If relay fails the following attempt, does this record 2? So 1 + 2 = 3, when it should be 1 + 1 = 2.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because of the continue on line 253, this code only executes when the endpoint returned an actual state in the configs object. The actual arithmetic on attempts happens on line 203:

channel.attempts += 1;

When a project key is in the pending list, it is re-inserted into state_channels, so it will increment the count:

slf.state_channels.insert(key, channel);

@jjbayer jjbayer merged commit 8fcff0b into master May 30, 2022
@jjbayer jjbayer deleted the feat/measure-number-of-retries branch May 30, 2022 12:48
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.

4 participants