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

Beta #12

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

Beta #12

wants to merge 34 commits into from

Conversation

leftieFriele
Copy link
Contributor

@leftieFriele leftieFriele commented Oct 31, 2024

WIP - Creating an improved HTTP client which has a circuit breaker.

Note, these are just notes 😄

Todos

  • update to v7 of undici
  • identify the metrics on client which we need to continue having
  • add metrics support for the breaker
  • add general metrics for all request
  • [ ] add prometheus hook into opossum
  • close the gap on features in client and this one.... not sure what those are yet.

Open questions ❓

  • request which we are using here is single origin, which means that a request to https://google.com returning a location header with https://www.google.com will not redirect as it's a different host. the client implementation supports redirectable and it's used in the resolvers
  • decide on default redirect behaviour
  • decide on options surface, how much control should there be?
  • should we rename this branch to alpha to create a release?

Things to push to next version

  • do we add retries to the client?

Errors

If options.fallback is not set, we wrap errors in a HttpClientError class.

const client = new HttpClient();
try {
  await client.request(...)
} catch (err) {
 if (err instance of HttpClientError) {
  // do stuff
 }
}

Constructor options

abortController

we need to be able to cancel requests in opossum

followRedirects

if we should follow redirects or not, default behaviour is to not follow (???)

fallback

const client = new HttpClient({ fallback: function () { return 'We are down.' } });
// can also be set like this

client.fallback(function () { 'We are down'; });

Closes #11

semantic-release-bot and others added 2 commits October 31, 2024 13:13
# 1.0.0-beta.1 (2024-10-31)

### Features

* Initial commit ([bfc0570](bfc0570))
# [1.0.0-beta.2](v1.0.0-beta.1...v1.0.0-beta.2) (2024-11-01)

### Bug Fixes

* removing custom error ([6f14c0a](6f14c0a))
Copy link

github-actions bot commented Nov 1, 2024

🎉 This PR is included in version 1.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

leftieFriele and others added 3 commits November 4, 2024 12:28
fix: adding .metrics property and circuit breaker metrics
# [1.0.0-beta.3](v1.0.0-beta.2...v1.0.0-beta.3) (2024-11-04)

### Bug Fixes

* adding .metrics property and circuit breaker metrics ([3283f5f](3283f5f))
Copy link

github-actions bot commented Nov 4, 2024

🎉 This PR is included in version 1.0.0-beta.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

leftieFriele and others added 3 commits November 6, 2024 11:08
# [1.0.0-beta.4](v1.0.0-beta.3...v1.0.0-beta.4) (2024-11-06)

### Bug Fixes

* supporting more request options and metrics on breaker events ([1a62a07](1a62a07))
* supporting more request options and metrics on breaker events ([c5ea66b](c5ea66b))
Copy link

github-actions bot commented Nov 6, 2024

🎉 This PR is included in version 1.0.0-beta.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

leftieFriele and others added 3 commits November 7, 2024 15:11
# [1.0.0-beta.5](v1.0.0-beta.4...v1.0.0-beta.5) (2024-11-07)

### Bug Fixes

* adding back breaker metrics tests ([16b65b5](16b65b5))
* adjusting abort controller implementation ([5820d35](5820d35))
Copy link

github-actions bot commented Nov 7, 2024

🎉 This PR is included in version 1.0.0-beta.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 1.0.0-beta.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

leftieFriele and others added 2 commits November 12, 2024 10:27
# [1.0.0-beta.7](v1.0.0-beta.6...v1.0.0-beta.7) (2024-11-12)

### Bug Fixes

* making .request return the entire response ([97180e3](97180e3))
Copy link

🎉 This PR is included in version 1.0.0-beta.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 1.0.0-beta.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 1.0.0-beta.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Implement a first beta to replace the existing podium http client
2 participants