...

Package util

import "github.com/linkerd/linkerd2/viz/metrics-api/util"
Overview
Index

Overview ▾

func BuildEdgesRequest

func BuildEdgesRequest(p EdgesRequestParams) (*pb.EdgesRequest, error)

BuildEdgesRequest builds a Public API EdgesRequest from a EdgesRequestParams.

func BuildStatSummaryRequest

func BuildStatSummaryRequest(p StatsSummaryRequestParams) (*pb.StatSummaryRequest, error)

BuildStatSummaryRequest builds a Public API StatSummaryRequest from a StatsSummaryRequestParams.

func BuildTopRoutesRequest

func BuildTopRoutesRequest(p TopRoutesRequestParams) (*pb.TopRoutesRequest, error)

BuildTopRoutesRequest builds a Public API TopRoutesRequest from a TopRoutesRequestParams.

func K8sPodToPublicPod

func K8sPodToPublicPod(pod corev1.Pod, ownerKind string, ownerName string) *pb.Pod

K8sPodToPublicPod converts a Kubernetes Pod to a Public API Pod

func ValidateTimeWindow

func ValidateTimeWindow(window string) (string, error)

ValidateTimeWindow validates the given duration as a time window. If an empty string is provided, the default time window is returned, otherwise, if validation is successful, the original time window is returned.

type EdgesRequestParams

EdgesRequestParams contains parameters that are used to build Edges requests.

type EdgesRequestParams struct {
    Namespace     string
    ResourceType  string
    AllNamespaces bool
}

type GatewayRequestParams

GatewayRequestParams contains parameters that are used to build a GatewayRequest

type GatewayRequestParams struct {
    RemoteClusterName string
    GatewayNamespace  string
    TimeWindow        string
}

type StatsBaseRequestParams

StatsBaseRequestParams contains parameters that are used to build requests for metrics data. This includes requests to StatSummary and TopRoutes.

type StatsBaseRequestParams struct {
    TimeWindow    string
    Namespace     string
    ResourceType  string
    ResourceName  string
    AllNamespaces bool
}

type StatsSummaryRequestParams

StatsSummaryRequestParams contains parameters that are used to build StatSummary requests.

type StatsSummaryRequestParams struct {
    StatsBaseRequestParams
    ToNamespace   string
    ToType        string
    ToName        string
    FromNamespace string
    FromType      string
    FromName      string
    SkipStats     bool
    TCPStats      bool
    LabelSelector string
}

type TopRoutesRequestParams

TopRoutesRequestParams contains parameters that are used to build TopRoutes requests.

type TopRoutesRequestParams struct {
    StatsBaseRequestParams
    ToNamespace   string
    ToType        string
    ToName        string
    LabelSelector string
}