trace

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

This package allows you to init and enable tracing in your app

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitProvider

func InitProvider(
	ctx context.Context,
	serviceName string,
	options ...ProviderOptionFunc,
) (func() error, error)

func Start

func Start(
	ctx context.Context,
	appName string,
	host string,
	port int,
	apiKey string,
	isSecure bool,
) (func(ctx context.Context) error, error)

func WithBatchSize

func WithBatchSize(size int) func(*provider) error

WithBatchSize allows you to modify the batch size before it is sent

func WithGRPCTraceExporter

func WithGRPCTraceExporter(ctx context.Context, options ...otlptracegrpc.Option) func(*provider) error

WithGRPCTraceExporter allows you to send your traces to the collector target collectorTarget is the address of the collector, e.g. "127.0.0.1:4317"

func WithWriterTraceExporter

func WithWriterTraceExporter(w io.Writer) func(*provider) error

WithWriterTraceExporter allows you to push all traces to an io.Writer you can use io.Discard if you don't want to be bothered by these

Types

type ProviderOptionFunc

type ProviderOptionFunc func(*provider) error

ProviderOptionFunc is the option function for provider

Jump to

Keyboard shortcuts

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