SUPPORT

Modifying api_events.json

Last update:

October 04, 2023

Location of the File

The api_events.json file is located in the following directory path, relative to your Datadog installation directory:

$DD_INSTALLATION_DIR/datadog_checks/mulesoft_anypoint/vendor/integration_core/readers/mulesoft_anypoint/apis/api_events.json

Here, $DD_INSTALLATION_DIR represents the root directory of your Datadog installation.

Purpose of the File

The api_events.json file contains configuration data related to the metrics and events that the Mulesoft Anypoint Integration fetches. Each metric may have associated tags, one of which is resource_path.

How to Modify the File

  1. Backup: As a best practice, always make a backup of the original api_events.json file before making any modifications. This ensures you have a fallback option in case of unintended changes.

  2. Access the file: Navigate to the directory provided above, relative to your Datadog installation directory. Open the api_events.json file in a text or code editor of your choice.

  3. Locate the "resource_path" tag: Within the file, search for instances of the tag "resource_path" under the tags_expr_str section for each metric. It will look something like this:

 

"resource_path": "$[*].['Resource Path']",

 

  1. Remove the tag: For each metric that contains the "resource_path" tag, remove the entire line for this tag. Ensure you also handle the comma appropriately to maintain the correct JSON format.

  2. Save and close: Once you've removed the "resource_path" tag from all metrics, save your changes and close the editor.

  3. Restart the Datadog Agent: Depending on your configuration and setup, you might need to restart the Datadog Agent to apply the changes. Please refer to Datadog's official documentation or your system's best practices for guidance on this step.

 

Important Note:

🚨 Implications of Tag Removal: By removing the "resource_path" tag, if any dashboard or query uses this tag, it will be affected. The dashboard or query relying on this tag will no longer function as intended.

🚨 Maintaining JSON Structure: Ensure that the resulting api_events.json file maintains a valid JSON structure after the modification. Invalid or corrupted JSON can lead to malfunctions or loss of functionality in the Datadog Mulesoft Anypoint integration. Using online JSON validators or built-in features of JSON editors can help verify the structure.