Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lhpqaq committed Dec 16, 2024
1 parent 9664d7d commit 48b33e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,6 @@
-->

<configuration>
<property>
<name>hbase_user_nproc_limit</name>
<values>
<property>
<name>nofile_limit</name>
<value>128000</value>
<description>Max open files limit</description>
</property>
<property>
<name>nproc_limit</name>
<value>65536</value>
<description>Max number of processes limit</description>
</property>
<property>
<name>custom_limit</name>
<value>32000</value>
<description>Custom limit for another resource</description>
</property>
</values>
<description>Max number of processes limit setting for HBase user.</description>
</property>
<property>
<name>content</name>
<description>This is the freemarker template for grafana.ini file</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,22 @@
~ specific language governing permissions and limitations
~ under the License.
-->
<!--<property>-->
<!-- <name>name</name>-->
<!-- <values>prometheus</values>-->
<!-- <property>-->
<!-- <property>-->
<!-- <name>job_name</name>-->
<!-- <value>job</value>-->
<!-- <description>Job name</description>-->
<!-- </property>-->
<!-- <name>job_targets</name>-->
<!-- <values>-->
<!-- <property>-->
<!-- <name>target1</name>-->
<!-- <value>localhost:9090</value>-->
<!-- </property>-->
<!-- </values>-->
<!-- <description>Job targets</description>-->
<!-- </property>-->
<!-- <property>-->
<!-- <name>job_scrape_interval</name>-->
<!-- <value>5s</value>-->
<!-- <description>scrape targets from this job every scrape_interval.</description>-->
<!-- </property>-->

<configuration>
<property>
<name>scrape_interval</name>
<value>15s</value>
<description>Global, scrape targets every scrape_interval.</description>
</property>
<property>
<name>scrape_jobs</name>
<values>
<property>
<name>scrape_config1</name>
<name>scrape_self</name>
<values>
<property>
<name>job_name</name>
<value>job</value>
<value>prometheus</value>
<description>Job name</description>
</property>
<property>
Expand Down Expand Up @@ -84,14 +67,6 @@ global:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
<#list scrape_jobs as job>
- job_name: '${job.name}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ public class PrometheusParams extends InfraParams {

private List<Map<String, Object>> prometheusScrapeJobs;
private String prometheusContent;
private String prometheusScrapeInterval;

public PrometheusParams(CommandPayload commandPayload) {
super(commandPayload);
globalParamsMap.put("scrape_jobs", prometheusScrapeJobs);
globalParamsMap.put("scrape_interval", prometheusScrapeInterval);
}

public String dataDir() {
Expand All @@ -67,6 +69,7 @@ public Map<String, Object> scrapeConfigs() {
List<Map<String, Object>> jobs = new ArrayList<>();
Map<String, Object> configuration = LocalSettings.configurations(getServiceName(), "prometheus");
prometheusContent = (String) configuration.get("content");
prometheusScrapeInterval = (String) configuration.get("scrape_interval");
log.info(configuration.toString());
@SuppressWarnings("unchecked")
Map<String, Object> scrapeJobs = (Map<String, Object>) configuration.get("scrape_jobs");
Expand Down

0 comments on commit 48b33e5

Please sign in to comment.