Documentation ¶
Index ¶
- func Register(cfg []Config, grpcServer *grpc.Server) ([]*pluginsProto.PluginShort, error)
- type Config
- type Instance
- type Kiali
- func (k *Kiali) GetGraph(ctx context.Context, getGraphRequest *kialiProto.GetGraphRequest) (*kialiProto.GetGraphResponse, error)
- func (k *Kiali) GetMetrics(ctx context.Context, getMetricsRequest *kialiProto.GetMetricsRequest) (*kialiProto.GetMetricsResponse, error)
- func (k *Kiali) GetNamespaces(ctx context.Context, getNamespacesRequest *kialiProto.GetNamespacesRequest) (*kialiProto.GetNamespacesResponse, error)
- type Metric
- type ResponseError
- type Traffic
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 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 ResponseError ¶
type ResponseError struct {
Error string `json:"error"`
}