istiowatcher

package
v0.0.0-...-b5acc33 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IstioProxyTotalRequestsCMD = "pilot-agent request GET stats?format=json&filter=istio_requests_total\\.*reporter\\.source"
	IstioSidecarContainerName  = "istio-proxy"
	IstioPodsLabelSelector     = "security.istio.io/tlsMode"
	MetricsBufferedChannelSize = 100
)

Envoy metric sample { "name": "istiocustom.istio_requests_total.reporter.source.source_workload.sleep.source_canonical_service.sleep

		.source_canonical_revision.latest.source_workload_namespace.default.source_principal.unknown.source_app
		.sleep.source_version.source_cluster.Kubernetes.destination_workload.unknown.destination_workload_namespace
		.unknown.destination_principal.unknown.destination_app.unknown.destination_version.unknown.destination_service
		.security.ubuntu.com.destination_canonical_service.unknown.destination_canonical_revision.latest
		.destination_service_name.PassthroughCluster.destination_service_namespace.unknown.destination_cluster
		.unknown.request_protocol.http.response_code.200.grpc_response_status.response_flags.-
		.connection_security_policy.unknown.request_path./ubuntu/dists/jammy-security/InRelease"
}

Variables

View Source
var (
	ConnectionInfoInsufficient = errors.New("connection info partial or empty")
	GroupNames                 = []string{
		"source_workload",
		"source_workload_namespace",
		"destination_workload",
		"destination_workload_namespace",
		"request_method",
		"request_path",
	}
)

Functions

func ToGraphQLIstioConnections

func ToGraphQLIstioConnections(connections map[ConnectionWithPath]time.Time) []model.IstioConnection

Types

type ConnectionPairWithPath

type ConnectionPairWithPath struct {
	SourceWorkload      string `json:"sourceWorkload"`
	DestinationWorkload string `json:"destinationWorkload"`
	RequestPath         string `json:"requestPath"`
}

type ConnectionWithPath

type ConnectionWithPath struct {
	SourceWorkload       string `json:"source_workload"`
	SourceNamespace      string `json:"source_workload_namespace"`
	DestinationWorkload  string `json:"destination_workload"`
	DestinationNamespace string `json:"destination_workload_namespace"`
	RequestPath          string `json:"request_path"`
	RequestMethod        string `json:"request_method"`
}

type EnvoyMetrics

type EnvoyMetrics struct {
	Stats []Metric `json:"stats"`
}

type IstioConnectionResultMatcher

type IstioConnectionResultMatcher struct {
	model.IstioConnectionResults
}

IstioConnectionResultMatcher Implement gomock.Matcher interface for []model.IstioConnectionResults

func (*IstioConnectionResultMatcher) Matches

func (m *IstioConnectionResultMatcher) Matches(x interface{}) bool

func (*IstioConnectionResultMatcher) String

type IstioReporter

type IstioReporter interface {
	ReportIstioConnectionResults(ctx context.Context, results model.IstioConnectionResults) (bool, error)
}

type IstioWatcher

type IstioWatcher struct {
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(resolver IstioReporter) (*IstioWatcher, error)

NewWatcher The Istio watcher uses this interface because it used to be a standalone component that communicates with the network mapper, and was then integrated into the network mapper.

func (*IstioWatcher) CollectIstioConnectionMetrics

func (m *IstioWatcher) CollectIstioConnectionMetrics(ctx context.Context, namespace string) error

func (*IstioWatcher) Flush

func (m *IstioWatcher) Flush() map[ConnectionWithPath]time.Time

func (*IstioWatcher) ReportResults

func (m *IstioWatcher) ReportResults(ctx context.Context)

func (*IstioWatcher) RunForever

func (m *IstioWatcher) RunForever(ctx context.Context) error

type Metric

type Metric struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

Directories

Path Synopsis
Package mock_istiowatcher is a generated GoMock package.
Package mock_istiowatcher is a generated GoMock package.

Jump to

Keyboard shortcuts

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