Documentation
¶
Overview ¶
Package exporter provides the alpha public contracts for reporting passive Tailscale runtime observations to Tailpath.
Index ¶
- Constants
- Variables
- type Capabilities
- type HTTPReporter
- type HTTPStatusError
- type IncompatibleServerError
- type NodeIdentity
- type ObserverReport
- type Path
- type PathKind
- type PeerObservation
- type PeerSnapshot
- type Registration
- type RelayCapability
- type RelayClientSnapshot
- type RelayIdentityEvidence
- type RelaySessionClient
- type RelaySessionObservation
- type RelaySessionSnapshot
- type RelaySnapshot
- type RelaySource
- type ReportEnvelope
- type ReportKind
- type ReportReceipt
- type Reporter
- type Snapshot
- type SnapshotSink
- type SnapshotSinkOptions
- type Source
Constants ¶
View Source
const ( FeatureMultiObserver = "multi-observer" FeatureObserverWithdrawal = "observer-withdrawal" )
View Source
const ( RelayOff RelayCapability = "off" RelayUnsupported RelayCapability = "unsupported" RelayDisabled RelayCapability = "disabled" RelayEnabled RelayCapability = "enabled" RelayTransientFailure RelayCapability = "transient_failure" RelayIdentityAvailable RelayIdentityEvidence = "available" RelayIdentityDegraded RelayIdentityEvidence = "degraded" )
View Source
const ProtocolVersion = 1
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct {
ObserverProtocolVersions []int `json:"observerProtocolVersions"`
Features []string `json:"features"`
}
func (Capabilities) SupportsFeature ¶
func (c Capabilities) SupportsFeature(feature string) bool
func (Capabilities) SupportsProtocol ¶
func (c Capabilities) SupportsProtocol(version int) bool
type HTTPReporter ¶
type HTTPReporter struct {
// contains filtered or unexported fields
}
func NewHTTPReporter ¶
func NewHTTPReporter(serverURL string, client *http.Client) (*HTTPReporter, error)
func (*HTTPReporter) Capabilities ¶
func (r *HTTPReporter) Capabilities(ctx context.Context) (Capabilities, error)
func (*HTTPReporter) RequireCapabilities ¶
func (r *HTTPReporter) RequireCapabilities(ctx context.Context, features ...string) error
func (*HTTPReporter) Send ¶
func (r *HTTPReporter) Send(ctx context.Context, report ReportEnvelope) (ReportReceipt, error)
type HTTPStatusError ¶
func (*HTTPStatusError) Error ¶
func (e *HTTPStatusError) Error() string
type IncompatibleServerError ¶
type IncompatibleServerError struct {
Reason string
}
func (*IncompatibleServerError) Error ¶
func (e *IncompatibleServerError) Error() string
type NodeIdentity ¶
type NodeIdentity struct {
StableNodeID string `json:"stableNodeId"`
NodeID string `json:"nodeId,omitempty"`
NodeKey string `json:"nodeKey,omitempty"`
DiscoKey string `json:"discoKey,omitempty"`
Hostname string `json:"hostname"`
DNSName string `json:"dnsName,omitempty"`
OS string `json:"os,omitempty"`
TailscaleIPs []string `json:"tailscaleIps,omitempty"`
}
func (NodeIdentity) CanonicalID ¶
func (n NodeIdentity) CanonicalID() string
func (NodeIdentity) DisplayName ¶
func (n NodeIdentity) DisplayName() string
func (NodeIdentity) HasIdentity ¶
func (n NodeIdentity) HasIdentity() bool
func (NodeIdentity) IdentityKey ¶
func (n NodeIdentity) IdentityKey() string
type ObserverReport ¶
type ObserverReport struct {
Observer NodeIdentity `json:"observer"`
InventoryGeneration string `json:"inventoryGeneration"`
CollectedAt *time.Time `json:"collectedAt,omitempty"`
Peers []PeerObservation `json:"peers,omitempty"`
}
type Path ¶
type PeerObservation ¶
type PeerObservation struct {
Peer NodeIdentity `json:"peer"`
RxBytes int64 `json:"rxBytes"`
TxBytes int64 `json:"txBytes"`
RxDelta int64 `json:"rxDelta"`
TxDelta int64 `json:"txDelta"`
SampleDurationMS int64 `json:"sampleDurationMs"`
Path Path `json:"path"`
LastActive time.Time `json:"lastActive"`
}
type PeerSnapshot ¶
type PeerSnapshot struct {
Identity NodeIdentity
RxBytes int64
TxBytes int64
Path Path
}
type Registration ¶
type Registration struct {
// contains filtered or unexported fields
}
func (*Registration) Key ¶
func (r *Registration) Key() string
type RelayCapability ¶
type RelayCapability string
type RelayClientSnapshot ¶
type RelayIdentityEvidence ¶
type RelayIdentityEvidence string
type RelaySessionClient ¶
type RelaySessionClient struct {
SessionClientID string `json:"sessionClientId"`
Identity *NodeIdentity `json:"identity,omitempty"`
DiscoShort string `json:"discoShort,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
}
type RelaySessionObservation ¶
type RelaySessionObservation struct {
Relay NodeIdentity `json:"relay"`
Source RelaySessionClient `json:"source"`
Target RelaySessionClient `json:"target"`
SessionID string `json:"sessionId"`
VNI int64 `json:"vni"`
SourceToTargetBytes int64 `json:"sourceToTargetBytes"`
TargetToSourceBytes int64 `json:"targetToSourceBytes"`
SourceToTargetDelta int64 `json:"sourceToTargetDelta"`
TargetToSourceDelta int64 `json:"targetToSourceDelta"`
SampleDurationMS int64 `json:"sampleDurationMs"`
LastActive time.Time `json:"lastActive"`
}
type RelaySessionSnapshot ¶
type RelaySessionSnapshot struct {
SessionID string
VNI int64
Source RelayClientSnapshot
Target RelayClientSnapshot
}
type RelaySnapshot ¶
type RelaySnapshot struct {
CollectedAt time.Time
Capability RelayCapability
IdentityEvidence RelayIdentityEvidence
Sessions []RelaySessionSnapshot
}
type RelaySource ¶
type RelaySource interface {
PeerRelaySnapshot(context.Context) (RelaySnapshot, error)
}
RelaySource is an optional capability implemented by sources that can passively observe Peer Relay sessions in addition to ordinary peer state. SnapshotSink samples this capability independently so relay failures cannot delay ordinary observations. Implementations have the same cancellation and shutdown obligations as Source.
type ReportEnvelope ¶
type ReportEnvelope struct {
Version int `json:"version"`
ReportID string `json:"reportId"`
ReporterInstanceID string `json:"reporterInstanceId"`
Sequence int64 `json:"sequence"`
CollectedAt time.Time `json:"collectedAt"`
Kind ReportKind `json:"kind"`
Observers []ObserverReport `json:"observers,omitempty"`
RelaySessions []RelaySessionObservation `json:"relaySessions,omitempty"`
}
type ReportKind ¶
type ReportKind string
const ( ReportObserverHello ReportKind = "observer_hello" ReportInventoryUpdate ReportKind = "inventory_update" ReportTrafficSample ReportKind = "traffic_sample" ReportObserverHeartbeat ReportKind = "observer_heartbeat" ReportObserverWithdrawal ReportKind = "observer_withdrawal" ReportRelaySessionUpdate ReportKind = "relay_session_update" )
type ReportReceipt ¶
type Reporter ¶
type Reporter interface {
Capabilities(context.Context) (Capabilities, error)
Send(context.Context, ReportEnvelope) (ReportReceipt, error)
}
type Snapshot ¶
type Snapshot struct {
CollectedAt time.Time
Observer NodeIdentity
Peers []PeerSnapshot
}
type SnapshotSink ¶
type SnapshotSink struct {
// contains filtered or unexported fields
}
func NewSnapshotSink ¶
func NewSnapshotSink(reporter Reporter, options SnapshotSinkOptions) *SnapshotSink
func (*SnapshotSink) Register ¶
func (s *SnapshotSink) Register(key string, source Source) (*Registration, error)
type SnapshotSinkOptions ¶
Click to show internal directories.
Click to hide internal directories.