Git Product home page Git Product logo

Comments (4)

rapphil avatar rapphil commented on July 19, 2024

Hi,

The validation seems to be correct. There is no path property in inside storage.tsdb inside the configuration file. https://prometheus.io/docs/prometheus/latest/configuration/configuration/#tsdb

Having said that, I don't know the reason it is possible to configure some aspects of prometheus through command line flags, but not through the configuration file.

My two cents is that it would be nice to have parity between both, but maybe I'm missing some context.

from prometheus.

rapphil avatar rapphil commented on July 19, 2024

Ok, one difference to keep in mind is that the configuration file can be reloaded:

From the docs:

Prometheus can reload its configuration at runtime. If the new configuration is not well-formed, the changes will not be applied. A configuration reload is triggered by sending a SIGHUP to the Prometheus process or sending a HTTP POST request to the /-/reload endpoint (when the --web.enable-lifecycle flag is enabled). This will also reload any configured rule files.

https://prometheus.io/docs/prometheus/latest/configuration/configuration/

So I assume that all parameters that cannot be changed in runtime are passed through command line flags.

from prometheus.

janfengye avatar janfengye commented on July 19, 2024

Hello, I want to customize the file storage location of Prometheus. How can I implement it?
prometheus.yml
`# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

scrape_timeout is set to the global default (10s).

Storage configuration

storage:
tsdb:
path: "/data/www/Monitoring/cache"

Alertmanager configuration

alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093

Load rules once and periodically evaluate them according to the global 'evaluation_interval'.

rule_files:

- "first_rules.yml"

- "second_rules.yml"

A scrape configuration containing exactly one endpoint to scrape:

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"

    metrics_path defaults to '/metrics'

    scheme defaults to 'http'.

    static_configs:

    • targets: ["localhost:9090"]
  • job_name: 'node_exporter'
    static_configs:

    • targets: ['localhost:9100']
  • job_name: 'promtail'
    static_configs:

    • targets: ['localhost:9080']
  • job_name: 'nginx'
    metrics_path: /nginx_status
    static_configs:

    • targets: ['localhost:80']Start:[Unit]
      Description=Prometheus
      After=network.target

[Service]
User=root
ExecStart=/data/www/Monitoring/prometheus/prometheus --config.file=/data/www/Monitoring/prometheus/prometheus.yml

[Install]
WantedBy=multi-user.target
`

from prometheus.

janfengye avatar janfengye commented on July 19, 2024

I want to customize the file storage location of Prometheus. How can I implement it?

from prometheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.