Closed shravanipatil527 closed 10 months ago
Hello,
We also checked for other option : Store pipeline logs In Elastic and visualize logs exclusively in Elastic (logs no longer visible through Jenkins screens). Here it should gives us "hyperlink to the logs visualization in Kibana" but this is also not working. It still gives blank screen.
The only option that works for us is: Don't store pipeline logs in Elastic.
What is the result of the "validate elasticsearch configuration" button in the config page? See:
1) Yes, I can confirm. When "Store pipeline logs In Elastic and visualize logs both in Elastic and through Jenkins" option is used it only shows logs only in Elasticsearch and kibana but not on Jenkins. 2) No error logs are seen in in Jenkins logs.
i am having similar issue with jenkins logs not getting pushed through open telemetry. however, i see pipeline stages
@shravanipatil527 Can your Jenkins host connect to Elasticsearch? In any case, there must be errors in the logs of some kind when you access the console log. JEnkns agents and Jenkins Controller need visibility to Elasticsearch to send and retrieve the logs.
the stack trace in logs will be similar to the one at https://github.com/jenkinsci/opentelemetry-plugin/issues/421
Confirmed in 2.16, the logs are only displayed in BlueOcean and Elasticsearch, but not in the Console output.
It is related to the changes to mirror the logs locally at https://github.com/jenkinsci/opentelemetry-plugin/releases/tag/opentelemetry-2.10.0
Now you have to specify the property otel.logs.mirror_to_disk=true
in advanced settings. So, the option to store logs locally from the backend Elastic Stack does nothing locally now. The logic was removed.
Enabling the local mirror you lose the link to the logs in the Console output, you still send the logs to Elasticsearch but you have to find them manually.
So we have to remove the option to store logs locally from the Elastic Stack backend, make clear how to enable local mirror of the logs, and avoid losing the link to the Kibana logs when the Elastic Stack backend is enabled.
Hi @kuisathaverat I have been working on the implementation of OpenTelemetry with @shravanipatil527 and I tried your suggestion but it didn't work. The option was "Store pipeline logs In Elastic and visualize logs both in Elastic and through Jenkins".
It is related to the changes to mirror the logs locally at https://github.com/jenkinsci/opentelemetry-plugin/releases/tag/opentelemetry-2.10.0 Now you have to specify the property
otel.logs.mirror_to_disk=true
in advanced settings. So, the option to store logs locally from the backend Elastic Stack does nothing locally now. The logic was removed.Enabling the local mirror you lose the link to the logs in the Console output, you still send the logs to Elasticsearch but you have to find them manually.
The option was "Store pipeline logs In Elastic and visualize logs both in Elastic and through Jenkins".
That option is what it is broken, it no longer retrieves the logs from Elasticsearch, the only option Store pipeline logs In Elastic and visualize logs in Elastic
, then enable otel.logs.mirror_to_disk=true
. This has the issue that you lost the link to Kibana to see the logs. If you do not enable otel.logs.mirror_to_disk=true
you will only see the link to Kibana to view the logs.
The option was "Store pipeline logs In Elastic and visualize logs both in Elastic and through Jenkins".
That option is what it is broken, it no longer retrieves the logs from Elasticsearch, the only option
Store pipeline logs In Elastic and visualize logs in Elastic
, then enableotel.logs.mirror_to_disk=true
. This has the issue that you lost the link to Kibana to see the logs. If you do not enableotel.logs.mirror_to_disk=true
you will only see the link to Kibana to view the logs.
These are the options that I have. Also I added this otel.logs.mirror_to_disk=true
in the place that you have mentioned. But still can't see the logs on the console output.
Weird, I have tested it with Jenkins Core 2.401.3 and OpenTelemetry plugin 2.16
Weird, I have tested it with Jenkins Core 2.401.3 and OpenTelemetry plugin 2.16
To add more context about weird, during the pipeline run until it finished I could see the logs in the console output after the pipeline finished and you exit that page or do a page reload it's empty. This also affects all pipeline runs before enabling this option.
I will see to update the OpenTelemetry plugin the current version is 2.12.0
We have many Jenkins environments with the same version and use the same OpenTelemetry version. But only one has this problem which is really strange.
Picking up from @shravanipatil527 and @Geni2 , I've upgraded the plugin to the latest version (current 2.17) and still no luck. I've tried different combinations:
otel.logs.mirror_to_disk=true
otel.logs.mirror_to_disk=true
with curl I was able to query elasticsearch search api from the jenkins controller node to retrieve records from the index:
I also observed something very interesting, when any other setting that is not Don't store pipeline logs in Elastic
is selected, the following behavior occurs:
/var/lib/jenkins/jobs/MyJobName/builds/60563/log
Also, it does not show the button "View logs in Elastic Observability" as it should
I'll continue investigating it...
I've found the problem... We had a plugin called "Delete logs" enabled, and as soon as it got disabled everything worked as expected
So I don't think it's a problem with this plugin, therefore we can close the Issue
in some cases, the cause is the index pattern, it needs to be logs-apm.app-*,.ds-logs-apm.app*
instead of only logs-apm.app-*
on Elastic Stack 8+
Jenkins and plugins versions report
What Operating System are you using (both controller, and any agents involved in the problem)?
Linux
Reproduction steps
Expected Results
It should show the build logs in console output
Actual Results
It shows nothing. Gives only a blank screen
Anything else?
Opentelemetry configuration: