jenkinsci / opentelemetry-plugin

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

stages with 'skipped due to earlier failure(s)' should have attribute or another status 2 #926

Open sebEg opened 3 months ago

sebEg commented 3 months ago

What feature do you want to see added?

Hi,

We are trying to use the plugin to find out where pipelines failed, similar to https://github.com/jenkinsci/opentelemetry-plugin/issues/281. To make this easier, PR https://github.com/jenkinsci/opentelemetry-plugin/pull/283 already implemented to 'Use spanStatus "unset" rather than "ko" when interruption cause is parallel fail fast'. However, later stages that are also 'skipped due to earlier failure(s)' are still marked with otel.status_code=ERROR. I would expect that these stages also have the spanStatus "unset"?

In this example:

options { parallelsAlwaysFailFast() }
stages {
    stage('ze-parallel-stage') {
        parallel {
            stage('failingBranch') {
                steps {
                    error 'the failure'
                }
            }
            stage('parallelBranch1') {
                steps {
                    sleep 5
                }
            }
            stage('parallelBranch2') {
                steps {
                     sleep 5
                }
            }
            stage('parallelBranch3') {
                steps {
                    sleep 5
                }
            }
        }
    }
    stage('another stage') {
        steps {
            sleep 5
        }
    }
} 

I would expect that another stage has the same spanStatus as the parallelBranches, instead of otel.status_code=ERROR:

image

Upstream changes

No response

Are you interested in contributing this feature?

No response