Skip to content
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

Refactor Http Client implementation #1741

Merged
merged 13 commits into from
Nov 13, 2024
Merged

Refactor Http Client implementation #1741

merged 13 commits into from
Nov 13, 2024

Conversation

tylerwowen
Copy link
Contributor

@tylerwowen tylerwowen commented Nov 6, 2024

Refactor the implementation using java.net with OkHttp.

The current HTTP client has various issues. Instead of pathing the existing implementations, it's better to use another client library. OkHTTPClient is one of the most popular one and it's used by PinDeploy and Spinnaker.

Improvements

  1. Observability for outgoing requests.
  2. 1 shared connection pool managed by OkHttp instead of many ad-hoc connections.
  3. Exponential backup retry on certain failures.
  4. Logging with configurable level and sensitive header redaction.
  5. Moved to universal so Rodimus can use the same implementation

Tests and validations

Thanks to the added observability, it's very easy to know and monitor if this refactoring is working in addition to the unit tests.

Smoke tests

Deploy both service and worker to dev1 and ensure these are working

  • Github integration - commit data fetch
  • Rodimus integration - Ec2 tags can load
  • Changefeed - events are published to changefeed
  • Webhook - webhooks can be invoked

Additional details

Various logging levels

Basic

Screenshot 2024-11-07 at 15 34 48

Body and header

Screenshot 2024-11-07 at 15 35 46

Metrics

Screenshot 2024-11-07 at 15 31 55 Screenshot 2024-11-07 at 15 31 42

@github-actions github-actions bot added the deploy-service Includes changes to deploy-service label Nov 6, 2024
@tylerwowen tylerwowen marked this pull request as ready for review November 7, 2024 23:54
@tylerwowen tylerwowen requested a review from a team as a code owner November 7, 2024 23:54
osoriano
osoriano previously approved these changes Nov 12, 2024
@tylerwowen tylerwowen merged commit df4cc0d into master Nov 13, 2024
6 checks passed
@tylerwowen tylerwowen deleted the touyang/http branch November 13, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-service Includes changes to deploy-service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants