debugexporter

package module
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 7

README

Debug Exporter

Status
Stability development: traces, metrics, logs
Distributions core, contrib
Warnings Unstable Output Format
Issues Open issues Closed issues

Exports data to the console (stderr) via zap.Logger.

See also the Troubleshooting document for examples on using this exporter.

Getting Started

The following settings are optional:

  • verbosity (default = basic): the verbosity of the logging export (detailed|normal|basic). When set to detailed, pipeline data is verbosely logged.
  • sampling_initial (default = 2): number of messages initially logged each second.
  • sampling_thereafter (default = 500): sampling rate after the initial messages are logged (every Mth message is logged). Refer to Zap docs for more details. on how sampling parameters impact number of messages.

Example configuration:

exporters:
  debug:
    verbosity: detailed
    sampling_initial: 5
    sampling_thereafter: 200

Verbosity levels

The following subsections describe the output from the exporter depending on the configured verbosity level - basic, normal and detailed. The default verbosity level is basic.

Basic verbosity

With verbosity: basic, the exporter outputs a single-line summary of received data with a total count of telemetry records for every batch of received logs, metrics or traces.

Here's an example output:

2023-11-10T22:49:03.510-0600    info    TracesExporter  {"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 2}
Normal verbosity

With verbosity: normal, the exporter's behavior is currently the same as with verbosity: basic. See above for more details.

Detailed verbosity

With verbosity: detailed, the exporter outputs all details of every telemetry record, typically writing multiple lines for every telemetry record.

Here's an example output:

2023-11-10T22:49:03.510-0600    info    TracesExporter  {"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 2}
2023-11-10T22:49:03.510-0600    info    ResourceSpans #0
Resource SchemaURL: https://opentelemetry.io/schemas/1.4.0
Resource attributes:
     -> service.name: Str(telemetrygen)
ScopeSpans #0
ScopeSpans SchemaURL:
InstrumentationScope telemetrygen
Span #0
    Trace ID       : 3bde5d3ee82303571bba6e1136781fe4
    Parent ID      : 5e9dcf9bac4acc1f
    ID             : 2cf3ef2899aba35c
    Name           : okey-dokey
    Kind           : Server
    Start time     : 2023-11-11 04:49:03.509369393 +0000 UTC
    End time       : 2023-11-11 04:49:03.50949377 +0000 UTC
    Status code    : Unset
    Status message :
Attributes:
     -> net.peer.ip: Str(1.2.3.4)
     -> peer.service: Str(telemetrygen-client)
Span #1
    Trace ID       : 3bde5d3ee82303571bba6e1136781fe4
    Parent ID      :
    ID             : 5e9dcf9bac4acc1f
    Name           : lets-go
    Kind           : Client
    Start time     : 2023-11-11 04:49:03.50935117 +0000 UTC
    End time       : 2023-11-11 04:49:03.50949377 +0000 UTC
    Status code    : Unset
    Status message :
Attributes:
     -> net.peer.ip: Str(1.2.3.4)
     -> peer.service: Str(telemetrygen-server)
        {"kind": "exporter", "data_type": "traces", "name": "debug"}

Warnings

  • Unstable Output Format: The output formats for all verbosity levels is not guaranteed and may be changed at any time without a breaking change.

Documentation

Overview

Package debugexporter exports data to console as logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for Debug exporter

Types

type Config

type Config struct {
	// Verbosity defines the logging exporter verbosity.
	Verbosity configtelemetry.Level `mapstructure:"verbosity,omitempty"`

	// SamplingInitial defines how many samples are initially logged during each second.
	SamplingInitial int `mapstructure:"sampling_initial"`

	// SamplingThereafter defines the sampling rate after the initial samples are logged.
	SamplingThereafter int `mapstructure:"sampling_thereafter"`
}

Config defines configuration for logging exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL