model

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package model is SPECTRE's data model: the traffic that crosses a service's boundary through its proxies, and why a candidate was quarantined.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string

Direction names the proxy that carries traffic: ingress into the service, or egress from it to a dependency.

const (
	// Ingress traffic is requests to the proxied service.
	Ingress Direction = "ingress"
	// Egress traffic is requests from the service to a dependency.
	Egress Direction = "egress"
)

type IOKind

type IOKind struct {
	Direction Direction
	Protocol  Protocol
}

IOKind is one kind of IO that a proxy intercepts, written "ingress[http]".

func (IOKind) String

func (k IOKind) String() string

String returns the kind as written in the migration state, e.g. "ingress[http]".

type Protocol

type Protocol string

Protocol names the protocol that a proxy intercepts, e.g. "http".

const ProtocolHTTP Protocol = "http"

ProtocolHTTP is the protocol of HTTP servers, including gRPC and Connect.

type Quarantine

type Quarantine struct {
	Reason QuarantineReason
	Since  time.Time
}

Quarantine is a quarantine in effect: why it began and when.

type QuarantineKind

type QuarantineKind string

QuarantineKind is why the candidate was quarantined.

const (
	// QuarantineDivergent means the candidate's responses differ from the reference's.
	QuarantineDivergent QuarantineKind = "divergent"
	// QuarantineUnable means the mirror could not compare or replay traffic.
	QuarantineUnable QuarantineKind = "unable"
	// QuarantineUnmatched means the candidate made a dependency request the reference did not.
	QuarantineUnmatched QuarantineKind = "unmatched"
	// QuarantineUnlisted means an ingress route is in no node of the migration state.
	QuarantineUnlisted QuarantineKind = "unlisted"
	// QuarantineCapacity means candidate work exceeded a concurrency or buffer limit.
	QuarantineCapacity QuarantineKind = "capacity"
	// QuarantinePairing means the mirror could not pair candidate and reference traffic.
	QuarantinePairing QuarantineKind = "pairing"
)

type QuarantineReason

type QuarantineReason struct {
	Kind QuarantineKind
	// Traffic is the request that triggered quarantine.
	Traffic Option[Traffic]
	// Node is the migration state node that owns an ingress route.
	Node Option[string]
	// Differences are the field paths of a divergence, without values.
	Differences []string
	Detail      string
}

QuarantineReason is why the candidate was quarantined. Detail and Differences must never quote payload values, because reasons are reported outside the mirror.

func (QuarantineReason) String

func (r QuarantineReason) String() string

String describes the reason for logs.

type Route

type Route string

Route is a protocol's canonical request route, e.g. "GET forecasts.example/v1/forecasts/{location}". Equal routes must have identical text, because egress pairing hashes it.

type Traffic

type Traffic struct {
	Direction Direction
	Protocol  Protocol
	Route     Route
}

Traffic identifies one request route of a kind of IO.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL