jenkinsci / opentelemetry-plugin

Monitor and observe Jenkins with OpenTelemetry.
https://plugins.jenkins.io/opentelemetry/
Apache License 2.0
93 stars 47 forks source link

Send Logs To Loki while Still Preserving Console Output #841

Open BbBaboo42 opened 1 month ago

BbBaboo42 commented 1 month ago

What feature do you want to see added?

In the Grafana Visualization Observability Backend, you currently must choose between:

  1. Don't store pipeline logs in Loki
  2. Store pipeline logs In Loki and visualize logs exclusively in Grafana (logs no longer visible through Jenkins screens)

While I do want the logs to be sent to Loki, I still need for the Console Output to exist, for other Jenkins plugins such as BlueOcean, Pipeline Overview and others.

Upstream changes

No response

Are you interested in contributing this feature?

No response

chewrocca commented 1 month ago

I believe this may be related. https://github.com/jenkinsci/opentelemetry-plugin/issues/773

BbBaboo42 commented 1 month ago

I now see that configuring otel.logs.mirror_to_disk=true in the plugin configuration does achieve my goal. However, It is very strange that for me to collect the build logs to loki, I have to add a Grafana Visualization Backend, and under its advanced option choose: Store pipeline logs in Loki and visualize logs exclusively in Grafana (logs no longer visible through Jenkins Controler)

Which I then supposed to cancel out with the configuration otel.logs.mirror_to_disk=true

cyrille-leclerc commented 2 weeks ago

FYI

PR above is about mirroring pipeline logs in Jenkins and Loki. A subsequent improvement would be to display in Jenkins logs stored in Loki so we no longer need to mirror logs in order to display logs in Jenkins GUIs

cyrille-leclerc commented 1 week ago

FYI PR above is merged and released

FYI New feature in progress to close the gap: