Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support include params #88

Open
Gourds opened this issue Feb 27, 2023 · 3 comments
Open

support include params #88

Gourds opened this issue Feb 27, 2023 · 3 comments

Comments

@Gourds
Copy link

Gourds commented Feb 27, 2023

can support include params

in my case

scrape_configs:
  - job_name: "test"
    honor_labels: true
    file_sd_configs:
    - refresh_interval: 1m
      files:
      - "/etc/prometheus/myconfig/*.yml"

I want use config file like this , can prometheus-proxy support it ?

for example

agent {
  pathConfigs: [
     some_path_A,
     some_path_B,
  ]
}
@pambrose
Copy link
Owner

I am not sure what you are asking. Can you give me a few more details?

Thanks,
Paul

@Gourds
Copy link
Author

Gourds commented Feb 27, 2023

I don't want every single metric to be a job, I want a class of metric to be a job, and I want configuration files to be classified by different files

example

I have many exporter config,

  • node-exporter-targets.json
  • process-exporter-targets.json
  • ...

each exporter is a json file include many target

node-exporter-targets.json

   {
      name: "node-exporter"
      path: type_a_metrics
      url: "http://app1.local:9100/metrics"
    },
    {
      name: "node-exporter"
      path: type_a_metrics
      url: "http://app2.local:9100/metrics"
    },
    {
      name: "node-exporter"
      path: type_a_metrics
      url: "http://app3.local:9100/metrics"
    }

process-exporter-targets.json

   {
      name: "process-exporter"
      path: type_b_metrics
      url: "http://app1.local:9256/metrics"
    },
    {
      name: "process-exporter"
      path: type_b_metrics
      url: "http://app2.local:9256/metrics"
    },
    {
      name: "process-exporter"
      path: type_b_metrics
      url: "http://app3.local:9256/metrics"
    }

I expect prometheus-proxy can be configured like the example below

agent {
  pathConfigs: [
  	node-exporter-targets.json,
  	process-exporter-targets.json
  ]
}

and prometheus config will be as below

scrape_configs:
  - job_name: 'node-exporter'
    metrics_path: '/type_a_metrics'
    static_configs:
      - targets: [ 'mymachine.local:8080' ]
  - job_name: 'process-exporter'
    metrics_path: '/type_b_metrics
    basic_auth:
        username: 'user'
        password: 's3cr3t'
    static_configs:
      - targets: [ 'mymachine.local:8080' ]

@pambrose
Copy link
Owner

Sorry for taking so long to get back to you on this. I have been busy with something.

Does this summarize your request: you want to be able to embed filenames for the pathConfigs values in a conf file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants