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

docs: Optimize the sample configuration of prometheus job #5194

Closed
nic-6443 opened this issue Oct 11, 2021 · 2 comments · Fixed by #5196
Closed

docs: Optimize the sample configuration of prometheus job #5194

nic-6443 opened this issue Oct 11, 2021 · 2 comments · Fixed by #5196
Labels
doc Documentation things

Comments

@nic-6443
Copy link
Member

nic-6443 commented Oct 11, 2021

Improved or typo fixed.

Now the sample configuration of prometheus job is as follows:

scrape_configs:
  - job_name: "apisix"
    metrics_path: "/apisix/prometheus/metrics"
    static_configs:
      - targets: ["127.0.0.1:9091"]

Such a configuration will inherit the scrape_interval in the global configuration of prometheus.
At the same time, the minimum time window of the rate function in the grafana dashboard provided is 30s.
sum(rate(apisix_bandwidth{instance=~"$instance"}[30s])) by (type)
Based on the above two points, if the scrape_interval in the user's prometheus global configuration is greater than 15s, the rate function may not calculate the result at some point in time, causing the dashboard to be unavailable.

The ingress nginx project has a similar PR: kubernetes/ingress-nginx#2884

Solution

Specify scrape_interval in the sample configuration

scrape_configs:
  - job_name: "apisix"
    scrape_interval: 15s
    metrics_path: "/apisix/prometheus/metrics"
    static_configs:
      - targets: ["127.0.0.1:9091"]
@spacewander
Copy link
Member

The example of the documentation (including the grafana dashboard), is only an example. It doesn't mean you should do it like that. We can accept the PR, however, we should mention that the configuration is just an example.

@nic-6443
Copy link
Member Author

The example of the documentation (including the grafana dashboard), is only an example. It doesn't mean you should do it like that. We can accept the PR, however, we should mention that the configuration is just an example.

Ok, add some comments after the scrape_interval configuration to illustrate the relationship with the rate function. Do you think it is ok?

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

Successfully merging a pull request may close this issue.

2 participants