Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry tracing utilities for the xg2g application.
Package telemetry provides OpenTelemetry tracing utilities for the xg2g application.
Index ¶
- Constants
- func EPGAttributes(days, channels, events, concurrency, retries int) []attribute.KeyValue
- func ErrorAttributes(_ error, errorType string) []attribute.KeyValue
- func HTTPAttributes(method, route, url string, statusCode int) []attribute.KeyValue
- func JobAttributes(jobType, status string, durationMS int64) []attribute.KeyValue
- func StreamAttributes(channel, serviceID, bouquet string) []attribute.KeyValue
- func Tracer(name string) trace.Tracer
- func TranscodeAttributes(inputCodec, outputCodec, device string, bitrate int, gpuEnabled bool) []attribute.KeyValue
- type Config
- type Provider
Constants ¶
View Source
const ( // HTTP attributes HTTPMethodKey = "http.method" HTTPStatusCodeKey = "http.status_code" HTTPRouteKey = "http.route" HTTPURLKey = "http.url" HTTPUserAgentKey = "http.user_agent" // Streaming attributes StreamChannelKey = "stream.channel" StreamServiceIDKey = "stream.service_id" StreamBouquetKey = "stream.bouquet" // Transcoding attributes TranscodeCodecKey = "transcode.codec" TranscodeInputCodecKey = "transcode.input_codec" TranscodeOutputCodecKey = "transcode.output_codec" TranscodeBitrateKey = "transcode.bitrate" TranscodeResolutionKey = "transcode.resolution" TranscodeDeviceKey = "transcode.device" TranscodeGPUEnabledKey = "transcode.gpu_enabled" // EPG attributes EPGDaysKey = "epg.days" EPGChannelsKey = "epg.channels" EPGEventsKey = "epg.events" EPGConcurrencyKey = "epg.concurrency" EPGRetriesKey = "epg.retries" // Job attributes JobTypeKey = "job.type" JobStatusKey = "job.status" JobDurationKey = "job.duration_ms" // Error attributes ErrorKey = "error" ErrorTypeKey = "error.type" )
Common attribute keys for consistent tracing across the application.
Variables ¶
This section is empty.
Functions ¶
func EPGAttributes ¶
EPGAttributes creates EPG-related span attributes.
func ErrorAttributes ¶
ErrorAttributes creates error-related span attributes.
func HTTPAttributes ¶
HTTPAttributes creates common HTTP span attributes.
func JobAttributes ¶
JobAttributes creates job-related span attributes.
func StreamAttributes ¶
StreamAttributes creates streaming-related span attributes.
Types ¶
type Config ¶
type Config struct {
// Enabled determines if telemetry is active
Enabled bool
// ServiceName is the name of the service (e.g., "xg2g")
ServiceName string
// ServiceVersion is the version of the service
ServiceVersion string
// Environment is the deployment environment (e.g., "production", "development")
Environment string
// ExporterType defines the exporter to use: "grpc", "http", or "noop"
ExporterType string
// Endpoint is the OTLP collector endpoint (e.g., "localhost:4317" for gRPC, "localhost:4318" for HTTP)
Endpoint string
// SamplingRate is the trace sampling rate (0.0 to 1.0, where 1.0 = 100%)
SamplingRate float64
}
Config holds telemetry configuration.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider manages the OpenTelemetry tracer provider.
func NewProvider ¶
NewProvider creates and initializes a new OpenTelemetry tracer provider.
Click to show internal directories.
Click to hide internal directories.