opentelemetry-plugin icon indicating copy to clipboard operation
opentelemetry-plugin copied to clipboard

Send Logs To Loki while Still Preserving Console Output

Open BbBaboo42 opened this issue 1 year ago • 4 comments

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

BbBaboo42 avatar May 02 '24 13:05 BbBaboo42

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

chewrocca avatar May 03 '24 12:05 chewrocca

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

BbBaboo42 avatar May 16 '24 06:05 BbBaboo42

FYI

  • https://github.com/jenkinsci/opentelemetry-plugin/pull/858

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 avatar Jun 05 '24 22:06 cyrille-leclerc

FYI PR above is merged and released

FYI New feature in progress to close the gap:

  • https://github.com/jenkinsci/opentelemetry-plugin/pull/865

cyrille-leclerc avatar Jun 14 '24 09:06 cyrille-leclerc

Solved by

  • https://github.com/jenkinsci/opentelemetry-plugin/releases/tag/3.1261.v46101e2a_3660 image

cyrille-leclerc avatar Jul 10 '24 21:07 cyrille-leclerc