the Common signature of EnvoyRequestParams

### Hierarchy

- EnvoyRequestParams
  - EnvoyGrpcRequestParams
  - EnvoyHttpRequestParams

## Index

### Constructors

- constructor

### Properties

- context
- customHeaders
- maxRetries
- perTryTimeout
- timeout

## Constructors

### constructor

- new EnvoyRequestParams(context: EnvoyContext, maxRetries: number, timeout: number, perTryTimeout: number, headers: HttpHeader): EnvoyRequestParams

- - Defined in envoy-request-params.ts:71

  #### Parameters

  - ##### context: EnvoyContext

  - ##### maxRetries: number

  - ##### timeout: number

  - ##### perTryTimeout: number

  - ##### headers: HttpHeader

  #### Returns EnvoyRequestParams

## Properties

### context

context: EnvoyContext

- Defined in envoy-request-params.ts:27

request context read from ingress traffic

### customHeaders

customHeaders: HttpHeader

- Defined in envoy-request-params.ts:71

extra customer headers to be set in the request

### maxRetries

maxRetries: number

- Defined in envoy-request-params.ts:51

If a retry policy is in place, Envoy will default to retrying one time unless explicitly specified. The number of retries can be explicitly set in the route retry config or by using this header. If a retry policy is not configured and x-envoy-retry-on or x-envoy-retry-grpc-on headers are not specified, Envoy will not retry a failed request.

A few notes on how Envoy does retries:

- The route timeout (set via x-envoy-upstream-rq-timeout-ms or the route configuration) includes all retries. Thus if the request timeout is set to 3s, and the first request attempt takes 2.7s, the retry (including backoff) has .3s to complete. This is by design to avoid an exponential retry/timeout explosion.

- Envoy uses a fully jittered exponential backoff algorithm for retries with a base time of 25ms. The first retry will be delayed randomly between 0-24ms, the 2nd between 0-74ms, the 3rd between 0-174ms and so on.

- If max retries is set both by header as well as in the route configuration, the maximum value is taken when determining the max retries to use for the request.

### perTryTimeout

perTryTimeout: number

- Defined in envoy-request-params.ts:66

Setting this will cause Envoy to set a per try timeout on routed requests. This timeout must be <= the global route timeout (see <timeout>) or it is ignored. This allows a caller to set a tight per try timeout to allow for retries while maintaining a reasonable overall timeout.

### timeout

timeout: number

- Defined in envoy-request-params.ts:58

Setting this header on egress requests will cause Envoy to override the route configuration. The timeout must be specified in millisecond units. Also see <perTryTimeout>

Generated using TypeDoc