Datadog Plugin Support
👋 Hi! I'm here to help you with questions about the Datadog plugin for MuleSoft. How can I assist you today?
Submitted by admin on Thu, 03/25/2021 - 18:30

The Mulesoft Anypoint 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 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:

  • hosts: Grouping 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:

    • anypoint: The 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

    • object_store_v2: The 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

    • object_store_v2_stats: The 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

    • mule_server: The 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

    • oauth_provider: The 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

    • basic_auth_provider: The Basic Authentication url that allows obtain a Bearer token used to make requests to all the APIs. It is preconfigured with https://anypoint.mulesoft.com/accounts/login but it could be different for EU or GOV Mule Regions, see https://docs.mulesoft.com/access-management/managing-users#prerequisites

  • client_id: The Client ID for the authentication API

  • client_secret: The Client Secret for the authentication API

  • username: The user name for the authentication API

  • password: The user password for the authentication API

  • env_id: The Environment ID for environment specific requests

  • org_id: The Organization ID for the requests that requires to specify it

  • api_key: The API key provided when you purchased the product

  • customer_key: The Customer key provided when you purchased the product

  • connection_wait_time: The number of seconds that authentication method will wait until next retry. If not specified it is defaulted to 2

  • connection_attempts_num: The 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

  • threads: The number of allowed parallel threads running the instance

  • api_filter: If 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.

Configuration process

The example file provided in datadog_checks/mulesoft_anypoint/data/conf.yaml.example and also 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 this values can be changed, we recommend just go with the defaults.

The main configuration parameters to pay attention are:

The Connected Apps permissions

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

  • Exchange API:

    • Exchange Administrator

  • CloudHub:

    • CloudHub Organization Admin

    • Read Alerts

  • ARM Rest Services:

    • Read Alerts

    • Read Applications

    • Read Servers

  • Access Management:

    • Read Applications

    • View Organization

  • ARM Monitoring Query:

    • Read Applications

  • ARM Mule Agent:

    • None

  • Object Store:

    • Manage Application Data

    • Manage stores data

  • Object Store V2 Stats:

    • An administrator user

The integration doesn’t 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: 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