Documentation
¶
Overview ¶
utility/bedrock.go
utility/genid.go
utility/loki.go
utility/otel.go
utility/prometheus.go
utility/s3.go
Index ¶
- func AddSpanAttributes(ctx context.Context, attributes ...attribute.KeyValue)
- func EndSpan(span trace.Span)
- func GenerateFileID() string
- func GenerateID() string
- func GetTracer(name string) trace.Tracer
- func InitBedrock(cfg *config.Config) error
- func InitLogger(l *logrus.Logger)
- func InitLokiLogger(cfg *config.Config) error
- func InitMetrics()
- func InitS3Client(cfg *config.Config) (*s3.Client, error)
- func InitTracer(cfg *config.Config) func()
- func LogError(ctx *gin.Context, message string, err error)
- func LogFatal(ctx *gin.Context, message string, err error)
- func LogInfo(ctx *gin.Context, message string)
- func LogMetrics(metrics Metrics)
- func LogWarn(ctx *gin.Context, message string)
- func LogWithLoki(ctx *gin.Context, level, message string, err error)
- func PrometheusHandler() gin.HandlerFunc
- func RecordError(ctx context.Context, err error)
- func RecordFileUpload(fileType string, sizeBytes float64)
- func RecordHTTPRequest(method, endpoint string, status int, duration float64)
- func StartSpan(ctx context.Context, name string) (context.Context, trace.Span)
- func UploadFileToS3(ctx context.Context, client *s3.Client, bucket string, key string, ...) (string, error)
- func WithSpan(ctx context.Context, name string, fn func(context.Context) error) error
- type Message
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSpanAttributes ¶
AddSpanAttributes adds attributes to the current span
func GenerateFileID ¶
func GenerateFileID() string
func GenerateID ¶
func GenerateID() string
func InitBedrock ¶
func InitLogger ¶
InitLogger should be called from your main application to set up the logger
func InitLokiLogger ¶
func InitTracer ¶
InitTracer initializes the OpenTelemetry tracer
func PrometheusHandler ¶
func PrometheusHandler() gin.HandlerFunc
PrometheusHandler returns a handler for the /metrics endpoint
func RecordError ¶
RecordError records an error in the current span
func RecordFileUpload ¶
RecordFileUpload records metrics for a file upload
func RecordHTTPRequest ¶
RecordHTTPRequest records metrics for an HTTP request
Types ¶
Click to show internal directories.
Click to hide internal directories.