Skip to content

Telemetry circuit breaker #658

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Telemetry circuit breaker #658

wants to merge 6 commits into from

Conversation

saishreeeee
Copy link
Contributor

@saishreeeee saishreeeee commented Jul 30, 2025

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

Circuit breaker in telemetry to prevent server-side overloading using the PyBreaker library

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

PECOBLR-711

Signed-off-by: Sai Shree Pradhan <[email protected]>
@saishreeeee saishreeeee self-assigned this Jul 30, 2025
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

This reverts commit a5f46eb.

Signed-off-by: Sai Shree Pradhan <[email protected]>
Signed-off-by: Sai Shree Pradhan <[email protected]>
Signed-off-by: Sai Shree Pradhan <[email protected]>
@saishreeeee saishreeeee marked this pull request as ready for review July 30, 2025 14:35
@jprakash-db
Copy link
Contributor

jprakash-db commented Jul 30, 2025

Just confused on why is there even a need for circuit breaker, isn't just handling a good retry mechanism with proper retry behaviour on retry-after time or status code based retry enough? I feel good retry behaviour on TelemetryHttpClient is enough cc @vikrantpuppala

@saishreeeee
Copy link
Contributor Author

Just confused on why is there even a need for circuit breaker, isn't just handling a good retry mechanism with proper retry behaviour on retry-after time or status code based retry enough? I feel good retry behaviour on TelemetryHttpClient is enough cc @vikrantpuppala

The retry behaviour is per request, while the circuit breaker works across requests. So if a certain number of requests fail, for a time interval, no request will be sent to the server.

@@ -11,7 +11,7 @@ You are welcome to file an issue here for general use cases. You can also contac

## Requirements

Python 3.8 or above is required.
Python 3.9 or above is required.
Copy link
Contributor

Choose a reason for hiding this comment

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

@jprakash-db are we ok with python version upgrades?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be ok, given DBT tests pass.

Signed-off-by: Sai Shree Pradhan <[email protected]>
try:
return self.circuit_breaker.call(self.session.post, url, **kwargs)
except CircuitBreakerError as e:
logger.error("Circuit breaker error: %s", e)
Copy link
Contributor

Choose a reason for hiding this comment

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

let's keep all logs pretty much silent for telemetry. use trace instead.

Signed-off-by: Sai Shree Pradhan <[email protected]>
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