jenkinsci / opentelemetry-plugin

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

Is it possible to capture arguments passed into the plugins? #730

Closed jamie-harness closed 6 months ago

jamie-harness commented 8 months ago

What feature do you want to see added?

Sorry, I'm not sure if this is the right place to post, there might already be a solution/configuration to it.

I noticed that for git plugin, it traces the repository. But for other plugins what's passed in is not traced. For example sh(label: 'Maven install', script: 'mvn -Dmaven.test.failure.ignore=true clean package') does not trace the shell script part.

Is there a way to get that information?

Thanks in advance

Upstream changes

No response

cyrille-leclerc commented 8 months ago

Thanks Jamie for your interest in the Jenkins OpenTelemetry plugin. We have not implemented the collection of the shell script as it can be a very long character large object that are ,not suited to be captured as span attributes.

Moreover, our recommendation is for users to instrument their shell script with tools like the otel-cli our like instrumentation of build tools similar to the instrumentation of Maven or JUnit.

How would you imagine such capture of the "sh" step script details in the Jenkins OpenTelemetry plugin?

kuisathaverat commented 6 months ago

If you need the command executed it is the logs associated with the step ran, the attribute span.id and labels.jenkins_pipeline_step_id are the same in the step span and the log line, so there is a correlation between spans and logs that you can use to enrich the experience.