tracing

package
v1.83.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTracingServiceName added in v1.77.0

func BuildTracingServiceName(namespace, app string) string

Types

type Client

type Client struct {
	ClientInterface
	// contains filtered or unexported fields
}

Client for Tracing API.

func NewClient

func NewClient(ctx context.Context, cfg *config.Config, token string) (*Client, error)

NewClient creates a tracing Client. If it fails to create the client for any reason, it will retry indefinitely until the context is cancelled.

func (*Client) GetAppTraces

func (in *Client) GetAppTraces(namespace, app string, q models.TracingQuery) (*model.TracingResponse, error)

GetAppTraces fetches traces of an app

func (*Client) GetErrorTraces

func (in *Client) GetErrorTraces(ns, app string, duration time.Duration) (int, error)

GetErrorTraces fetches number of traces in error for the given app

func (*Client) GetServiceStatus

func (in *Client) GetServiceStatus() (bool, error)

func (*Client) GetTraceDetail

func (in *Client) GetTraceDetail(strTraceID string) (*model.TracingSingleTrace, error)

GetTraceDetail fetches a specific trace from its ID

type ClientInterface

type ClientInterface interface {
	GetAppTraces(ns, app string, query models.TracingQuery) (traces *model.TracingResponse, err error)
	GetTraceDetail(traceId string) (*model.TracingSingleTrace, error)
	GetErrorTraces(ns, app string, duration time.Duration) (errorTraces int, err error)
	GetServiceStatus() (available bool, err error)
}

ClientInterface for mocks (only mocked function are necessary here)

type GRPCClientInterface added in v1.77.0

type GRPCClientInterface interface {
	FindTraces(context context.Context, app string, q models.TracingQuery) (response *model.TracingResponse, err error)
	GetTrace(context context.Context, traceID string) (*model.TracingSingleTrace, error)
	GetServices(context context.Context) (bool, error)
}

GRPCClientInterface for Mocks, also for Tempo or Jaeger

type HTTPClientInterface

type HTTPClientInterface interface {
	GetAppTracesHTTP(client http.Client, baseURL *url.URL, serviceName string, q models.TracingQuery) (response *model.TracingResponse, err error)
	GetTraceDetailHTTP(client http.Client, endpoint *url.URL, traceID string) (*model.TracingSingleTrace, error)
	GetServiceStatusHTTP(client http.Client, baseURL *url.URL) (bool, error)
}

HTTPClientInterface for Mocks, also for Tempo or Jaeger

Jump to

Keyboard shortcuts

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