The instances property in the conf.yml let you customize the way the agent collects the metrics, with that being said, you can manually load-balancing the API requests performed by the agent splitting the agent load through different instances and gathering datapoints as per your requirements.
Let's assume you are interested in getting updated data of your CloudHub and On-Prem apps behavior, through the Development: Optimizations dashboards, you'd like to monitor the CPU, memory and networking in a constant rate, but you won't like to push the agent to get at the same rate the metrics of your resource allocation. You can easily set up the following configuration to fulfill the depicted requirement.
instances:
- min_collection_interval: 172800
threads: 32
api_filter:
- access_management
- min_collection_interval: 10
threads: 32
api_filter:
- cloudhub
With the above example, you are running two isolated executions of our metric reader program, if you have a scenario where customization of API calls is needed you can refer to the configuration section to locate the configuration YAML file and set your configuration properly. Once done, you only need to restart the agent to load the new configuration and that's it you will now have a customized agent.
Customize the settings with the UI
The CloudWatch Mule® Integration comes with a bundled web application to assist in the customization of the settings in a graphical user interface, rather than modifying the configuration YAML file directly.
System architecture
Bundled with the CloudWatch Mule® Integration, the web application follows the same system architecture.
The web application uses a plain HTTP connection, meaning it is not encrypted and the information travels in plain text. It’s very important to access this web application in a trusted network, typically, with a VPN.
The web application listens to port 8080, and the URL to access it is http://<ec2-instance>:8080/settings
Where <ec2-instance> is the IP address or hostname of the EC2 instance where the CloudWatch Mule® Integration is running.
Installation
This web application comes bundled with the CloudWatch Mule® Integration. Follow steps in https://docs.ioconnectservices.com/cmi/installation
Customization
This web application is a user interface for the conf.yaml file used by the CloudWatch Mule® Integration agent to configure the execution and collection of metrics. See the definition of each field in the configuration.
The UI is divided into sections:
- General
- Anypoint Information.
- MuleSoft Products.
- Advanced settings.
Make sure you save all changes by clicking on the Save button at the bottom of the page. Once the changes are saved, restart the agent.
NOTE: Make sure to restart the agent in the command line. Otherwise, the changes won’t take effect.
General
This section contains only general information on the configuration settings.
- Customer Key: This is the activation key of the product. It’s granted by IO Connect Services when purchasing the product and activating it for the first time.
Anypoint Information
This section contains information about the Anypoint Platform.
- User name: The user created in Anypoint Platform with privileges to collect metrics from the different products.
- AWS Secret Name: The name of the key created at deployment time where the user’s password is securely stored in AWS Secrets Manager.
- Organization Id: The Id of the Anypoint Organization. To know this value, read the official MuleSoft documentation https://docs.mulesoft.com/access-management/organization#manage-master-organization-settings
- Environment Id: The Id of the target environment in Anypoint. To know this value, read this official article from MuleSoft https://help.mulesoft.com/s/article/How-to-get-the-Environment-ID
- Anypoint URL: 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 URL: 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 stats URL: 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.
- OAuth v2 URL: The OAuth v2 Provider URL allows obtaining 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 URL: The URL to do basic authentication 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
- On-prem Mule Server URL: 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
MuleSoft Products
This section covers what are the MuleSoft products from which the CloudWatch Mule® Integration agent will collect metrics.
- API filter: This is the MuleSoft product that will be enabled. Pick one from the drop-down list.
- Number of threads: This shows an explanation below the control. Specifies the number of threads used to collect metrics from this specific product. Use this setting to tune the performance of the metrics collection.
- Frequency (seconds): The frequency at which this agent will trigger the metric collection for this MuleSoft product. It is specified in seconds.
To add more products to the list of managed products for this CloudWatch Mule® Integration agent, click on the Add button at the bottom of the section.
To remove a product from the list of managed products, click on the Remove button.
Advanced Settings
This section contains settings that will be updated only under specific circumstances.
- Connection wait timeout (s): The number of seconds that the authentication method will wait until the next retry. If not specified it defaults to 2 seconds.
- Connection attempts: The number of retry attempts that the authentication method will perform. If not specified it defaults to 3 attempts.
- Proxy user: The user name of the proxy if the instance where the CloudWatch Mule® Integration agent is deployed is behind a secured proxy.
- Proxy password: The password of the user of the proxy if the instance where the CloudWatch Mule® Integration agent is deployed is behind a secured proxy.
- Proxy HTTP URL: The IP address or hostname of the proxy server. This control is used if the proxy is used for HTTP only.
- Proxy HTTPS URL: The IP address or hostname of the proxy server. This control is used if the proxy is used for HTTPS only.
- No proxy domains: The domains that are not required to go through a proxy. It skips the proxy routing.
Troubleshooting
The web application is not running
To diagnose that the application is not running, you need to SSH into the EC2 instance where it is supposed to be running. In the command line, use the following command to make sure the process is not running.
$ ps -ef | grep "com.ioconnectservices.cmi.web.CmiSettingsWebAppApplication"
If the command above does not return a valid process, then it might be down. Use the following command to start it.
$ sudo -u cmi-agent java -Dconf.file.location="/home/cmi-agent/iocs/conf/conf.yml" -jar "/home/cmi-agent/iocs/cmi/cmi-settings-web-app-1.0.0.jar" "com.ioconnectservices.cmi.web.CmiSettingsWebAppApplication"
To test the process open a web browser and go to the settings web application http://<ec2-instance>:8080/settings
The web application is not storing any new settings
Make sure that the user that runs the web application process has write permissions over the conf.yaml file. By default, both file and Java processes are run with the cmi-user user.