Class TraceInfoAction

  • All Implemented Interfaces:
    Action, ModelObject, Serializable, org.jenkinsci.plugins.workflow.actions.PersistentAction

    public class TraceInfoAction
    extends DatadogPluginAction
    This action stores mapping between IDs of FlowNode that are generated by Jenkins, and span IDs that are generated by the plugin.

    Span ID is submitted with the rest of the tracing data when a pipeline step finishes, but in certain cases it needs to be known before that:

    • before an atomic step starts, we add its span ID to the step's environment so that the logic inside the step could create custom spans that are linked as children to the step's span
    • if a stage step contains children, its children need to know their parent stage's span ID to use as their parent ID
    For reasons above, we generate IDs for flow nodes on demand, and store them here until execution of the corresponding nodes finishes. Once the execution finishes, the IDs are no longer needed and can be removed. It is important to remove IDs, because this action is regularly dumped to disk, so it should contain as little data as possible.

    There is a single trace info action associated with the pipeline, rather than a separate action with a single ID associated with the node. This is done for performance reasons, as changes to run actions are batched, while changes to node actions are written to disk immediately.

    See Also:
    Serialized Form
    • Constructor Detail

      • TraceInfoAction

        public TraceInfoAction()
      • TraceInfoAction

        public TraceInfoAction​(Map<String,​Long> spanIdByNodeId)