snapshot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSnapshotID

func BuildSnapshotID(windowStart, windowEnd, topologyVersion string) string

func MarshalCanonical

func MarshalCanonical(env Envelope) ([]byte, error)

func TopologyDigest

func TopologyDigest(mdl model.ResilienceModel) (string, error)

func WriteToFile

func WriteToFile(path string, env Envelope) error

Types

type CommonMetadata

type CommonMetadata struct {
	Labels  map[string]string `json:"labels,omitempty"`
	Tags    []string          `json:"tags,omitempty"`
	SLORefs []string          `json:"slo_refs,omitempty"`
}

type Counts

type Counts struct {
	Services  int `json:"services"`
	Edges     int `json:"edges"`
	Endpoints int `json:"endpoints"`
}

type CoverageSummary

type CoverageSummary struct {
	Confidence         float64 `json:"confidence"`
	ServiceSupportMin  int     `json:"service_support_min"`
	EdgeSupportMin     int     `json:"edge_support_min"`
	EndpointSupportMin int     `json:"endpoint_support_min"`
}

type DiffSummary

type DiffSummary struct {
	AddedServices    int `json:"added_services"`
	RemovedServices  int `json:"removed_services"`
	ChangedServices  int `json:"changed_services"`
	AddedEdges       int `json:"added_edges"`
	RemovedEdges     int `json:"removed_edges"`
	ChangedEdges     int `json:"changed_edges"`
	AddedEndpoints   int `json:"added_endpoints"`
	RemovedEndpoints int `json:"removed_endpoints"`
	ChangedEndpoints int `json:"changed_endpoints"`
}

func ComputeDiff

func ComputeDiff(previous *Envelope, current Envelope) DiffSummary

type DiscoveryDetails

type DiscoveryDetails struct {
	Services  []ServiceRecord      `json:"services"`
	Edges     []EdgeRecord         `json:"edges"`
	Endpoints []EndpointRecord     `json:"endpoints"`
	Overlays  []OverlayApplication `json:"overlays,omitempty"`
}

type EdgeMetadata

type EdgeMetadata struct {
	CommonMetadata
	Weight     *float64          `json:"weight,omitempty"`
	Attributes map[string]string `json:"attributes,omitempty"`
}

type EdgeRecord

type EdgeRecord struct {
	ID         string         `json:"id"`
	From       string         `json:"from"`
	To         string         `json:"to"`
	Kind       model.EdgeKind `json:"kind"`
	Blocking   bool           `json:"blocking"`
	Support    SupportSummary `json:"support"`
	FirstSeen  string         `json:"first_seen,omitempty"`
	LastSeen   string         `json:"last_seen,omitempty"`
	Provenance []Provenance   `json:"provenance,omitempty"`
	Metadata   EdgeMetadata   `json:"metadata,omitempty"`
}

type EndpointMetadata

type EndpointMetadata struct {
	CommonMetadata
	Weight       *float64          `json:"weight,omitempty"`
	PredicateRef string            `json:"predicate_ref,omitempty"`
	Attributes   map[string]string `json:"attributes,omitempty"`
}

type EndpointRecord

type EndpointRecord struct {
	ID           string           `json:"id"`
	EntryService string           `json:"entry_service"`
	Method       string           `json:"method,omitempty"`
	Path         string           `json:"path,omitempty"`
	Support      SupportSummary   `json:"support"`
	FirstSeen    string           `json:"first_seen,omitempty"`
	LastSeen     string           `json:"last_seen,omitempty"`
	Provenance   []Provenance     `json:"provenance,omitempty"`
	Metadata     EndpointMetadata `json:"metadata,omitempty"`
}

type Envelope

type Envelope struct {
	SnapshotID      string                `json:"snapshot_id"`
	TopologyVersion string                `json:"topology_version"`
	WindowStart     string                `json:"window_start"`
	WindowEnd       string                `json:"window_end"`
	Ingest          IngestSummary         `json:"ingest"`
	Counts          Counts                `json:"counts"`
	Coverage        CoverageSummary       `json:"coverage"`
	Sources         []SourceSummary       `json:"sources"`
	Diff            DiffSummary           `json:"diff"`
	Discovery       DiscoveryDetails      `json:"discovery"`
	Model           model.ResilienceModel `json:"model"`
	Metadata        Metadata              `json:"metadata"`
}

func ParseJSON

func ParseJSON(raw []byte) (Envelope, error)

func (*Envelope) SortDeterministic

func (e *Envelope) SortDeterministic()

func (Envelope) ValidateSemantic

func (e Envelope) ValidateSemantic() error

type IngestSummary

type IngestSummary struct {
	Spans        int `json:"spans"`
	Traces       int `json:"traces"`
	DroppedSpans int `json:"dropped_spans"`
	LateSpans    int `json:"late_spans"`
}

type Metadata

type Metadata struct {
	SourceType string          `json:"source_type"`
	SourceRef  string          `json:"source_ref"`
	EmittedAt  string          `json:"emitted_at"`
	Confidence float64         `json:"confidence"`
	Schema     model.SchemaRef `json:"schema"`
}

type OverlayApplication

type OverlayApplication struct {
	Name       string `json:"name"`
	Ref        string `json:"ref,omitempty"`
	Precedence int    `json:"precedence"`
}

type Provenance

type Provenance struct {
	Type       string `json:"type"`
	Connector  string `json:"connector,omitempty"`
	Name       string `json:"name,omitempty"`
	Ref        string `json:"ref,omitempty"`
	Precedence int    `json:"precedence,omitempty"`
}

type ServiceMetadata

type ServiceMetadata struct {
	CommonMetadata
	FailureEligible  *bool             `json:"failure_eligible,omitempty"`
	ReplicasOverride *int              `json:"replicas_override,omitempty"`
	Attributes       map[string]string `json:"attributes,omitempty"`
}

type ServiceRecord

type ServiceRecord struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	Replicas   int             `json:"replicas"`
	Support    SupportSummary  `json:"support"`
	FirstSeen  string          `json:"first_seen,omitempty"`
	LastSeen   string          `json:"last_seen,omitempty"`
	Provenance []Provenance    `json:"provenance,omitempty"`
	Metadata   ServiceMetadata `json:"metadata,omitempty"`
}

type SourceSummary

type SourceSummary struct {
	Type         string `json:"type"`
	Connector    string `json:"connector,omitempty"`
	Ref          string `json:"ref,omitempty"`
	Observations int    `json:"observations,omitempty"`
}

type SupportSummary

type SupportSummary struct {
	Observations int      `json:"observations"`
	TraceCount   int      `json:"trace_count"`
	Evidence     []string `json:"evidence,omitempty"`
}

Jump to

Keyboard shortcuts

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