Closed neilharris123 closed 1 year ago
Did you see our feature withSpanAttribute(key: "ci.pipeline.alert.priority", value: "P1")
that enables adding attributes to the spans?
The Jenkinsfile looks like:
withSpanAttribute(key: "ci.pipeline.alert.priority", value: "P1") // associate with the "Phase: Run" span
node {
stage("build") {
git credentialsId: 'github', url: 'https://github.com/cyrille-leclerc/my-war'
sh "./mvnw clean verify"
}
}
With an observability backend like Grafana with Tempo, you just have to query with
{resource.service.name = "my-jenkins" && span.ci.pipeline.alert.priority="P1"}
Would this solve your problem?
@neilharris123 please have a look at this coming feature that could help you:
withSpanAttribute
enriched in 2.14.0 https://github.com/jenkinsci/opentelemetry-plugin/releases/tag/opentelemetry-2.13.0
What feature do you want to see added?
Hello. It would be good if atrribute could be added to the spans declaratively in the Jenkinsfile. Here's our use case: We are sending traces to Splunk APM, and generating alerts based on failed jobs. We have four different priorities of alerts, P1, P2, P3, P4. Certain pipelines are considered higher a propriety (so, for example P1), while others are lower priority (P4). We would like to be able to define this priority in the Jenkinsfiile for each job, so that this is then available in the spans when they land in Splunk Observability Platform. This would be possible if we were able to define the level of priority in the Jenkinsfile, so that an attribute with this info is added to the the spans. For example, something like
ci.pipeline.alert.priority: P1
Are there any plan to implement something like this? Adding an attribute via the opentelemtry collector is not really feasible for this, because we need different priorities for each pipeline.Upstream changes
No response