snapshot

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 13 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 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 {
	model.EdgeMetadata `json:",inline"`
	Attributes         map[string]string `json:"attributes,omitempty"`
}

func (EdgeMetadata) IsZero added in v0.3.0

func (m EdgeMetadata) IsZero() bool

func (*EdgeMetadata) Normalize added in v0.3.0

func (m *EdgeMetadata) Normalize()

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"`
	Resilience  *model.ResiliencePolicy `json:"resilience,omitempty"`
	Observed    *model.ObservedEdge     `json:"observed,omitempty"`
	PolicyScope *model.PolicyScope      `json:"policy_scope,omitempty"`
}

type EndpointMetadata

type EndpointMetadata struct {
	model.EndpointMetadata `json:",inline"`
	PredicateRef           string            `json:"predicate_ref,omitempty"`
	Attributes             map[string]string `json:"attributes,omitempty"`
}

func (EndpointMetadata) IsZero added in v0.3.0

func (m EndpointMetadata) IsZero() bool

func (*EndpointMetadata) Normalize added in v0.3.0

func (m *EndpointMetadata) Normalize()

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 {
	model.ServiceMetadata `json:",inline"`
	ReplicasOverride      *int              `json:"replicas_override,omitempty"`
	Attributes            map[string]string `json:"attributes,omitempty"`
}

func (ServiceMetadata) IsZero added in v0.3.0

func (m ServiceMetadata) IsZero() bool

func (*ServiceMetadata) Normalize added in v0.3.0

func (m *ServiceMetadata) Normalize()

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