open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.33k stars 1.44k forks source link

OTLP-HTTP-Exporter: Add debug logging to the exporter #5629

Open EddieEldridge opened 2 years ago

EddieEldridge commented 2 years ago

Is your feature request related to a problem? Please describe. It's difficult to debug vendor specific issues when there is no way to log out the actual requests to and responses from OTLP endpoints.

Describe the solution you'd like Something like https://github.com/open-telemetry/opentelemetry-collector/blob/7666eb04c30e5cfd750db9969fe507562598f0ae/exporter/otlphttpexporter/otlp.go#L127 but actually log out the request that is going to be sent and the response the server returns.

Describe alternatives you've considered Setting up a proxy server to log out requests/responses although I would consider this a bit extreme for what is required.

Additional context The config might look something like

exporters:
  otlphttp/metrics:
    endpoint: "https://1.2.3.4:1234"
    loglevel: debug
jpkrohling commented 2 years ago

Don't we have a level that is even more detailed than debug? If so, the body could be logged at that level.

toporek3112 commented 2 months ago

Mabe try 'detailed' I can remeber that I used/saw it in the past Also logging works for me when i configure:

 service:
       pipelines:
         ....

       telemetry:
          logs: 
            level: "debug"
            encoding: "json"
EddieEldridge commented 2 months ago

Mabe try 'detailed' I can remeber that I used/saw it in the past Also logging works for me when i configure:

 service:
       pipelines:
         ....

       telemetry:
          logs: 
            level: "debug"
            encoding: "json"

@toporek3112 This is about including the HTTP requests being sent from the Collector as part of that logging, not just enabling the logging itself.