Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigGetter(e config.ExtraConfig) (interface{}, error)
- func NewGinLogger(cfg config.ExtraConfig, loggerConfig gin.LoggerConfig) gin.HandlerFunc
- func RegisterOpenTelemetry(ctx context.Context, cfg config.ServiceConfig, log logging.Logger) error
- type ElasticCommonSchemaFormatter
- type Logger
- type LoggingConfig
- type LogrusFormatter
- type TelemetryConfig
- type TracingConfig
- type TracingResourceAttributes
Constants ¶
View Source
const (
Namespace = "github_com/darren-bell-optiva/optiva-product-shared-krakend-telemetry"
)
Variables ¶
View Source
var ErrNoConfig = errors.New("unable to load custom config")
View Source
var ErrWrongConfig = errors.New("getting the extra config for the krakend-logrus module")
ErrWrongConfig is the error returned when there is no config under the namespace
Functions ¶
func ConfigGetter ¶
func ConfigGetter(e config.ExtraConfig) (interface{}, error)
func NewGinLogger ¶
func NewGinLogger(cfg config.ExtraConfig, loggerConfig gin.LoggerConfig) gin.HandlerFunc
func RegisterOpenTelemetry ¶
Types ¶
type Logger ¶
Logger is a wrapper over a github.com/sirupsen/logrus logger
func NewApplicationLogger ¶
func NewApplicationLogger(cfg config.ExtraConfig) (*Logger, error)
NewLogger returns a krakend logger wrapping a logrus logger
func (*Logger) Critical ¶
func (l *Logger) Critical(v ...interface{})
Critical implements the logger interface but demotes to the error level
func (*Logger) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug implements the logger interface
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error implements the logger interface
type LoggingConfig ¶
type LoggingConfig struct { SkipPaths []string `json:"skip_paths` Level string `json:"level"` Module string `json:"module"` ECSFormatter *ElasticCommonSchemaFormatter `json:"json"` }
type LogrusFormatter ¶
type LogrusFormatter struct {
// contains filtered or unexported fields
}
func (LogrusFormatter) AccessLogFormatter ¶
func (lf LogrusFormatter) AccessLogFormatter(params gin.LogFormatterParams) string
type TelemetryConfig ¶
type TelemetryConfig struct { Logging LoggingConfig `json:"logging` Tracing TracingConfig `json:"tracing` }
type TracingConfig ¶
type TracingConfig struct { ExportUrl string `json:"exporter_url` Attributes TracingResourceAttributes `json:"attributes"` }
type TracingResourceAttributes ¶
type TracingResourceAttributes struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.