Skip to content

LoggingMetricExporter toString omits aggregation temporality #8622

Description

@thswlsqls

Describe the bug
LoggingMetricExporter.toString() returns the constant "LoggingMetricExporter{}", hiding aggregationTemporality — the only setting this exporter has. An exporter created with DELTA and one created with the default CUMULATIVE print identically.

Steps to reproduce

System.out.println(LoggingMetricExporter.create());                            // LoggingMetricExporter{}
System.out.println(LoggingMetricExporter.create(AggregationTemporality.DELTA)); // LoggingMetricExporter{}

What did you expect to see?
The configured temporality. OtlpGrpcMetricExporter, OtlpHttpMetricExporter, and OtlpStdoutMetricExporter all print theirs — including OtlpStdoutMetricExporter, a debug/stdout exporter like this one. #6402 ("Add missing fields to OTLP metric exporters") fixed exactly this for the OTLP metric exporters; LoggingMetricExporter was not updated.

What did you see instead?
The same string for both temporalities. This reaches real debug output: OpenTelemetrySdk.toString() prints the meter provider, and PeriodicMetricReader.toString() appends "exporter=" + exporter, so a config dump only shows exporter=LoggingMetricExporter{}.

Offending code: LoggingMetricExporter.toString() (exporters/logging/src/main/java/io/opentelemetry/exporter/logging/LoggingMetricExporter.java line 108-111).

What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-logging
Version: main @ 63ebd94
How did you reference these artifacts? implementation("io.opentelemetry:opentelemetry-exporter-logging")

Environment
Compiler: Temurin 21
OS: N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions