I am following this guide: https://docs.aws.amazon.com/msk/latest/developerguide/open-monitoring.html which enables prometheus to grab metrics from MSK Cluster using JMX Exporter
The tutorial mentions to create a targets.json file and populate it with your values later on, you need to load that file with:
- job_name: 'broker'
file_sd_configs:
- files:
- 'targets.json'
My current prometheus values file looks like this, but seems like I can't load the targets.json file into the prometheus configuration
extraScrapeConfigs: |
- job_name: broker
file_sd_configs:
- files:
- targets.json
Do I need to interpolate something in between for Terraform to recognize this external file?
Specifying the absolute file path does not seem to work.
Finally managed to fix this. I've followed this approach:
As you can see I needed to load the
targets.jsonfile with a ConfigMap resource. These are the helm values I've used for the prometheus chart:The ConfigMap resource gets created as:
Following those steps, you can succesfully load into the
prometheus-serverpod thetargets.jsonfile