clawchain/third_party/clawchain-forks/ziti/doc/2.0-metrics-and-config-changes.md

314 lines
14 KiB
Markdown

# Metrics and Configuration Changes: 1.6.8 -> 2.0
This document covers all metrics and configuration changes between OpenZiti v1.6.8 and v2.0.
## Definitions
* Beta Feature - a feature which is still under development and is subject to change. It should
be usable in its released form. Though unlikely, there is a small chance it will
be removed.
## New Metrics
### Raft Adaptive Rate Limiter (Controller)
Three new metrics for the cluster command rate limiter, which uses adaptive window sizing to
control the rate of commands submitted to the Raft distributed log.
| Metric | Type | Description |
|---------------------------------|-------|-----------------------------------------------|
| `raft.rate_limiter.queue_size` | Gauge | Current number of operations queued/in-flight |
| `raft.rate_limiter.window_size` | Gauge | Current adaptive window size |
| `raft.rate_limiter.work_timer` | Timer | Duration of rate-limited operations |
Previously the raft path shared the `command.limiter.*` namespace with the non-raft command
dispatcher. The non-raft command path still uses `command.limiter.queued_count` and
`command.limiter.work_timer`.
### Background Command Processing (Controller)
Five new metrics exposed when `command.background` is enabled (default: `true`).
| Metric | Type | Description |
|--------------------------------------|-------|--------------------------------------------------------------------------|
| `command.background.queue_size` | Gauge | Current number of queued background tasks |
| `command.background.worker_count` | Gauge | Current number of worker goroutines |
| `command.background.busy_workers` | Gauge | Workers currently processing tasks |
| `command.background.work_timer` | Timer | Background task execution duration |
| `command.background.dropped_entries` | Meter | Updates dropped when queue is full (only when `dropWhenFull` is enabled) |
### Controller-Initiated Control Channel Dials (Controller, Beta)
Four new metrics under the `ctrl_channel.dialer` prefix, exposed when `ctrl.dialer` is enabled.
| Metric | Type | Description |
|------------------------------------|-------|------------------------------------|
| `ctrl_channel.dialer.queue_size` | Gauge | Pending dial jobs in the queue |
| `ctrl_channel.dialer.worker_count` | Gauge | Dial worker goroutines |
| `ctrl_channel.dialer.busy_workers` | Gauge | Workers currently executing a dial |
| `ctrl_channel.dialer.work_timer` | Timer | Duration of each dial attempt |
### Control Channel Listener Pool (Router, Beta)
Four new metrics under the `pool.listener.ctrl` prefix, exposed when the router has control
channel listeners configured.
| Metric | Type | Description |
|-----------------------------------|-------|-------------------------------------------------|
| `pool.listener.ctrl.queue_size` | Gauge | Queue depth of the ctrl listener pool |
| `pool.listener.ctrl.worker_count` | Gauge | Current number of workers |
| `pool.listener.ctrl.busy_workers` | Gauge | Workers currently handling connections |
| `pool.listener.ctrl.work_timer` | Timer | Duration of ctrl listener connection operations |
### Circuit and Link Fault Meters (Router)
Two new metrics that replace what were previously warn-level log messages.
| Metric | Type | Description |
|------------------|-------|---------------------------|
| `faults.circuit` | Meter | Circuit forwarding faults |
| `faults.link` | Meter | Invalid link faults |
### Revocation Enforcer (Controller)
Two new metrics for the periodic revocation cleanup process.
| Metric | Type | Description |
|------------------------------|-------|----------------------------------------------|
| `revocation.enforcer.run` | Timer | Duration of each revocation enforcement pass |
| `revocation.enforcer.delete` | Meter | Expired revocation records deleted per pass |
## Removed Events
### Terminator Create/Update/Delete Events
The `created`, `updated`, and `deleted` terminator events have been removed. They were
superseded by entity change events, which were introduced in v0.28.0 and also cover
terminator create/update/delete.
Tracking issue: [#3531](https://github.com/openziti/ziti/issues/3531)
## New Configuration
### Controller: Cluster Rate Limiter (`cluster.rateLimiter`)
Controls the submission of commands to the Raft cluster with adaptive window sizing.
```yaml
cluster:
applyTimeout: 5s
rateLimiter:
enabled: true # default: true
minSize: 5 # default: 5, minimum: 1
maxSize: 250 # default: 250
timeout: 30s # default: 30s
restartSelfOnSnapshot: false # default: false
preferredLeader: false # default: false
```
- `applyTimeout` - Timeout for applying commands to the Raft log (default: `5s`)
- `rateLimiter.enabled` - Enable adaptive rate limiting for Raft command submission (default: `true`)
- `rateLimiter.minSize` - Minimum concurrent in-flight Raft operations (default: `5`)
- `rateLimiter.maxSize` - Maximum concurrent in-flight Raft operations (default: `250`)
- `rateLimiter.timeout` - Outstanding work assumed failed after this duration (default: `30s`)
- `restartSelfOnSnapshot` - Auto-restart the controller after restoring a snapshot (default: `false`)
- `preferredLeader` - Mark this controller as a preferred Raft leader (default: `false`)
### Controller: Background Command Processing (`command.background`)
Allows authentication-related model updates (identity environment info, system authenticator
updates) to be processed asynchronously in a background queue.
```yaml
command:
background:
enabled: true # default: true
queueSize: 1000 # default: 1000
dropWhenFull: false # default: false
delayThreshold: 50ms # default: 50ms
rateLimiter:
enabled: true
maxQueued: 25
```
- `background.enabled` - Enable background processing (default: `true`)
- `background.queueSize` - Maximum queue size (default: `1000`)
- `background.dropWhenFull` - Drop updates when queue is full rather than blocking (default: `false`)
- `background.delayThreshold` - Threshold for how long updates are taking before starting to background them (default: `50ms`)
Note: the `commandRateLimiter` section can now also be specified under `command` as `rateLimiter`.
If specified in both locations, the settings under `command` take precedence. The standalone
`commandRateLimiter` section may be deprecated in the future.
### Controller: Connect Events Pool (`connectEvents`)
Uses a shared, bounded goroutine pool for identity connect/disconnect events from routers,
replacing the previous per-router goroutine model that leaked goroutines on reconnect.
```yaml
connectEvents:
queueSize: 16 # default: 16
minWorkers: 0 # default: 0
maxWorkers: 16 # default: 16
idleTime: 30s # default: 30s
```
### Controller: OIDC Auto-Binding Opt-Out (`edge.api.disableOidcAutoBinding`)
The controller now auto-binds `edge-oidc` to any web listener hosting `edge-client`. Set this
to `true` to disable that behavior.
```yaml
edge:
api:
disableOidcAutoBinding: true # default: false
```
When OIDC is not enabled, clients revert to legacy authentication, which does not support HA.
### Controller: OIDC Revocation Tuning (`edge.oidc`)
Controls batching and cleanup of JWT token revocations.
| Key | Default | Description |
|-------------------------------|---------|---------------------------------------------------------------------|
| `revocationMinTokenLifetime` | unset | Skip revocation if the old token expires within this duration |
| `revocationBucketInterval` | `1m` | Bucket window for batching revocations before flushing through raft |
| `revocationBucketMaxSize` | `200` | Max revocations per raft entry |
| `revocationMaxQueued` | `25000` | Max revocations queued in memory before dropping |
| `revocationEnforcerFrequency` | `1m` | How often expired revocations are purged (leader only) |
### Controller: Controller-Initiated Ctrl Channel Dials (`ctrl.dialer`, Beta)
Allows the controller to dial routers to establish control channels, for deployments where
some controllers are behind firewalls that routers cannot reach.
```yaml
ctrl:
dialer:
enabled: false # default: false
groups: ["default"] # default: ["default"]
dialDelay: 30s # default: 30s
minRetryInterval: 1s # default: 1s
maxRetryInterval: 5m # default: 5m
retryBackoffFactor: 1.5 # default: 1.5
fastFailureWindow: 5s # default: 5s
queueSize: 32 # default: 32
maxWorkers: 10 # default: 10
```
### Controller: Azure Service Bus Event Sink
New event handler type `servicebus` for streaming controller events to Azure Service Bus.
```yaml
events:
serviceBusLogger:
subscriptions:
- type: circuit
- type: session
handler:
type: servicebus
format: json
connectionString: "Endpoint=sb://..."
topic: "ziti-events" # or queue: "ziti-events-queue"
bufferSize: 100 # default: 50
```
### Controller: Alert Events (Beta)
New `alert` event subscription type for surfacing operational issues to network operators.
```yaml
events:
myLogger:
subscriptions:
- type: alert
```
### Router: Control Channel Listeners (`ctrl.listeners`, Beta)
Allows routers to accept incoming control channel connections from controllers.
```yaml
ctrl:
listeners:
- bind: tls://0.0.0.0:6262
advertise: tls://router.example.com:6262
groups:
- default
```
### Rate Limiter Algorithm Tuning
Five new tuning parameters available under each `rateLimiter` section (TLS handshake, raft
command, and router ctrl channel rate limiters). The algorithm now uses a success-rate metric
for adaptive window sizing instead of raw queue position.
| Key | Default | Description |
|-------------------------|---------|---------------------------------------------------------------|
| `successThreshold` | `0.9` | Success rate above which window grows, below which it shrinks |
| `increaseFactor` | `1.02` | Window growth multiplier (must be > 1) |
| `decreaseFactor` | `0.9` | Window shrink multiplier (must be between 0 and 1) |
| `increaseCheckInterval` | `10` | Successes between window increase checks |
| `decreaseCheckInterval` | `10` | Backoffs between window decrease checks |
## Removed Configuration
### Controller: `routerDataModel.enabled`
The router data model is now always enabled. The `enabled` field has been removed. Any
existing `routerDataModel.enabled` setting in configuration files is ignored.
Tracking issue: [#3541](https://github.com/openziti/ziti/issues/3541)
### Controller: `network.enableLegacyLinkMgmt`
Router-managed links (introduced in v0.30.0) are now the only option. The
`enableLegacyLinkMgmt` field and controller-side legacy link management code have been removed.
Tracking issue: [#3512](https://github.com/openziti/ziti/issues/3512)
### Router: `ctrl.ha`
HA is now always-on behavior. The `ctrl.ha` configuration key has been removed.
## Changed Defaults
### Controller: `tls.rateLimiter.maxSize`
The default maximum window for the TLS handshake rate limiter was increased from `1000` to
`2500`. The rate limiter itself remains disabled by default.
### Controller: `routerDataModel.logSize` Minimum
A minimum of `10` is now enforced for `routerDataModel.logSize`. Values below `10` will cause
a configuration error at startup.
## Configuration Bug Fixes
Several configuration parsing bugs were fixed that could cause settings to be silently ignored
or applied to the wrong field.
| Issue | Description |
|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| [#3620](https://github.com/openziti/ziti/issues/3620) | Controller `ctrl.heartbeats` config was nested under `ctrl.options` parsing and ignored at the correct level |
| [#3619](https://github.com/openziti/ziti/issues/3619) | Router `connectEvents.fullSyncInterval` was validated against batch interval min/max instead of its own |
| [#3618](https://github.com/openziti/ziti/issues/3618) | Router `interfaceDiscovery.minReportInterval` was being set to `checkInterval` instead of its configured value |
| [#3756](https://github.com/openziti/ziti/issues/3756) | TLS rate limiter `timeout` was read from the wrong config scope and silently ignored |
| [#3755](https://github.com/openziti/ziti/issues/3755) | `commandHandler` config was read from the top-level scope instead of the `cluster` section |
| [#3753](https://github.com/openziti/ziti/issues/3753) | SPIFFE trust domain prefix check had swapped `HasPrefix` arguments |
| OIDC token durations | `idTokenDuration` and `refreshTokenDuration` were both being assigned to `accessTokenDuration` |
If you had configured any of these settings, verify they are taking effect after upgrading.
## CLI Changes
- `ziti edge quickstart` always runs in HA mode. The `ha` subcommand was removed. Use
`ziti edge quickstart join` to add cluster members. Existing non-HA quickstart instances
must be recreated.
- The `--clustered` flag on `ziti create config controller` was removed. Generated configs
are always cluster-ready.
- `ziti edge create identity <type>` subcommands (`device`, `service`, `user`) were removed.
Use `ziti edge create identity` directly.