APM Traces for Jenkins Build/Pipelines#96
Merged
Conversation
drodriguezhdez
force-pushed
the
drodriguezhdez/apm_traces
branch
from
July 22, 2020 12:43
e0a53df to
f1f5b4c
Compare
drodriguezhdez
force-pushed
the
drodriguezhdez/apm_traces
branch
from
July 22, 2020 13:13
f1f5b4c to
2628364
Compare
drodriguezhdez
force-pushed
the
drodriguezhdez/apm_traces
branch
from
July 29, 2020 15:00
513ccd1 to
74e1130
Compare
drodriguezhdez
force-pushed
the
drodriguezhdez/apm_traces
branch
5 times, most recently
from
July 31, 2020 10:18
b42049f to
8288376
Compare
drodriguezhdez
force-pushed
the
drodriguezhdez/apm_traces
branch
from
July 31, 2020 11:05
8288376 to
93789fd
Compare
drodriguezhdez
marked this pull request as ready for review
July 31, 2020 13:58
sarah-witt
reviewed
Aug 7, 2020
sarah-witt
left a comment
Collaborator
There was a problem hiding this comment.
Overall this looks great from the jenkins side! We'll need to update the development docs and regular docs too.
FlorianVeaux
reviewed
Aug 7, 2020
Co-authored-by: Florian Veaux <[email protected]> Co-authored-by: Sarah Witt <[email protected]>
added 12 commits
August 17, 2020 11:38
…ide DatadogClient. Removed access to Tracer from DatadogClient.
…led when agentless mode is configured.
Collaborator
Author
|
Updated |
Collaborator
Author
|
@sarah-witt did you have the opportunity of taking a look at my comments? |
drodriguezhdez
force-pushed
the
drodriguezhdez/apm_traces
branch
from
August 20, 2020 13:20
5c82b01 to
ef98fe6
Compare
FlorianVeaux
approved these changes
Aug 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DISCLAIMER
This PR adds an experimental feature in alpha state.
Internal use only.
Requirements for Contributing to this repository
What does this PR do?
Description of the Change
The
DatadogTraceBuildLogicclass implements the logic of sending the build traces. During the execution of theonStartedmethod, a new span that represents the Jenkins Build is created. This span is finished in theonCompletemethod. TheBuildSpanManagerclass is used to propagate the same span between A method and the B method. This is required because it's not possible to store the complete active Span in a Jenkins Action. Additionally, theSpanContextof the Jenkins Build span is injected in theBuildSpanAction. This logic is invoked from theDatadogBuildListenerclass.The
DatadogTracePipelineLogicclass implements the logic of sending the pipeline traces. This logic is only executed in the lasFlowNodeof the pipeline. The idea is, based on that last node, to recreate the full pipeline tree with the complete information of each node, and then, to send the spans which represent that tree. TheBuildPipelineandBuildPipelineNodeclasses have been implemented to build the Jenkins Pipeline nodes tree. To correlate the Jenkins Build with the pipeline, theSpanContextis extracted from theBuildSpanAction. This logic is invoked from theDatadogGraphListenerclass.The
DatadogStepListenerclass implements the logic of extract the important information of eachStepContext, and store them in theStepDataManagerusing theStepDescriptoras key. This information will be available during the construction of the node spans in theDatadogTracePipelineLogicexecution.To create and send the traces is used the APM Java Tracer API.
This logic is only available for the
Datadog Agentmode in the Jenkins Plugin.Finally, the
DatadogGlobalConfigurationclass and the UI template has been modified to support the configuration of theTrace Collection Portinput andEnable Trace Collectionflag.Alternate Designs
Possible Drawbacks
Verification Process
Apart from the addition of the unit and integration tests to this PR, the Jenkins plugin with this feature is available in the Jenkins instance of the CI-App team.
Check the APM Traces view in Datadog corresponding to this Jenkins pipeline execution.
Additional Notes
You can find further information of this feature in the CI/CD observability technical design document.
Finally, do not hesitate to join to #ci-app Slack channel if you have more questions.
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.