Datadog Mule Integration 4 APM

Configuration and Operations | Span

Operations

Create Span

The create span operation as states, creates a new span in the flow, it will run in the flow until it gets finished. A span can contain Children, and those Children as well can contain Children and so on, this is useful to add granularity to the project.

The operation looks like this:

Create span operation

  • Display name: By default is displayed as Create Span.

  • Connector configuration: This is where the Datadog Global Configuration is set, required.

  • Span name: required.

  • Parent: The parent of the created span, optional.

  • Finish this span at the end of the main flow: This checkbox ensures that the span will be closed automatically at the end of the flow execution, the default is unchecked.

  • Tags: These are key-value pairs that can be set Inline or with Dataweave expressions, this provides labels attached to the spans that are created in execution time, optional.

  • HTTP Request Tags: Additional info the user can provide to the span, in this case the HTTP Method and the URI Path in case the user may require it for REST Services. Accept Dataweave expressions as well as static values. optional.

The following is an example of how to assign a child span to a parent.  This flow will be used as the main example thoughout the different operation explanations. Let’s check how this can be useful.

Full flows view

There are 3 spans created in the flow: Parent, Child, and GrandChild

The main span is called Parent, then in the Child span we assign the Parent field as Parent, which is the name of the first span created, and finally, we assign GrandChild span Parent field as Child.

With this we have the following hierarchy:

Spans hierarchy

Parent will contain Child, at the same time Child will contain GrandChild.

If we run the following flow and go to the Datadog APM, the result is this trace:

Sample traces

And here the spans created:

Parent span and children spans created

As you can see, Child and GrandChild are nested to the Parent. Nesting can have n level.