Giter Site home page Giter Site logo

Comments (5)

cyrille-leclerc avatar cyrille-leclerc commented on August 31, 2024

Thanks @ipleten , I'm sorry but I don't understand well the problem. I have not worked on this area for a while.
Can you please share with us a simplified test case to reproduce the problem and indications of he span attributes that are contributing to the problem?

from opentelemetry-plugin.

ipleten avatar ipleten commented on August 31, 2024

Here is pipeline:

pipeline {
    agent {
        kubernetes {
            yaml '''
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: shell
    image: ubuntu
    command:
    - sleep
    args:
    - infinity
'''
            defaultContainer 'shell'
        }
    }
    stages {
        stage('first') {
            steps {
                echo "passed"
            }
        }
        stage('second') {
            steps {
                echo "passed"
            }
        }
        stage('failed') {
            steps {
                sh "exit 1" // <- LET'S FAIL HERE
            }
        }
        stage('it_also_ failed_but_it_skipped') {
            steps {
                echo "passed".
            }
        }
        stage('it_also_failed_but_it_skipped_2') {
            steps {
                echo "passed"
            }
        }
    }
}

Here is a log output:

[Pipeline] {
[Pipeline] container
[Pipeline] {
[Pipeline] stage
[Pipeline] { (first)
[Pipeline] echo
passed
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (second)
[Pipeline] echo
passed
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (failed)
[Pipeline] sh
+ exit 1
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (it_also_ failed_but_it_skipped)
Stage "it_also_ failed_but_it_skipped" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (it_also_failed_but_it_skipped_2)
Stage "it_also_failed_but_it_skipped_2" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

Here is what data we have in cause:
image

As you might see this is impossible to find out which stage failed exactly as all three stages has the same status and description. (We currently filtering them by the fact that duration.ms is less than 1 sec.)
We want to be able to exclude 'skipped' or the way to find really 'failed' stage even if it's nested.
Populating jenkins.pipeline.step.interruption.causes with 'skipped due to earlier failure(s)' might help in this.

from opentelemetry-plugin.

kuisathaverat avatar kuisathaverat commented on August 31, 2024

if you filter by event.outcome==failure and labels.jenkins_pipeline_step_type!=stage then you have the steps that failed, if you order by labels.jenkins_pipeline_step_id you will know which one failed first, I am not wrong will be only one.
To know the stage that failed you can follow a similar approach, filter by event.outcome=failure and labels.jenkins_pipeline_step_type==stage then you have the steps that failed, if you order by labels.jenkins_pipeline_step_id you will know which one failed first (the minimum value will work too)

from opentelemetry-plugin.

ipleten avatar ipleten commented on August 31, 2024

I am not working with Jenkins anymore so I can't test this.
Main goal of ticket was to find the reason why stage was not run or failed (including skipped due to conditions).

from opentelemetry-plugin.

kuisathaverat avatar kuisathaverat commented on August 31, 2024

Main goal of ticket was to find the reason why stage was not run or failed (including skipped due to conditions).

It is how Jenkins pipelines manage stages, it has nothing to do with the plugin. In the plugin latest version of the plugin we have included a label to mark the step that failed jenkins.pipeline.step.result

from opentelemetry-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.