zipkin_graphql

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 25 Imported by: 0

README

zipkin-query-graphql

graphql to query zipkin trace data

Commitizen friendly Go Report Card GoDoc Build Status codecov

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllEnv = []Env{
	EnvSit,
	EnvPerf,
	EnvUat,
	EnvProd,
}

Functions

func GenerateScrollQuery

func GenerateScrollQuery(index string, svcs []string, fr, to time.Time) map[string]interface{}

func LoggerMiddleware

func LoggerMiddleware(ctx *gin.Context)

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func RunServer

func RunServer(addr string)

func SetupESCli

func SetupESCli(esapi string)

func URLJoin

func URLJoin(paths ...string) (p string)

URLJoin join path

Types

type ComplexityRoot

type ComplexityRoot struct {
	Query struct {
		Traces func(childComplexity int, env Env, want []string, exclude []string, size int, daterange DateRange) int
	}

	Span struct {
		DurationMs func(childComplexity int) int
		Svcs       func(childComplexity int) int
		URL        func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DateRange

type DateRange struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type DirectiveRoot

type DirectiveRoot struct {
}

type ESClient

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

func NewESClient

func NewESClient(api string) (*ESClient, error)

func (*ESClient) LoadSpansChan

func (es *ESClient) LoadSpansChan(ctx context.Context, maxN int, index string, svcs []string, fr, to time.Time) (outchan chan *SpanDocu, err error)

type ESDocu

type ESDocu struct {
	Index  string    `json:"_index"`
	Type   string    `json:"_type"`
	Score  float64   `json:"_score"`
	Source *SpanDocu `json:"_source"`
}

type Env added in v0.0.4

type Env string
const (
	EnvSit  Env = "sit"
	EnvPerf Env = "perf"
	EnvUat  Env = "uat"
	EnvProd Env = "prod"
)

func (Env) IsValid added in v0.0.4

func (e Env) IsValid() bool

func (Env) MarshalGQL added in v0.0.4

func (e Env) MarshalGQL(w io.Writer)

func (Env) String added in v0.0.4

func (e Env) String() string

func (*Env) UnmarshalGQL added in v0.0.4

func (e *Env) UnmarshalGQL(v interface{}) error

type Pagination

type Pagination struct {
	Page int `json:"page"`
	Size int `json:"size"`
}

type QueryResolver

type QueryResolver interface {
	Traces(ctx context.Context, env Env, want []string, exclude []string, size int, daterange DateRange) ([]Span, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

type ScrollHit

type ScrollHit struct {
	Total int       `json:"total"`
	Hits  []*ESDocu `json:"hits"`
}

type ScrollResp

type ScrollResp struct {
	ScrollID string     `json:"_scroll_id"`
	Hits     *ScrollHit `json:"hits"`
}

type Span

type Span struct {
	URL        string   `json:"url"`
	Svcs       []string `json:"svcs"`
	DurationMs int      `json:"duration_ms"`
}

type SpanDocu

type SpanDocu struct {
	LocalEndpoint   *SpanSvcInfo `json:"localEndpoint"`
	TimestampMillis int          `json:"timestamp_millis"`
	TraceID         string       `json:"traceId"`
	Kind            string       `json:"kind"`
	Name            string       `json:"name"`
	ID              string       `json:"id"`
	ParentID        string       `json:"parentId"`
}

type SpanSvcInfo

type SpanSvcInfo struct {
	ServiceName string `json:"serviceName"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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