Documentation
¶
Overview ¶
Package telemetry contains opt-in runtime telemetry setup helpers.
Index ¶
- func RedactTelemetryValue(input string) string
- type EnvLookup
- type OTelConfig
- type OTelRuntime
- func ResolveOTelRuntime(cfg OTelConfig, lookup EnvLookup) OTelRuntime
- func SetupOTel(ctx context.Context, cfg OTelConfig) (OTelRuntime, func(context.Context) error, error)
- func SetupOTelWithLookup(ctx context.Context, cfg OTelConfig, lookup EnvLookup) (OTelRuntime, func(context.Context) error, error)
- type SentryCaptureOptions
- type SentryConfig
- type SentryFailureEvent
- type SentryRuntime
- func CaptureSentryFailure(root string, cfg SentryConfig, message string, lookup EnvLookup) (string, SentryRuntime, error)
- func CaptureSentryFailureWithOptions(root string, cfg SentryConfig, message string, lookup EnvLookup, ...) (string, SentryRuntime, error)
- func ResolveSentryRuntime(cfg SentryConfig, lookup EnvLookup) SentryRuntime
- type SpanHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedactTelemetryValue ¶
Types ¶
type OTelConfig ¶
type OTelRuntime ¶
type OTelRuntime struct {
// Enabled reports export: ResolveOTelRuntime sets it from the configured
// endpoint, and SetupOTel clears it when the exporter could not be created.
// SetupOTel installs local instrumentation independently of this flag.
Enabled bool
Endpoint string
Protocol string
Headers map[string]string
ServiceName string
ServiceVersion string
Environment string
RunID string
TenantDeploymentID string
StackKit string
Provider string
NodeID string
ResourceAttributes map[string]string
}
func ResolveOTelRuntime ¶
func ResolveOTelRuntime(cfg OTelConfig, lookup EnvLookup) OTelRuntime
func SetupOTel ¶
func SetupOTel(ctx context.Context, cfg OTelConfig) (OTelRuntime, func(context.Context) error, error)
func SetupOTelWithLookup ¶
func SetupOTelWithLookup(ctx context.Context, cfg OTelConfig, lookup EnvLookup) (OTelRuntime, func(context.Context) error, error)
SetupOTelWithLookup always installs the local resource, tracer provider and W3C trace-context plus baggage propagation, and returns the shutdown that removes them. The returned error reports only that the configured exporter could not be created (for example an endpoint the profile denies). It is not a setup failure: the runtime and shutdown stay valid, runtime.Enabled is false because nothing is exported, and no other destination is substituted.
type SentryCaptureOptions ¶
type SentryConfig ¶
type SentryFailureEvent ¶
type SentryFailureEvent struct {
EventID string `json:"eventId"`
SentryEventID string `json:"sentryEventId,omitempty"`
SentryDelivered bool `json:"sentryDelivered"`
CapturedAt time.Time `json:"capturedAt"`
Status string `json:"status"`
Message string `json:"message"`
Environment string `json:"environment,omitempty"`
Release string `json:"release,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Issues []string `json:"issues,omitempty"`
Redaction string `json:"redaction"`
DeliveryMode string `json:"deliveryMode"`
}
type SentryRuntime ¶
type SentryRuntime struct {
Enabled bool
DSN string
Environment string
Release string
ForbiddenAuthToken bool
Tags map[string]string
Issues []string
}
func CaptureSentryFailure ¶
func CaptureSentryFailure(root string, cfg SentryConfig, message string, lookup EnvLookup) (string, SentryRuntime, error)
func CaptureSentryFailureWithOptions ¶
func CaptureSentryFailureWithOptions(root string, cfg SentryConfig, message string, lookup EnvLookup, options SentryCaptureOptions) (string, SentryRuntime, error)
func ResolveSentryRuntime ¶
func ResolveSentryRuntime(cfg SentryConfig, lookup EnvLookup) SentryRuntime
type SpanHandle ¶
type SpanHandle struct {
// contains filtered or unexported fields
}
func (SpanHandle) End ¶
func (h SpanHandle) End()
func (SpanHandle) IsRecording ¶
func (h SpanHandle) IsRecording() bool
func (SpanHandle) RecordError ¶
func (h SpanHandle) RecordError(err error)
func (SpanHandle) SetAttributes ¶
func (h SpanHandle) SetAttributes(attrs map[string]string)
func (SpanHandle) SetRolloutStatus ¶
func (h SpanHandle) SetRolloutStatus(status, description string)
Click to show internal directories.
Click to hide internal directories.