The Datadog Mule® Integration is a Datadog custom integration and it is configured through a conf.yaml file located at:

  • C:\ProgramData\Datadog\conf.d\mulesoft_anypoint.d\conf.yaml in Windows
  • /etc/datadog-agent/conf.d/mulesoft_anypoint.d/conf.yaml in Linux systems

The configuration in the conf.yaml is divided into two parts:

  • init_config: A common part used by all the executions
  • instances: A list of instances to be scheduled independently

init_config

This section contains the common configuration used by all the instance executions. It contains the following configurations:

·hostsGrouping of all the hosts definitions needed by Mulesoft Anypoint Reader. Some hosts are specific to some APIs, if so, it is specified in the description:
 

o   anypointThe Anypoint server host url. It is preconfigured with https://anypoint.mulesoft.com but it could be different for EU or GOV Mule Regions, see https://docs.mulesoft.com/access-management/managing-users#prerequisites
 

o   object_store_v2The Specific Region Object Store V2 server host url. See https://docs.mulesoft.com/object-store/osv2-apis for the full list of available hosts. This host definition is used by the Object Store API. Example value: https://object-store-us-east-1.anypoint.mulesoft.com
 

o   object_store_v2_statsThe Object Store V2 Stats server host url. This host definition is used by the Object Store V2 Stats API. It is preconfigured with https://object-store-stats.anypoint.mulesoft.com
 

o   mule_serverThe url or ip of the Server running a Mule Runtime with the Mule Agent. This host definition is used by the ARM APIs Example value: http://localhost:9999
 

o   oauth_providerThe Oauth Provider url that allows obtain a Bearer token used to make requests to all the APIs. It is preconfigured with https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token but it could be different for EU or GOV Mule Regions, see https://docs.mulesoft.com/access-management/managing-users#prerequisites
 

·client_idThe Client ID for the authentication API

·client_secretThe Client Secret for the authentication API

·env_idThe Environment ID for environment specific requests

·org_idThe Organization ID for the requests that requires to specify it

·api_keyThe API key provided when you purchased the product

·customer_keyThe Customer key provided when you purchased the product

·connection_wait_timeThe number of seconds that authentication method will wait until next retry. If not specified it is defaulted to 2

·connection_attempts_numThe number of retry attempts that authentication method will perform. If not specified it is defaulted to 3

In the Full Example section there is an example of a configuration file with all the values configured.

instances

This section contains a list of instances defined following the YAML list item notation -. Each instance is scheduled independently to run a set of APIs with a specific threads number configuration. Each instance contains the following configurations:

·min_collection_interval: The time in seconds between executions. If not specified it is defaulted to 15 seconds

·threadsThe number of allowed parallel threads running the instance

·api_filterIf not specified, all the APIs are executed, otherwise it must contain a list of APIs to run within the instance following the YAML list item notation -.

In the Full Example section there is an example of a configuration file with a list of instances. The example is taken directly from the conf.yaml file distributed with the integration and contains the optimum numbers we recommend for almost any scenario for min_collection_interval and threads.

The metric collection of any instance can be disabled at any time by commenting out the whole instance. This means, commenting the two attributes mentioned above.

Configuration process

The example file provided in datadog_checks/mulesoft_anypoint/data/conf.yaml.example and copied to the conf.d/mulesoft_anypoint.d/conf.yaml.example folder after the installation process contains a configuration with all the possible values already configured and they should just work for the common usage case.

The instances section contains a list of instances that were set to a periodicity and concurrency level according to each API provided information. Even if all these values can be changed, we recommend just go with the defaults.

The main configuration parameters to pay attention are:

·object_store_v2In the hosts section, it depends on the CloudHub Region and can be found at the following link https://docs.mulesoft.com/object-store/osv2-apis
 

·mule_serverIn the hosts section, it depends on the Mule Agent configuration. Following the defaults of the Mule Agent configuration it would be http://localhost:9999 to retrieve the metrics from a Mule Runtime running on the same machine
 

·Connected Apps Authentication. The credentials to get access to the Anypoint platform. More information about Connected Appshttps://docs.mulesoft.com/access-management/connected-apps-overview. The two parameters to configure:

