Skip to content

service/telemetry: internal telemetry cannot be sent via otlphttp #13275

Open
@tpaschalis

Description

@tpaschalis

Component(s)

service

What happened?

Describe the bug
I'm trying to send the collector's internal telemetry. When using the otlp exporter, the collector starts normally.
When using the otlp exporter, the collector fails with a nondescript error.

Steps to reproduce

Use the following config file and run the collector.

What did you expect to see?
The collector should send telemetry regardless of the exporter type used.

What did you see instead?
The error I copy-pasted above.

Note: When using the otlp exporter, the collector starts up correctly.

Collector version

v0.128.0

Environment information

Environment

OS: macOS
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

service:
  telemetry:
    metrics:
      readers:
        - periodic:
            exporter:
              otlphttp:
                endpoint: "https://mybackend"

Log output

$ ./otelcol-contrib --config config2.yaml
panic: reflect: Key of non-map type interface {}

goroutine 1 [running]:
reflect.(*rtype).Key(0x10?)
        reflect/map_swiss.go:24 +0x80
github.com/go-viper/mapstructure/v2.(*Decoder).decodeMap(0x1400153fee0, {0x1400116b380, 0x1c}, {0x10fa16e80, 0x14001560c60}, {0x10f3ef3a0?, 0x14001560c40?, 0x10467a44c?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:867 +0x88
github.com/go-viper/mapstructure/v2.(*Decoder).decodeStructFromMap(0x1400153fee0, {0x1400116b380, 0x1c}, {0x10fa17680?, 0x140015609f0?, 0x11020e380?}, {0x11020e380?, 0x14001560c30?, 0x14001419ad8?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1504 +0x1350
github.com/go-viper/mapstructure/v2.(*Decoder).decodeStruct(0x1400153fee0, {0x1400116b380, 0x1c}, {0x10fa17680?, 0x140015609f0?}, {0x11020e380?, 0x14001560c30?, 0x10455f6bc?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1305 +0x3f8
github.com/go-viper/mapstructure/v2.(*Decoder).decode(0x1400153fee0, {0x1400116b380, 0x1c}, {0x10fa17680, 0x140015609f0}, {0x11020e380?, 0x14001560c30?, 0x0?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:532 +0x71c
github.com/go-viper/mapstructure/v2.(*Decoder).decodeStructFromMap(0x1400153fee0, {0x14001332798, 0x13}, {0x10fa17680?, 0x140015608d0?, 0x11020e440?}, {0x11020e440?, 0x14001560c30?, 0x1400141a5c8?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1489 +0x730
github.com/go-viper/mapstructure/v2.(*Decoder).decodeStruct(0x1400153fee0, {0x14001332798, 0x13}, {0x10fa17680?, 0x140015608d0?}, {0x11020e440?, 0x14001560c30?, 0x104632460?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1305 +0x3f8
github.com/go-viper/mapstructure/v2.(*Decoder).decode(0x1400153fee0, {0x14001332798, 0x13}, {0x10fa17680, 0x140015608d0}, {0x11020e440?, 0x14001560c30?, 0x10fa17680?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:532 +0x71c
github.com/go-viper/mapstructure/v2.(*Decoder).decodePtr(0x1400153fee0, {0x14001332798, 0x13}, {0x10fa17680, 0x140015608d0}, {0x10f58c240?, 0x14001560ba0?, 0x10455f6bc?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1131 +0x3a4
github.com/go-viper/mapstructure/v2.(*Decoder).decode(0x1400153fee0, {0x14001332798, 0x13}, {0x10fa17680, 0x140015608d0}, {0x10f58c240?, 0x14001560ba0?, 0x14001566750?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:536 +0x68c
github.com/go-viper/mapstructure/v2.(*Decoder).decodeStructFromMap(0x1400153fee0, {0x14000c83850, 0xa}, {0x10fa17680?, 0x14001560780?, 0x11020e500?}, {0x11020e500?, 0x14001560ba0?, 0x1400141b278?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1489 +0x730
github.com/go-viper/mapstructure/v2.(*Decoder).decodeStruct(0x1400153fee0, {0x14000c83850, 0xa}, {0x10fa17680?, 0x14001560780?}, {0x11020e500?, 0x14001560ba0?, 0x1045a6858?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:1305 +0x3f8
github.com/go-viper/mapstructure/v2.(*Decoder).decode(0x1400153fee0, {0x14000c83850, 0xa}, {0x10fa17680, 0x14001560780}, {0x11020e500?, 0x14001560ba0?, 0x10d8d54a8?})
        github.com/go-viper/mapstructure/v2@v2.2.1/mapstructure.go:532 +0x71c

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions