Help us shape the future of Go! Take the 2026 Go Developer Survey

usage

package
v1.21.19 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GEMENI_AI_BACKEND       FeatureType = "Gemini AI Backend"
	LLM_AI_BACKEND          FeatureType = "LLM AI Backend"
	AZURE_OPENAI_AI_BACKEND FeatureType = "Azure OpenAI AI Backend"
	ANTHROPIC_AI_BACKEND    FeatureType = "Anthropic AI Backend"
	MISTRAL_AI_BACKEND      FeatureType = "MistralAI AI Backend"
	OPENAI_AI_BACKEND       FeatureType = "OpenAI AI Backend"
	VERTEXAI_AI_BACKEND     FeatureType = "VertexAI AI Backend"

	CONSUL_BACKEND         FeatureType = "Consul Backend"
	GCP_BACKEND            FeatureType = "GCP Backend"
	STATIC_BACKEND         FeatureType = "Static Backend"
	AWS_EC2_BACKEND        FeatureType = "AWS EC2 Backend"
	AWS_LAMBDA_BACKEND     FeatureType = "AWS Lambda Backend"
	AZURE_FUNCTION_BACKEND FeatureType = "Azure Function Backend"

	PIPE_BACKEND           FeatureType = "Pipe Backend"
	KUBE_BACKEND           FeatureType = "Kube Backend"
	UPSTREAM_HEALTH_CHECKS FeatureType = "Upstream Health Checks"
	OUTLIER_DETECTION      FeatureType = "Outlier Detection"

	UPSTREAM_HTTP2      FeatureType = "Upstream HTTP2"
	UPSTREAM_HTTP_PROXY FeatureType = "Upstream HTTP Proxy"

	FAILOVER         FeatureType = "Failover"
	CIRCUIT_BREAKERS FeatureType = "Circuit Breakers"
	UPSTREAM_MTLS    FeatureType = "Upstream mTLS"
	UPSTREAM_TLS     FeatureType = "Upstream TLS"
	REDIRECT         FeatureType = "Redirect"
	GRAPHQL          FeatureType = "GraphQl"

	DELEGATION          FeatureType = "Delegation"
	ROUTE_TABLE_WEIGHTS FeatureType = "Route Table Weights"

	DIRECT_RESPONSE            FeatureType = "Direct Response"
	AI_SEMANTIC_CACHE          FeatureType = "AI Semantic Cache"
	AI_PROMPT_ENRICHMENT       FeatureType = "AI Prompt Enrichment"
	AI_RAG                     FeatureType = "AI Rag"
	AI_PROMPT_GUARD            FeatureType = "AI Prompt Guard"
	CONNECT_MATCHING           FeatureType = "Connect Matching"
	PREFIX_PATH_MATCHING       FeatureType = "Prefix Path Matching"
	EXACT_PATH_MATCHING        FeatureType = "Exact Path Matching"
	REGEX_PATH_MATCHING        FeatureType = "Regex Path Matching"
	METHOD_MATCHING            FeatureType = "Method Matching"
	QUERY_PARAMETER_MATCHING   FeatureType = "Query Parameter Matching"
	HEADER_MATCHING            FeatureType = "Header Matching"
	PORTAL_AUTH                FeatureType = "Portal Auth"
	HMAC_AUTH                  FeatureType = "HMAC Auth"
	BUFFER_PER_ROUTE           FeatureType = "Buffer Per Route"
	PASSTHROUGH_AUTH           FeatureType = "Passthrough Auth"
	OPA_AUTH                   FeatureType = "OPA Auth"
	PLUGIN_AUTH                FeatureType = "Plugin Auth"
	API_KEY_AUTH               FeatureType = "API Key Auth"
	BASIC_AUTH                 FeatureType = "Basic Auth"
	LDAP_AUTH                  FeatureType = "LDAP Auth"
	OAUTH2_AUTH                FeatureType = "OAuth2 Auth"
	TRANSFORMATIONS            FeatureType = "Transformations"
	CORS                       FeatureType = "CORS"
	HEADER_MANIPULATION        FeatureType = "Header Manipulation"
	ROUTE_STATS                FeatureType = "Route Stats"
	RETRIES                    FeatureType = "Retries"
	HTTPS                      FeatureType = "HTTPS"
	MTLS                       FeatureType = "MTLS"
	PROXY_PROTOCOL             FeatureType = "Proxy Protocol"
	TCP_ROUTING                FeatureType = "TCP Routing"
	LOCAL_RATE_LIMITING        FeatureType = "Local Rate Limiting"
	CONNECTION_LIMIT           FeatureType = "Connection Limit"
	HTTP_CONNECTION_MANAGEMENT FeatureType = "HTTP Connection Management"
	INBOUND_HEALTH_CHECK       FeatureType = "Inbound Health Check"
	WEB_APPLICATION_FIREWALL   FeatureType = "Web Application Firewall"
	HEADER_VALIDATION          FeatureType = "Header Validation"
	TAP_FILTER                 FeatureType = "Tap Filter"
	STATEFUL_SESSION           FeatureType = "Stateful Session"
	WASM                       FeatureType = "WASM"
	DATA_LOSS_PREVENTION       FeatureType = "Data Loss Prevention"
	DYNAMIC_FORWAD_PROXY       FeatureType = "Dynamic Forward Proxy"
	CLUSTER_HEADER             FeatureType = "Cluster Header"
	MULTI_UPSTREAM_ROUTE       FeatureType = "Multi Upstream Route"
	UPSTREAM_GROUP_ROUTE       FeatureType = "Upstream Group Route"

	GRPC_JSON_TRANSCODING FeatureType = "GRPC JSON Transcoder"
	GZIP_COMPRESSION      FeatureType = "gzip Compression"
	FAULT_INJECTION       FeatureType = "Fault Injection"
	PREFIX_REWRITE        FeatureType = "Prefix Rewrite"
	UPSTREAM_TIMEOUT      FeatureType = "Request Timeout"
	ROUTE_TRACING         FeatureType = "Route Tracing"
	REQUEST_SHADOWING     FeatureType = "Request Shadowing"
	HOST_REWRITE          FeatureType = "Host Rewrite"
	AUTO_HOST_REWRITE     FeatureType = "Auto Host Rewrite"
	APPEND_XFF_HEADER     FeatureType = "Append XFF Header"
	CSRF                  FeatureType = "CSRF"
	MAX_STREAM_DURATION   FeatureType = "Max Stream Duration"
	IDLE_TIMEOUT          FeatureType = "Idle Timeout"

	EXTERNAL_PROCESSING          FeatureType = "External Processing"
	HASH_LOAD_BALANCING          FeatureType = "Hash Load Balancing"
	LOCALITY_LOAD_BALANCING      FeatureType = "Locality Load Balancing"
	LEAST_REQUEST_LOAD_BALANCING FeatureType = "Least Request Load Balancing"
	MAGLEV_LOAD_BALANCING        FeatureType = "Maglev Load Balancing"
	ROUND_ROBIN_LOAD_BALANCING   FeatureType = "Round Robin Load Balancing"
	RANDOM_LOAD_BALANCING        FeatureType = "Random Load Balancing"
	RING_HASH_LOAD_BALANCING     FeatureType = "Ring Hash Load Balancing"

	REGEX_REWRITE                      FeatureType = "Regex Rewrite"
	RESPONSE_CACHING                   FeatureType = "Response Caching"
	BUFFER_LIMIT                       FeatureType = "Buffer Limit"
	TLS_ROUTING                        FeatureType = "TLS Routing"
	SOCKET_OPTIONS                     FeatureType = "Socket Options"
	MOST_SPECIAL_HEADER_MUTATIONS_WINS FeatureType = "Most Specific Header Mutations Wins"
	HYBRID_GATEWAY                     FeatureType = "Hybrid Gateway"
	MAX_DIRECT_RESPONSE_BODY_SIZE      FeatureType = "Max Direct Response Body Size"
	ACCESS_LOGGING                     FeatureType = "Access Logging"
	EARLY_ACCESS_LOGGING               FeatureType = "Early Access Logging"
	CONNECTION_BALANCING               FeatureType = "Connection Balancing"
	RATE_LIMITING                      FeatureType = "Rate Limiting"
	JWT                                FeatureType = "JWT"
	RBAC                               FeatureType = "RBAC"

	DISCOVERY_NAMESPACE                      FeatureType = "Discovery Namespace"
	WATCH_NAMESPACES                         FeatureType = "Watch Namespaces"
	KUBERNETES_CONFIG_SOURCE                 FeatureType = "Kubernetes Config Source"
	DIRECTORY_CONFIG_SOURCE                  FeatureType = "Directory Config Source"
	CONSUL_KV_SOURCE                         FeatureType = "Consul KV Source"
	UPSTREAM_GROUP_CONFIG_SOURCE             FeatureType = "Upstream Group Config Source"
	KUBERNETES_SECRET_SOURCE                 FeatureType = "Kubernetes Secret Source"
	VAULT_SECRET_SOURCE                      FeatureType = "Vault Secret Source"
	DIRECTORY_SECRET_SOURCE                  FeatureType = "Directory Secret Source"
	KUBERNETES_SECRET_SOURCE_OPTIONS         FeatureType = "Kubernetes Secret Source Options"
	VAULT_SECRET_SOURCE_OPTIONS              FeatureType = "Vault Secret Source Options"
	DIRECTORY_SECRET_SOURCE_OPTIONS          FeatureType = "Directory Secret Source Options"
	KUBERNETES_ARTIFACT_SOURCE               FeatureType = "Kubernetes Artifact Source"
	DIRECTORY_ARTIFACT_SOURCE                FeatureType = "Directory Artifact Source"
	CONSUL_KV_ARTIFACT_SOURCE                FeatureType = "Consul KV Artifact Source"
	REFRESH_RATE                             FeatureType = "Refresh Rate"
	FDS_WHITELIST                            FeatureType = "FDS Whitelist"
	FDS_DISABLED                             FeatureType = "FDS Disabled"
	DEV_MODE                                 FeatureType = "Dev Mode"
	LINKERD                                  FeatureType = "Linkerd"
	KNATIVE                                  FeatureType = "Knative"
	UDS_DISCOVERY                            FeatureType = "UDS Discovery"
	GRAPHQL_FDS                              FeatureType = "GraphQL FDS"
	XDS_BIND_ADDR                            FeatureType = "XDS Bind Addr"
	VALIDATION_BIND_ADDR                     FeatureType = "Validation Bind Addr"
	GLOBAL_CIRCUIT_BREAKER                   FeatureType = "Global Circuit Breakers"
	ENDPOINTS_WARMING_TIMEOUT                FeatureType = "Endpoints Warming Timeout"
	AWS_OPTIONS                              FeatureType = "AWS Options"
	INVALID_CONFIG_POLICY                    FeatureType = "Invalid Config Policy"
	DISABLE_KUBERNETES_DESTINATIONS          FeatureType = "Disable Kubernetes Destinations"
	DISABLE_GRPC_WEB                         FeatureType = "Disable GRPC Web"
	DISABLE_PROXY_GARBAGE_COLLECTION         FeatureType = "Disable Proxy Garbage Collection"
	REGEX_MAX_PROGRAM_SIZE                   FeatureType = "Regex Max Program Size"
	REST_XDS_BIND_ADDR                       FeatureType = "REST XDS Bind Addr"
	FAIL_OVER_UPSTREAM_DNS_POLLING_INTERVAL  FeatureType = "Fail Over Upstream DNS Polling Interval"
	REMOVE_UNUSED_FILTERS                    FeatureType = "Remove Unused Filters"
	PROXY_DEBUG_BIND_ADDR                    FeatureType = "Proxy Debug Bind Addr"
	LOG_TRANSFORMATION_REQUEST_RESPONSE_INFO FeatureType = "Log Transformation Request Response Info"
	TRANSFORMATION_ESCAPE_CHARACTERS         FeatureType = "Transformation Escape Characters"
	ISTIO_OPTIONS                            FeatureType = "Istio Options"
	VALIDATION_OPTIONS                       FeatureType = "Validation Options"
	READ_GATEWAYS_FROM_ALL_NAMESPACES        FeatureType = "Read Gateways From All Namespaces"
	COMPRESSED_PROXY_SPEC                    FeatureType = "Compressed Proxy Spec"
	GLOBAL_ONE_WAY_TLS                       FeatureType = "Global One Way TLS"
	PERSIST_PROXY_SPEC                       FeatureType = "Persist Proxy Spec"
	DISABLE_GATEWAY_CONTROLLER               FeatureType = "Enable Gateway Controller"
	ISOLATE_VIRTUAL_HOSTS_BY_SSL_CONFIG      FeatureType = "Isolate Virtual Hosts By SSL Config"
	TRANSLATE_EMPTY_GATEWAYS                 FeatureType = "Translate Empty Gateways"
	CONSUL_CONFIGURATION                     FeatureType = "Consul Configuration"
	CONSUL_DISCOVERY                         FeatureType = "Consul Discovery"
	KUBERNETES_API_RATE_LIMITS               FeatureType = "Kubernetes API Rate Limits"
	GLOBAL_EXTENSIONS                        FeatureType = "Global Extensions"
	GLOBAL_RBAC                              FeatureType = "Global RBAC"
	GLOBAL_EXTAUTH_SETTINGS                  FeatureType = "Global Extauth Settings"
	GLOBAL_NAMED_EXTAUTH_SETTINGS            FeatureType = "Global Named Extauth Settings"
	GLOBAL_CACHING_SERVER_SETTINGS           FeatureType = "Global Caching Server Settings"
	GLOBAL_METADATA_SETTINGS                 FeatureType = "Global Metadata Settings"
	GLOBAL_OBSERVABILITY_SETTINGS            FeatureType = "Global Observability Settings"
	GLOBAL_UPSTREAM_SETTINGS                 FeatureType = "Global Upstream Settings"
	GLOBAL_WATCH_NAMESPACE_SELECTORS         FeatureType = "Global Watch Namespace Selectors"

	GLOBAL_GRAPHQL_SETTINGS FeatureType = "Global GraphQL Settings"
	GLOBAL_EXTPROC_SETTINGS FeatureType = "Global Extproc Settings"
	GlooEdgeAPI             API         = "Gloo Edge API"
	GatewayAPI              API         = "Gateway API"
	KGatewayAPI             API         = "kGateway API"
)

Variables

This section is empty.

Functions

func LoadSnapshotFromGloo

func LoadSnapshotFromGloo(opts *Options, tempDir string) (string, error)

func NewPortForwardedClient

func NewPortForwardedClient(ctx context.Context, kubectlCli *kubectl.Cli, podSelector, namespace string, port int) (*admincli.Client, func(), error)

func RootCmd

func RootCmd(op *options.Options) *cobra.Command

Types

type API

type API string

func (API) MarshalYAML

func (a API) MarshalYAML() (interface{}, error)

type Address

type Address struct {
	SocketAddress SocketAddress `json:"socket_address,omitempty"`
	Pipe          struct {
		Path string `json:"path"`
	} `json:"pipe,omitempty"`
}

type Category

type Category string

type CircuitBreakers

type CircuitBreakers struct {
	Thresholds []Threshold `json:"thresholds"`
}

type ClusterStatus

type ClusterStatus struct {
	Name              string          `json:"name"`
	AddedViaAPI       bool            `json:"added_via_api"`
	HostStatuses      []HostStatus    `json:"host_statuses"`
	CircuitBreakers   CircuitBreakers `json:"circuit_breakers"`
	ObservabilityName string          `json:"observability_name"`
	EdsServiceName    string          `json:"eds_service_name,omitempty"`
}

type Clusters

type Clusters struct {
	ClusterStatuses []ClusterStatus `json:"cluster_statuses"`
}

type EndpointStat

type EndpointStat struct {
	Name  string `json:"name"`
	Value string `json:"value,omitempty"`
	Type  string `json:"type,omitempty"`
}

type EnvoyMetrics

type EnvoyMetrics struct {
	Total2xxResponses         int64
	Total3xxResponses         int64
	Total4xxResponses         int64
	Total5xxResponses         int64
	UptimeSeconds             int64
	AverageResponsesPerSecond float64
}

type FeatureCalculator

type FeatureCalculator struct {
	Configs  *snapshot.Instance
	Features map[API][]*UsageStat `json:"glooFeatureUsage"`
}

func (*FeatureCalculator) AddUsageStat

func (f *FeatureCalculator) AddUsageStat(stat *UsageStat)

func (*FeatureCalculator) ProcessHTTPListenerOptions

func (f *FeatureCalculator) ProcessHTTPListenerOptions(options *gloov1.HttpListenerOptions, parentName string, parentKind string, parentAPI API, proxyNames []string)

type FeatureType

type FeatureType string

func (FeatureType) MarshalYAML

func (f FeatureType) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler interface

type GlooFeatureUsage

type GlooFeatureUsage struct {
	APICounts            map[string]int                        `json:"apiCounts" yaml:"apiCounts"`
	FeatureCountPerProxy map[string]*ProxyFeatureCountCategory `json:"featureCountPerProxy" yaml:"featureCountPerProxy"`
}

type GlooProxyStats

type GlooProxyStats struct {
	GlooProxyMetrics *EnvoyMetrics   `json:"glooProxyMetrics" yaml:"glooProxyMetrics"`
	GlooProxyStats   []*UpstreamStat `json:"glooProxyStats" yaml:"glooProxyStats"`
}

type HealthStatus

type HealthStatus struct {
	EdsHealthStatus string `json:"eds_health_status"`
}

type HostStatus

type HostStatus struct {
	Address      Address        `json:"address"`
	Stats        []EndpointStat `json:"stats"`
	HealthStatus HealthStatus   `json:"health_status"`
	Weight       int            `json:"weight"`
	Hostname     string         `json:"hostname,omitempty"`
	Locality     Locality       `json:"locality"`
}

type Inputs

type Inputs struct {
	GlooEdgeConfigs *snapshot.Instance    `json:"glooEdgeConfigs"`
	K8sClusterInfo  *K8sClusterInfo       `json:"k8sClusterInfo"`
	ProxyStats      map[string]*ProxyInfo `json:"proxyStats"`
}

type K8sClusterInfo

type K8sClusterInfo struct {
	Nodes    []corev1.Node    `json:"nodes"`
	Pods     []corev1.Pod     `json:"pods"`
	Services []corev1.Service `json:"services"`
}

type KubernetesStats

type KubernetesStats struct {
	Pods          int            `json:"pods" yaml:"pods"`
	NodeResources *NodeResources `json:"nodeResources" yaml:"nodeResources"`
	Services      int            `json:"services" yaml:"services"`
}

type Label

type Label string

type Locality

type Locality struct {
	Region  string `json:"region"`
	Zone    string `json:"zone"`
	SubZone string `json:"sub_zone"`
}

type NodeResources

type NodeResources struct {
	TotalCPUCores int64 `json:"totalCPUCores" yaml:"totalCPUCores"`
	TotalMemoryGb int64 `json:"totalMemoryGb" yaml:"totalMemoryGb"`
	Nodes         int   `json:"nodes" yaml:"nodes"`
}

type Options

type Options struct {
	*options.Options
	ControlPlaneName      string
	ControlPlaneNamespace string
	GlooSnapshotFile      string
	ScanProxies           []string
	ProxyNamespaces       []string
	IncludeEndpointStats  bool
	OutputFormat          string
}

type ProxyData

type ProxyData struct {
	Name         string        `json:"name" yaml:"name"`
	Namespace    string        `json:"namespace" yaml:"namespace"`
	EnvoyMetrics *EnvoyMetrics `json:"envoyMetrics" yaml:"envoyMetrics"`
}

type ProxyFeatureCount

type ProxyFeatureCount struct {
	FeatureCount map[FeatureType]int `json:"featureCount" yaml:"featureCount"`
}

type ProxyFeatureCountCategory

type ProxyFeatureCountCategory struct {
	Categories map[Category]ProxyFeatureCount `json:"categories" yaml:"categories"`
}

type ProxyInfo

type ProxyInfo struct {
	Clusters *Clusters
	Stats    *Stats
}

type SocketAddress

type SocketAddress struct {
	Address   string `json:"address"`
	PortValue int    `json:"port_value"`
}

type Stat

type Stat struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

type Stats

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

type Threshold

type Threshold struct {
	MaxConnections     int    `json:"max_connections"`
	MaxPendingRequests int    `json:"max_pending_requests"`
	MaxRequests        int    `json:"max_requests"`
	MaxRetries         int    `json:"max_retries"`
	Priority           string `json:"priority,omitempty"`
}

type UpstreamStat

type UpstreamStat struct {
	Upstream      string
	Region        string
	Zone          string
	SubZone       string
	IPAddress     string
	Port          int
	RqSuccess     int
	RqError       int
	CxActive      int
	CxConnectFail int
}

type UsageMetadata

type UsageMetadata struct {
	ProxyNames      []string `json:"proxyNames" yaml:"proxyNames,flow"`
	Name            string   `json:"name" yaml:"name"`
	Namespace       string   `json:"namespace" yaml:"namespace"`
	ParentName      string   `json:"parentName" yaml:"parentName"`
	ParentNamespace string   `json:"parentNamespace" yaml:"parentNamespace"`
	Kind            string   `json:"kind" yaml:"kind"`
	Category        Category `json:"category" yaml:"category,double"`
	API             API      `json:"api" yaml:"api,double"`
}

type UsageStat

type UsageStat struct {
	Type     FeatureType   `json:"type" yaml:"type,double"`
	Metadata UsageMetadata `json:"metadata" yaml:"metadata"`
}

type UsageStats

type UsageStats struct {
	GlooFeatureUsage map[API]*GlooFeatureUsage  `json:"glooFeatureUsage" yaml:"glooFeatureUsage"`
	GlooProxyStats   map[string]*GlooProxyStats `json:"glooProxyStats" yaml:"glooProxyStats"`
	KubernetesStats  *KubernetesStats           `json:"kubernetesStats" yaml:"kubernetesStats"`
}

func (*UsageStats) Print

func (u *UsageStats) Print(format string) error

Jump to

Keyboard shortcuts

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