Skip to content

[exporter/debug] change behavior of "normal" verbosity to be different from "basic" #7806

Closed
@andrzej-stencel

Description

@andrzej-stencel

EDIT: Updated the issue to change the debug exporter instead of logging exporter.

Collector version: v0.88.0

Is your feature request related to a problem? Please describe.

Currently there are three verbosity levels available for the Debug exporter: basic, normal, detailed. The basic and normal level result in the same output, which only displays the number of records:

exporters:
  logging:
    verbosity: normal
2023-06-01T13:26:16.044+0200    info    MetricsExporter {"kind": "exporter", "data_type": "metrics", "name": "logging", "resource metrics": 1, "metrics": 1, "data points": 1}

On the other hand, the detailed verbosity displays all the details about telemetry, with multiple lines per span/data point/log record:

2023-06-01T13:30:22.669+0200    info    MetricsExporter {"kind": "exporter", "data_type": "metrics", "name": "logging", "resource metrics": 1, "metrics": 1, "data points": 1}
2023-06-01T13:30:22.669+0200    info    ResourceMetrics #0
Resource SchemaURL: 
ScopeMetrics #0
ScopeMetrics SchemaURL: 
InstrumentationScope otelcol/httpcheckreceiver 0.78.0
Metric #0
Descriptor:
     -> Name: httpcheck.duration
     -> Description: Measures the duration of the HTTP check.
     -> Unit: ms
     -> DataType: Gauge
NumberDataPoints #0
Data point attributes:
     -> http.url: Str(https://opentelemetry.io)
StartTimestamp: 2023-06-01 11:30:18.60847008 +0000 UTC
Timestamp: 2023-06-01 11:30:21.630471795 +0000 UTC
Value: 1038

Describe the solution you'd like

I propose to change the behavior for the normal verbosity to display telemetry details one line per span/data point/log record:

exporters:
  logging:
    verbosity: normal
2023-06-01T13:30:22.669+0200    info    MetricsExporter {"kind": "exporter", "data_type": "metrics", "name": "logging", "resource metrics": 1, "metrics": 1, "data points": 1}
2023-06-01T13:30:22.669+0200    info    MetricDataPoint httpcheck.duration{http.url=Str(https://opentelemetry.io)} 1038

The format is up for discussion, but I believe having one line per telemetry record might be a good "middle ground". The resource and scope details might or might not also be displayed, I'm open to suggestions.

Describe alternatives you've considered

I considered using the File exporter, which outputs JSON with full information on the telemetry to a file.

  • It only outputs to a file. I don't think it's possible to make it output to the collector's console output?
  • The output is too verbose to my taste, also it puts eeeverything in a single line. It would be much more readable to have one line per telemetry record (span/data point/log record).

Another alternative for metrics is to use Prometheus exporter, but it modifies data (replaces dots with underscores etc.).

Metadata

Metadata

Labels

exporter/debugIssues related to the Debug exporter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions