Documentation
¶
Index ¶
- func AddSpanAttributes(span trace.Span, attributes map[string]interface{})
- func CreateSpanAttributes(attributes map[string]interface{}) []attribute.KeyValue
- type OpenTelemetryConfig
- type OpenTelemetryProvider
- func (p *OpenTelemetryProvider) GetMeter() metric.Meter
- func (p *OpenTelemetryProvider) GetTracer() trace.Tracer
- func (p *OpenTelemetryProvider) RecordBusinessEvent(ctx context.Context, eventType, tenantID string)
- func (p *OpenTelemetryProvider) RecordCacheOperation(ctx context.Context, operation string, duration time.Duration, hit bool)
- func (p *OpenTelemetryProvider) RecordDatabaseOperation(ctx context.Context, operation, table string, duration time.Duration)
- func (p *OpenTelemetryProvider) RecordError(ctx context.Context, errorType, service string)
- func (p *OpenTelemetryProvider) RecordHTTPRequest(ctx context.Context, method, path, status string, duration time.Duration, ...)
- func (p *OpenTelemetryProvider) SetActiveConnections(ctx context.Context, count int64)
- func (p *OpenTelemetryProvider) SetGoroutineCount(ctx context.Context, count int64)
- func (p *OpenTelemetryProvider) SetMemoryUsage(ctx context.Context, bytes int64)
- func (p *OpenTelemetryProvider) Shutdown(ctx context.Context) error
- func (p *OpenTelemetryProvider) StartSpan(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSpanAttributes ¶
AddSpanAttributes añade atributos a un span existente
func CreateSpanAttributes ¶
CreateSpanAttributes crea atributos comunes para spans
Types ¶
type OpenTelemetryConfig ¶
type OpenTelemetryConfig struct { ServiceName string ServiceVersion string Environment string // Tracing configuration TracingEnabled bool TracingEndpoint string TracingSampleRatio float64 // Metrics configuration MetricsEnabled bool MetricsEndpoint string MetricsInterval time.Duration // Logging configuration LogsEnabled bool LogsEndpoint string // Resource attributes DeploymentEnvironment string ServiceNamespace string ServiceInstanceID string // Propagation Propagators []string }
OpenTelemetryConfig configuración para OpenTelemetry
func DefaultOpenTelemetryConfig ¶
func DefaultOpenTelemetryConfig() *OpenTelemetryConfig
DefaultOpenTelemetryConfig retorna configuración por defecto
type OpenTelemetryProvider ¶
type OpenTelemetryProvider struct {
// contains filtered or unexported fields
}
OpenTelemetryProvider gestiona la configuración de OpenTelemetry
func NewOpenTelemetryProvider ¶
func NewOpenTelemetryProvider(config *OpenTelemetryConfig, logger logger.Logger) (*OpenTelemetryProvider, error)
NewOpenTelemetryProvider crea un nuevo proveedor de OpenTelemetry
func (*OpenTelemetryProvider) GetMeter ¶
func (p *OpenTelemetryProvider) GetMeter() metric.Meter
GetMeter retorna el meter
func (*OpenTelemetryProvider) GetTracer ¶
func (p *OpenTelemetryProvider) GetTracer() trace.Tracer
GetTracer retorna el tracer
func (*OpenTelemetryProvider) RecordBusinessEvent ¶
func (p *OpenTelemetryProvider) RecordBusinessEvent(ctx context.Context, eventType, tenantID string)
RecordBusinessEvent registra un evento de negocio
func (*OpenTelemetryProvider) RecordCacheOperation ¶
func (p *OpenTelemetryProvider) RecordCacheOperation(ctx context.Context, operation string, duration time.Duration, hit bool)
RecordCacheOperation registra una operación de cache
func (*OpenTelemetryProvider) RecordDatabaseOperation ¶
func (p *OpenTelemetryProvider) RecordDatabaseOperation(ctx context.Context, operation, table string, duration time.Duration)
RecordDatabaseOperation registra una operación de base de datos
func (*OpenTelemetryProvider) RecordError ¶
func (p *OpenTelemetryProvider) RecordError(ctx context.Context, errorType, service string)
RecordError registra un error
func (*OpenTelemetryProvider) RecordHTTPRequest ¶
func (p *OpenTelemetryProvider) RecordHTTPRequest(ctx context.Context, method, path, status string, duration time.Duration, tenantID string)
RecordHTTPRequest registra una request HTTP
func (*OpenTelemetryProvider) SetActiveConnections ¶
func (p *OpenTelemetryProvider) SetActiveConnections(ctx context.Context, count int64)
SetActiveConnections actualiza el gauge de conexiones activas
func (*OpenTelemetryProvider) SetGoroutineCount ¶
func (p *OpenTelemetryProvider) SetGoroutineCount(ctx context.Context, count int64)
SetGoroutineCount actualiza el contador de goroutines
func (*OpenTelemetryProvider) SetMemoryUsage ¶
func (p *OpenTelemetryProvider) SetMemoryUsage(ctx context.Context, bytes int64)
SetMemoryUsage actualiza el gauge de uso de memoria