apm: go.elastic.co/apm/module/apmzap Index | Files

package apmzap

import "go.elastic.co/apm/module/apmzap"


Package Files

core.go fields.go


const (
    // FieldKeyTraceID is the field key for the trace ID.
    FieldKeyTraceID = "trace.id"

    // FieldKeyTransactionID is the field key for the transaction ID.
    FieldKeyTransactionID = "transaction.id"

    // FieldKeySpanID is the field key for the span ID.
    FieldKeySpanID = "span.id"
const (
    // DefaultFatalFlushTimeout is the default value for Hook.FatalFlushTimeout.
    DefaultFatalFlushTimeout = 5 * time.Second

func TraceContext Uses

func TraceContext(ctx context.Context) []zapcore.Field

TraceContext returns zap.Fields containing the trace context of the transaction and span contained in ctx, if any.

type Core Uses

type Core struct {
    // Tracer is the apm.Tracer to use for reporting errors.
    // If Tracer is nil, then apm.DefaultTracer will be used.
    Tracer *apm.Tracer

    // FatalFlushTimeout is the amount of time to wait while
    // flushing a fatal log message to the APM Server before
    // the process is exited. If this is 0, then
    // DefaultFatalFlushTimeout will be used. If the timeout
    // is a negative value, then no flushing will be performed.
    FatalFlushTimeout time.Duration

Core is an implementation of zapcore.Core, reporting log records as errors to the APM Server. If TraceContext is used to add trace IDs to the log records, the errors reported will be associated with them.

func (*Core) Check Uses

func (c *Core) Check(entry zapcore.Entry, checked *zapcore.CheckedEntry) *zapcore.CheckedEntry

Check checks if the entry should be logged, and adds c to checked if so.

func (*Core) Enabled Uses

func (*Core) Enabled(level zapcore.Level) bool

Enabled returns true if level is >= zapcore.ErrorLevel.

func (*Core) Sync Uses

func (*Core) Sync() error

Sync is a no-op.

func (*Core) With Uses

func (c *Core) With(fields []zapcore.Field) zapcore.Core

With returns a new zapcore.Core that decorates c with fields.

func (*Core) WrapCore Uses

func (c *Core) WrapCore(core zapcore.Core) zapcore.Core

WrapCore returns zapcore.NewTee(core, c). WrapCore is suitable for passing to zap.WrapCore.

func (*Core) Write Uses

func (c *Core) Write(entry zapcore.Entry, fields []zapcore.Field) error

Write reports entry and fields as an error using c.tracer.

Package apmzap imports 6 packages (graph) and is imported by 1 packages. Updated 2020-11-06. Refresh now. Tools for package owners.