I am new to Prometheus and i have some questions about the basic concepts which i am seeking clarification. Let me try to illustrate my questions in the following example.
---
**Background**
I have an e-commerce application which i would like to monitor. Apart from the technical metrics, i would also like to get some business information like
1. total number of orders today
2. revenue today
---
**Scenario 1:**
Assume i have the right to alter the application, in that case i should implement the prometheus client library in the application code and expose these metrics at the /metrics endpoints.
Q1: In that case, i am direct instrumenting the e-commerce application. Is it correct?
Q2. So the code i added could be still regarded as an exporter and it is bundled with the application code?
---
**Scenario 2:**
Assume i am have NO control on the application code but it has an API where i could get the info i need. So i create another application using the prometheus client library and calls this API in order to expose the metrics at the /metrics endpoints.
Q3. In that case, i am NOT directing instrumenting the e-commerce application?
Q4: Am I writing an exporter?
Q5: How to control the refresh rate of the metrics? Should i call the API when prometheus scrapes the endpoint OR i should write a schedule job which keeps refreshing the metrics at the endpoint in a regular interval which is independent of the prometheus scrape interval?
---
**Scenario 3:**
Assume i am have NO control on the application code but it has an NO API provided. The only way i could get the business info is by querying the database. So i create another application using the prometheus client library and queries the database in order to expose the metrics at the /metrics endpoints.
Q6. In that case, i am NOT directing instrumenting the e-commerce application?
Q7: Am I writing an exporter?
Q8: How to control the refresh rate of the metrics? Should i query the db when prometheus scrapes the endpoints OR i should write a schedule job which keeps refreshing the metrics at the endpoint in a regular interval which is independent of the prometheus scrape interval?
---
**Other questions**
Q9. What is a collector? What is its role in exporter?
Q10. When i should use an collector? (ex. https://github.com/prometheus/client_python#custom-collectors)
Q11. How to control the metrics refresh rate when using collector?
Q12. Could i make use of collector in the above scenarios?
---
Some of the questions may sounds silly and i would be grateful if someone could give me more ideas on the definitions of those terms as well as some simple examples which could help understanding those concepts.
Thanks for your time.
Hi all,
I am new to Prometheus and i have some questions about the basic concepts which i am seeking clarification. Let me try to illustrate my questions in the following example.
---
**Background**
I have an e-commerce application which i would like to monitor. Apart from the technical metrics, i would also like to get some business information like
1. total number of orders today
2. revenue today
---
**Scenario 1:**
Assume i have the right to alter the application, in that case i should implement the prometheus client library in the application code and expose these metrics at the /metrics endpoints.
Q1: In that case, i am direct instrumenting the e-commerce application. Is it correct?
Q2. So the code i added could be still regarded as an exporter and it is bundled with the application code?
---
**Scenario 2:**
Assume i am have NO control on the application code but it has an API where i could get the info i need. So i create another application using the prometheus client library and calls this API in order to expose the metrics at the /metrics endpoints.
Q3. In that case, i am NOT directing instrumenting the e-commerce application?
Q4: Am I writing an exporter?
Q5: How to control the refresh rate of the metrics? Should i call the API when prometheus scrapes the endpoint OR i should write a schedule job which keeps refreshing the metrics at the endpoint in a regular interval which is independent of the prometheus scrape interval?
---
**Scenario 3:**
Assume i am have NO control on the application code but it has an NO API provided. The only way i could get the business info is by querying the database. So i create another application using the prometheus client library and queries the database in order to expose the metrics at the /metrics endpoints.
Q6. In that case, i am NOT directing instrumenting the e-commerce application?
Q7: Am I writing an exporter?
Q8: How to control the refresh rate of the metrics? Should i query the db when prometheus scrapes the endpoints OR i should write a schedule job which keeps refreshing the metrics at the endpoint in a regular interval which is independent of the prometheus scrape interval?
---
**Other questions**
Q9. What is a collector? What is its role in exporter?
Q10. When i should use an collector? (ex. https://github.com/prometheus/client_python#custom-collectors)
Q11. How to control the metrics refresh rate when using collector?
Q12. Could i make use of collector in the above scenarios?
---
Some of the questions may sounds silly and i would be grateful if someone could give me more ideas on the definitions of those terms as well as some simple examples which could help understanding those concepts.
Thanks for your time.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/c4b0eeab-e415-435f-b402-74ec450ed347%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.