You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/references/configuration.mdx
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ Global configurations are provided through env variables or a YAML file. ConfigM
78
78
|`LOG_LEVEL`| Defines the verbosity of application logs. Common values: 'trace', 'debug', 'info', 'warn', 'error'.|`info`| No|
79
79
|`LOG_MAX_CONCURRENCY`| Maximum number of log writing operations to process concurrently.|`1`| No|
80
80
|`MAX_DESTINATIONS_PER_TENANT`| Maximum number of destinations allowed per tenant/organization.|`20`| No|
81
-
|`MAX_RETRY_LIMIT`| Maximum number of retry attempts for a single event delivery before giving up.|`10`| No|
81
+
|`MAX_RETRY_LIMIT`| Maximum number of retry attempts for a single event delivery before giving up.Ignored if retry_schedule is provided.|`10`| No|
82
82
|`ORGANIZATION_NAME`| Name of the organization, used for display purposes and potentially in user agent strings.|`nil`| No|
83
83
|`OTEL_EXPORTER`| Specifies the OTLP exporter to use for this telemetry type (e.g., 'otlp'). Typically used with environment variables like OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.|`nil`| Conditional|
84
84
|`OTEL_PROTOCOL`| Specifies the OTLP protocol ('grpc' or 'http') for this telemetry type. Typically used with environment variables like OTEL_EXPORTER_OTLP_TRACES_PROTOCOL.|`nil`| Conditional|
@@ -120,7 +120,8 @@ Global configurations are provided through env variables or a YAML file. ConfigM
120
120
|`REDIS_PASSWORD`| Password for Redis authentication, if required by the server.|`nil`| Yes|
121
121
|`REDIS_PORT`| Port number for the Redis server.|`6379`| Yes|
122
122
|`REDIS_TLS_ENABLED`| Enable TLS encryption for Redis connection.|`false`| No|
123
-
|`RETRY_INTERVAL_SECONDS`| Interval in seconds between delivery retry attempts for failed webhooks.|`30`| No|
123
+
|`RETRY_INTERVAL_SECONDS`| Interval in seconds for exponential backoff retry strategy (base 2). Ignored if retry_schedule is provided.|`30`| No|
124
+
|`RETRY_SCHEDULE`| Comma-separated list of retry delays in seconds. If provided, overrides retry_interval_seconds and retry_max_limit. Schedule length defines the max number of retries. Example: '5,60,600,3600,7200' for 5 retries at 5s, 1m, 10m, 1h, 2h.|`[]`| No|
124
125
|`SERVICE`| Specifies the service type to run. Valid values: 'api', 'log', 'delivery', or empty/all for singular mode (runs all services).|`nil`| No|
125
126
|`TELEMETRY_BATCH_INTERVAL`| Maximum time in seconds to wait before sending a batch of telemetry events if batch size is not reached.|`5`| No|
126
127
|`TELEMETRY_BATCH_SIZE`| Maximum number of telemetry events to batch before sending.|`100`| No|
@@ -552,12 +553,15 @@ redis:
552
553
tls_enabled:false
553
554
554
555
555
-
# Interval in secondsbetween deliveryretryattempts for failed webhooks.
556
+
# Interval in secondsfor exponential backoffretrystrategy (base 2). Ignored if retry_schedule is provided.
556
557
retry_interval_seconds:30
557
558
558
-
# Maximum number of retry attempts for a single event delivery before giving up.
559
+
# Maximum number of retry attempts for a single event delivery before giving up. Ignored if retry_schedule is provided.
559
560
retry_max_limit:10
560
561
562
+
# Comma-separated list of retry delays in seconds. If provided, overrides retry_interval_seconds and retry_max_limit. Schedule length defines the max number of retries. Example: '5,60,600,3600,7200' for 5 retries at 5s, 1m, 10m, 1h, 2h.
563
+
retry_schedule:[]
564
+
561
565
# Specifies the service type to run. Valid values: 'api', 'log', 'delivery', or empty/all for singular mode (runs all services).
Copy file name to clipboardExpand all lines: internal/config/config.go
+31-10Lines changed: 31 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,10 @@ import (
5
5
"errors"
6
6
"fmt"
7
7
"strings"
8
+
"time"
8
9
9
10
"github.com/caarlos0/env/v9"
11
+
"github.com/hookdeck/outpost/internal/backoff"
10
12
"github.com/hookdeck/outpost/internal/migrator"
11
13
"github.com/hookdeck/outpost/internal/redis"
12
14
"github.com/hookdeck/outpost/internal/telemetry"
@@ -73,8 +75,9 @@ type Config struct {
73
75
LogMaxConcurrencyint`yaml:"log_max_concurrency" env:"LOG_MAX_CONCURRENCY" desc:"Maximum number of log writing operations to process concurrently." required:"N"`
74
76
75
77
// Delivery Retry
76
-
RetryIntervalSecondsint`yaml:"retry_interval_seconds" env:"RETRY_INTERVAL_SECONDS" desc:"Interval in seconds between delivery retry attempts for failed webhooks." required:"N"`
77
-
RetryMaxLimitint`yaml:"retry_max_limit" env:"MAX_RETRY_LIMIT" desc:"Maximum number of retry attempts for a single event delivery before giving up." required:"N"`
78
+
RetrySchedule []int`yaml:"retry_schedule" env:"RETRY_SCHEDULE" envSeparator:"," desc:"Comma-separated list of retry delays in seconds. If provided, overrides retry_interval_seconds and retry_max_limit. Schedule length defines the max number of retries. Example: '5,60,600,3600,7200' for 5 retries at 5s, 1m, 10m, 1h, 2h." required:"N"`
79
+
RetryIntervalSecondsint`yaml:"retry_interval_seconds" env:"RETRY_INTERVAL_SECONDS" desc:"Interval in seconds for exponential backoff retry strategy (base 2). Ignored if retry_schedule is provided." required:"N"`
80
+
RetryMaxLimitint`yaml:"retry_max_limit" env:"MAX_RETRY_LIMIT" desc:"Maximum number of retry attempts for a single event delivery before giving up. Ignored if retry_schedule is provided." required:"N"`
78
81
79
82
// Event Delivery
80
83
MaxDestinationsPerTenantint`yaml:"max_destinations_per_tenant" env:"MAX_DESTINATIONS_PER_TENANT" desc:"Maximum number of destinations allowed per tenant/organization." required:"N"`
@@ -103,14 +106,14 @@ type Config struct {
103
106
}
104
107
105
108
var (
106
-
ErrMismatchedServiceType=errors.New("config validation error: service type mismatch")
107
-
ErrInvalidServiceType=errors.New("config validation error: invalid service type")
108
-
ErrMissingRedis=errors.New("config validation error: redis configuration is required")
109
-
ErrMissingLogStorage=errors.New("config validation error: log storage must be provided")
110
-
ErrMissingMQs=errors.New("config validation error: message queue configuration is required")
111
-
ErrMissingAESSecret=errors.New("config validation error: AES encryption secret is required")
ErrInvalidDeploymentID=errors.New("config validation error: deployment_id must contain only alphanumeric characters, hyphens, and underscores (max 64 characters)")
109
+
ErrMismatchedServiceType=errors.New("config validation error: service type mismatch")
110
+
ErrInvalidServiceType=errors.New("config validation error: invalid service type")
111
+
ErrMissingRedis=errors.New("config validation error: redis configuration is required")
112
+
ErrMissingLogStorage=errors.New("config validation error: log storage must be provided")
113
+
ErrMissingMQs=errors.New("config validation error: message queue configuration is required")
114
+
ErrMissingAESSecret=errors.New("config validation error: AES encryption secret is required")
ErrInvalidDeploymentID=errors.New("config validation error: deployment_id must contain only alphanumeric characters, hyphens, and underscores (max 64 characters)")
Disabledbool`yaml:"disabled" env:"DISABLE_TELEMETRY" desc:"Disables telemetry within the 'telemetry' block (Hookdeck usage stats and Sentry). Can be overridden by the global 'disable_telemetry' flag at the root of the configuration." required:"N"`
378
399
BatchSizeint`yaml:"batch_size" env:"TELEMETRY_BATCH_SIZE" desc:"Maximum number of telemetry events to batch before sending." required:"N"`