kiali

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(cfg []Config, grpcServer *grpc.Server) ([]*pluginsProto.PluginShort, error)

Register is used to register the Kiali plugin at our gRPC server, with all configured instances.

Types

type Config

type Config struct {
	Name        string  `yaml:"name"`
	Description string  `yaml:"description"`
	Address     string  `yaml:"address"`
	Username    string  `yaml:"username"`
	Password    string  `yaml:"password"`
	Token       string  `yaml:"token"`
	Traffic     Traffic `yaml:"traffic"`
}

type Instance

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

type Kiali

type Kiali struct {
	kialiProto.UnimplementedKialiServer
	// contains filtered or unexported fields
}

func (*Kiali) GetGraph

func (k *Kiali) GetGraph(ctx context.Context, getGraphRequest *kialiProto.GetGraphRequest) (*kialiProto.GetGraphResponse, error)

GetGraph returns the data to render the graph for the requested namespaces. We unmarshal the response from the Kiali API into our protobuf message format. After that we loop through all edges and nodes to transform some of the returned field. This is required so that we can simplify that rendering of the graph in our React UI.

We generate all labels for the edges, where each edge contains the request and success rate for http traffic and the bytes for tcp traffic. For http traffic we also determine the status for the edge. This can be enabled in the configuration of a single Kiali instance. It is also possible to configure the thresholds. For all nodes we determine which image should be rendered within a node, the type of the node and the label for a node.

func (*Kiali) GetMetrics

func (k *Kiali) GetMetrics(ctx context.Context, getMetricsRequest *kialiProto.GetMetricsRequest) (*kialiProto.GetMetricsResponse, error)

GetMetrics returns the Prometheus metrics for the given workload/service from the Kiali API. We transform the API response into our protobuf message format, so that we can handle the datapoints better in the React UI.

func (*Kiali) GetNamespaces

func (k *Kiali) GetNamespaces(ctx context.Context, getNamespacesRequest *kialiProto.GetNamespacesRequest) (*kialiProto.GetNamespacesResponse, error)

GetNamespaces returns all namespaces for the requested instance. We just passthrough the call to the Kiali API. Then we unmarshal the response into our protobuf message format and return it to the frontend.

type Metric

type Metric struct {
	Labels     map[string]string `json:"labels"`
	Datapoints [][]interface{}   `json:"datapoints"`
	Stat       string            `json:"stat"`
	Name       string            `json:"name"`
}

type ResponseError

type ResponseError struct {
	Error string `json:"error"`
}

type Traffic

type Traffic struct {
	Degraded float64 `yaml:"degraded"`
	Failure  float64 `yaml:"failure"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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