Documentation
¶
Index ¶
- Constants
- func ContextWithTracer(parent context.Context, tracer Tracer) context.Context
- func HashAttribute(value string) string
- func IsCI() bool
- func IsFaaS() bool
- func MapToAttributes(m map[string]int64) []attribute.KeyValue
- func RecordError(span trace.Span, err error, opts ...trace.EventOption)
- type Client
- type Option
- func WithDebug() Option
- func WithDisabled() Option
- func WithEndpoint(endpoint string, insecure bool) Option
- func WithExporter(w io.WriteCloser) Option
- func WithFS(fs afero.Fs) Option
- func WithLogger(logger hclog.Logger) Option
- func WithResource(res *resource.Resource) Option
- func WithVersionInfo(version, commit, buildDate string) Option
- type SpanCloser
- type Tracer
Constants ¶
const CQTeamID = "12345678-0000-0000-0000-c1a0dbeef000"
Variables ¶
This section is empty.
Functions ¶
func ContextWithTracer ¶ added in v0.17.0
ContextWithTracer returns a copy of given context with tracer set as the current Tracer.
func HashAttribute ¶ added in v0.17.4
HashAttribute creates a one-way hash from an attribute
func IsCI ¶ added in v0.17.4
func IsCI() bool
IsCI determines if we're running under a CI env by checking CI-specific env vars
func IsFaaS ¶ added in v0.17.4
func IsFaaS() bool
IsFaaS determines if we're running under a Lambda env by checking Lambda-specific env vars
func MapToAttributes ¶ added in v0.17.0
func RecordError ¶ added in v0.17.0
func RecordError(span trace.Span, err error, opts ...trace.EventOption)
RecordError should be called on a span to mark it as errored. By default error values are not recorded, unless the debug flag is set.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the telemetry client.
func (*Client) NewRandomId ¶
NewRandomId returns true if we created a new random id in this session
type Option ¶
type Option func(*Client)
func WithDisabled ¶
func WithDisabled() Option
func WithEndpoint ¶
func WithExporter ¶
func WithExporter(w io.WriteCloser) Option
func WithLogger ¶
func WithLogger(logger hclog.Logger) Option
func WithResource ¶
func WithVersionInfo ¶
type SpanCloser ¶ added in v0.17.0
type SpanCloser func(error, ...otrace.SpanEndOption)
SpanCloser gets an error and options and ends the span its attached to
func StartSpanFromContext ¶ added in v0.17.0
func StartSpanFromContext(ctx context.Context, spanName string, opts ...otrace.SpanStartOption) (context.Context, SpanCloser)
StartSpanFromContext starts the span from a given context with the given options, and returns a new context with span attached, as well as a closer fn. Returned SpanCloser should be called when done with span. To catch panics, it should be used under a defer.