Skip to content

Collect and submit jenkins.job.stage_duration#76

Merged
FlorianVeaux merged 7 commits into
masterfrom
florian/new_stage_metrics
Jun 23, 2020
Merged

Collect and submit jenkins.job.stage_duration#76
FlorianVeaux merged 7 commits into
masterfrom
florian/new_stage_metrics

Conversation

@FlorianVeaux

@FlorianVeaux FlorianVeaux commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR adds a new listener "DatadogGraphListener" that is called on every start of a 'node' in a pipeline.

When the hook is called with a StepEndNode, we now that a "part" of the pipeline has completed. The listener then fetches the corresponding StartEndNode, verifies that this node is indeed a "stage", and if so submit a "jenkins.job.duration" metric with the timing difference between the start node and the end node.

How does the lister handles stages within stages ?

For each stage (no matter its depth) a metric will be submitted with the corresponding stage_name tag. Additionally, a stage_depth tag is added to those metrics that represent how deep the stage is in the pipeline.

It can be useful when querying those metrics if for example one want to see the duration of all top level stages of a pipeline.

@FlorianVeaux
FlorianVeaux force-pushed the florian/new_stage_metrics branch from 452924e to 43740a8 Compare June 18, 2020 12:30
@FlorianVeaux

This comment has been minimized.

@sarah-witt sarah-witt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick pass and it looks good so far. I'm going to try it out later!

@FlorianVeaux
FlorianVeaux force-pushed the florian/new_stage_metrics branch from 103fb7e to 6462a85 Compare June 19, 2020 10:40
@github-actions github-actions Bot added the documentation Documentation related changes label Jun 19, 2020
Comment thread README.md Outdated
Comment thread README.md Outdated
@FlorianVeaux FlorianVeaux added the changelog/Added Added features results into a minor version bump label Jun 22, 2020

@sarah-witt sarah-witt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@sarah-witt sarah-witt changed the title Collect and submit jenkins.job.stageduration Collect and submit jenkins.job.stage_duration Jun 22, 2020
@FlorianVeaux
FlorianVeaux merged commit 9555e57 into master Jun 23, 2020
@FlorianVeaux
FlorianVeaux deleted the florian/new_stage_metrics branch June 23, 2020 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Added Added features results into a minor version bump documentation Documentation related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants