Skip to content

Add conditional artificial delay #11139

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
Apr 9, 2025
Merged

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Apr 7, 2025

What this PR does

This PR is a follow up of #10107. I have more uses cases where I need to conditionally enable the artificial delay (for testing purposes) on a large number of tenants that may change over time. The two specific use cases are:

  • Add latency to tenants with a numeric ID greater than X
  • Add latency to tenants with configured max global series < Y

In this PR I'm adding more config options to support such use cases (hidden from the doc, given they're for testing purposes).

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

Signed-off-by: Marco Pracucci <[email protected]>
@pracucci pracucci marked this pull request as ready for review April 7, 2025 09:00
@pracucci pracucci requested a review from a team as a code owner April 7, 2025 09:00
Copy link
Contributor

@NickAnge NickAnge left a comment

Choose a reason for hiding this comment

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

LGtm

Copy link
Contributor

@gotjosh gotjosh left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +137 to +138
IngestionArtificialDelayConditionForTenantsWithIDGreaterThan int `yaml:"ingestion_artificial_delay_condition_for_tenants_with_id_greater_than" json:"ingestion_artificial_delay_condition_for_tenants_with_id_greater_than" category:"experimental" doc:"hidden"`
IngestionArtificialDelayDurationForTenantsWithIDGreaterThan model.Duration `yaml:"ingestion_artificial_delay_duration_for_tenants_with_id_greater_than" json:"ingestion_artificial_delay_duration_for_tenants_with_id_greater_than" category:"experimental" doc:"hidden"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this option is potentially very dangerous as it becomes extremely easy to be greedy with the selection - I was going to suggest logging for this condition so that we can audit the ID selection but this has the potential to be extremely expensive on such a hot path.

I'll leave the judgement up to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see it more risky than the global config option that applies the same latency to all tenants. This option, at most, will apply it to all tenants. What risk do you foresee? Any practical example?

Copy link
Contributor

Choose a reason for hiding this comment

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

When you set it globally, it's because you really want to set it for all tenants.

Maybe, I don't understand the practical use case well enough - but I'm thinking about a scenario where I want to select IDs 1, 2 and 3 so I set it to 0 and then either 4 gets created in gcom or I don't realise there was a 4 to begin with so that also ends up with the latency when I originally didn't want to select it.

It might as well be safe to select an ID that was newly created or wasn't intended, but the point stand that you select something you weren't expecting.

As I said, I don't have a problem with it and feel free to merge/continue it was mostly an observation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok let's discuss it offline.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Discussed offline. Josh is fine.

@pracucci pracucci merged commit 9b74ad3 into main Apr 9, 2025
26 checks passed
@pracucci pracucci deleted the add-conditional-artificial-delay branch April 9, 2025 12:36
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.

3 participants