diff --git a/bigtop-manager-server/src/main/resources/stacks/infra/1.0.0/services/prometheus/configuration/prometheus.xml b/bigtop-manager-server/src/main/resources/stacks/infra/1.0.0/services/prometheus/configuration/prometheus.xml index d50a8040..215bec8b 100644 --- a/bigtop-manager-server/src/main/resources/stacks/infra/1.0.0/services/prometheus/configuration/prometheus.xml +++ b/bigtop-manager-server/src/main/resources/stacks/infra/1.0.0/services/prometheus/configuration/prometheus.xml @@ -49,7 +49,9 @@ scrape_configs: # The job name is added as a label `job=` to any timeseries scraped from this config. <#list scrape_jobs as job> - job_name: '${job.name}' - +<#if job.metrics_path??> + metrics_path: "${job.metrics_path}" + file_sd_configs: - files: ['${job.targets_file}'] diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java index 4f100b79..d9af54a3 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java @@ -102,6 +102,7 @@ public Map agentJob() { job.put("name", BM_AGENT_JOB_NAME); job.put("targets_file", targetsConfigFile(BM_AGENT_JOB_NAME)); job.put("targets_list", getAllHost()); + job.put("metrics_path", "/actuator/prometheus"); agentScrapeJob = job; return LocalSettings.configurations(getServiceName(), "prometheus"); }