Hi all I’ve written an article in Medium about how...
# ktor
j
Hi all I’ve written an article in Medium about how to monitor Ktor API server with Prometheus & Grafana. I hope this can help you somehow. It took me a bit of time to integrate and build the dashboard I’ve shared, so it may save some of your time if you are looking for something similar. https://medium.com/@math21/how-to-monitor-a-ktor-server-using-grafana-bab54a9ac0dc
👀 9
This is a starting point, with a single instance, but it can be easily scaled up using Consul and an instance registration so you can display multiple instances metrics. Some changes are needed to achieve that though
Comments and PR’s are welcome, all constructive feedback is appreciated!
r
Thanks 🙏
j
Let me know if you have some questions, I will be around to help
👌 1
r
Hello, I tried several days ago, but Grafana didn’t found any logs...
When I call the backend endpoint for metric, it works.
j
Hi @Rémy Could you add the datasource in Grafana? while adding it, there is a button to test connection to Prometheus. Is Grafana saying it is working? Sorry for the late reply, I was really busy this week.
r
No worries 🙂 I’ve imported the datasource into Grafana but it said it was always down. Even after a while. I didn’t investigate more in it... Here my repo if you have time to check, and if you want obviously, if I didn’t make some mistakes (https://github.com/remylavergne/spotfinder-backend/tree/develop) Thanks :)
👍 1
j
I will have a look
❤️ 1
Ey @Rémy PR is done to develop. Have a look. If you want I can explain you a bit about the mistake made. This makes Grafana work so I believe this is fixing your problem
Magic!
r
Awesome, I look this now 🙂
The localhost error into the docker-compose YAML... Such a dumb error ahahah Thank you very much for your time, help, and teaching ;)
j
Hahaha it only happens to the best ones! Happy to help!