o   client_idIt must be configured with the Connected Apps account client_id

o   client_secretIt must be configured with the Connected Apps account client_secret
 

·env_idThe Environment ID for environment specific requests. See https://docs.mulesoft.com/access-management/environments and https://help.mulesoft.com/s/question/0D52T00004mXPvSSAW/how-to-find-cloud-hub-environment-id
 

·org_idThe Organization ID for the requests that requires to specify it. See https://docs.mulesoft.com/access-management/organization and https://help.mulesoft.com/s/article/How-to-know-my-Organization-ID-Org-ID-on-the-Anypoint-Platform
 

·api_keyThe API key provided by IO Connect Services when you purchased the product
 

·customer_keyThe Customer key provided by IO Connect Services when you purchased the product
 

·For EU or GOV Mule Regions, the anypoint and oauth_provider should be changed too. See https://docs.mulesoft.com/access-management/managing-users#prerequisites

The Connected Apps permissions

The Connected Apps permissions

Datadog Mule® Integration requires specific permissions on the MuleSoft Anypoint Platform to collect metrics. The approach to grant such permissions is using a Connected App. Follow instructions in the official MuleSoft documentation to create a connected app.
https://docs.mulesoft.com/access-management/connected-apps-overview

There are some common permissions that must be granted to be able to execute any API and others, specific, used by one or few APIs.

·Exchange API:

o   Exchange Administrator
This is only required to read data from Exchange. Datadog Mule® Integration does not modify any asset.

·CloudHub:

o   CloudHub Organization Admin
This is only required to read data from CloudHub. Datadog Mule® Integration does not modify any asset.

o   Read Alerts

·ARM Rest Services:

o   Read Alerts

o   Read Applications

o   Read Servers

·Access Management:

o   Read Applications

o   View Organization

·ARM Monitoring Query:

o   Read Applications

·Object Store:

o   Manage Application Data

o   Manage stores data

·Object Store V2 Stats:

o   An administrator user
This is only required to read data from Object Store V2 statistics. Datadog Mule® Integration does not modify any asset. If these metrics are not desired, make sure you comment out this entry in the configuration file in 
instances.

The integration does not modify in any manner the assets in Anypoint Platform, those permissions are for read-only.

Full example

Below is a complete configuration example (with fake credentials and ids):


init_config:
    hosts:
          anypoint: https://anypoint.mulesoft.com
          object_store_v2: https://object-store-us-east-1.anypoint.mulesoft.com
          object_store_v2_stats: https://object-store-stats.anypoint.mulesoft.com
          mule_server: http://localhost:9999
          oauth_provider: https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token
    client_id: 035715123cbc31a123456a43143213f3
    client_secret: bAc2345678C34aFF1aB1A12f5A245678
    env_id: a3cc1234-4a24-125b-1a45-1c1aa1a13cad
    org_id: ac2345aa-cc13-1367-bca1-b1234a2aa4aa
    api_key: 548f-1s52-2d5f4f5b34ed
    customer_key: a6a6-b5568ae854e5
    connection_wait_time: 2
    connection_attempts_num: 3
instances:
  - min_collection_interval: 86400
    threads: 32
    api_filter:
      - access_management
  - min_collection_interval: 10
    threads: 32
    api_filter:
      - arm_monitoring_query
  - min_collection_interval: 10
    threads: 32
    api_filter:
      - arm_mule_agent
  - min_collection_interval: 10
    threads: 32
    api_filter:
      - arm_rest_services
  - min_collection_interval: 10
    threads: 32
    api_filter:
      - cloudhub
  - min_collection_interval: 60
    threads: 32
    api_filter:
      - api_manager
  - min_collection_interval: 60
    threads: 32
    api_filter:
      - api_events
  - min_collection_interval: 86400
    threads: 32
    api_filter:
      - exchange_experience
  - min_collection_interval: 60
    threads: 32
    api_filter:
      - insight
  - min_collection_interval: 86400
    threads: 32
    api_filter:
      - object_store
  - min_collection_interval: 86400
    threads: 32
    api_filter:
      - object_store_v2_stats