servicegraph

package
v0.0.0-...-5253b6b Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

README

Istio ServiceGraph

WARNING WARNING WARNING WARNING

These services are examples ONLY. This code may change at will, or be removed entirely without warning. Taking any dependency on this code is done at your own peril.

Services

Servicegraph service

Defined in servicegraph/cmd/server, this provides a basic HTTP API for generating servicegraphs. It exposes the following endpoints:

  • /graph which provides a JSON serialization of the servicegraph
  • /dotgraph which provides a dot serialization of the servicegraph
  • /dotviz which provides a visual representation of the servicegraph

All endpoints take an optional argument of time_horizon, which controls the timespan to consider for graph generation.

All endpoints also take an optional arugment of filter_empty=true, which will restrict the nodes and edges shown to only those that reflect non-zero traffic levels during the specified time_horizon.

Demosvc service

Defined in servicegraph/cmd/demosvc, this provides a simple HTTP endpoint that generates prometheus metrics. This can be used to test the servicegraph service.

Documentation

Overview

Package servicegraph defines the core model for the servicegraph service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes map[string]string

Attributes contain a set of annotations for an edge.

type Dynamic

type Dynamic struct {
	Nodes map[string]struct{} `json:"nodes"`
	Edges []*Edge             `json:"edges"`
}

Dynamic represents a service graph generated on the fly.

func (*Dynamic) AddEdge

func (d *Dynamic) AddEdge(src, target string, lbls map[string]string)

AddEdge adds a new edge to an existing dynamic graph.

func (*Dynamic) Merge

func (d *Dynamic) Merge(static *Static)

Merge adds all of the nodes in the static graph into the dynamic graph.

type Edge

type Edge struct {
	Source string     `json:"source"`
	Target string     `json:"target"`
	Labels Attributes `json:"labels"`
}

Edge represents an edge in a dynamic service graph.

type SerializeFn

type SerializeFn func(w io.Writer, g *Dynamic) error

SerializeFn provides a mechanism for writing out the service graph.

type Static

type Static struct {
	Nodes map[string]struct{}
}

Static represents a service graph generated by API calls that is meant to persist across generation requests. It must be merged with a Dynamic graph to provide a complete service graph for Istio.

Directories

Path Synopsis
cmd
Package dot provides serialization utilities for a servicegraph using the dot format.
Package dot provides serialization utilities for a servicegraph using the dot format.
Package promgen generates service graphs from a prometheus backend.
Package promgen generates service graphs from a prometheus backend.

Jump to

Keyboard shortcuts

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