Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

706
Views
Grafana prometheus with fastapi

I'm curious about this Prometheus, can I develop a Grafana with Prometheus as a data source with fastapi URL? Right now I'm developing on Grafana monitoring dashboard and I have an API using fastapi and I'm using this API as a data source with SimpleJSON plugin on Grafana. But now I'm a little curious about this Prometheus, is it possible to use my API as a Prometheus data source? If so, what endpoint that I should provide? For now for SimpleJSON Plugin it required /, /search and /query. How about Prometheus data sources?

Many Thanks

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

"Data source" means something specific in Grafana. Prometheus data source has a well defined path for its queries; you can't modify that. There is an HTTP JSON+API datasource for Grafana if you search its plugins - https://marcus.se.net/grafana-json-datasource/

However, that's completely bypassing Prometheus longer-term storage. Prometheus reads scrape targets, then collects and aggregates that.

To do so, your API would need to expose any route that returns Prometheus "exposition format", not JSON. This route is put in the Prometheus config file, not into Grafana anywhere.

While Prometheus can load random data, it's better to use Counter, Guage, etc types it expects

The OpenTelemetry project should be able to be used in any framework, and there are examples in their documentation for the Python module.

If your goal is to just get any data, not metrics, into Grafana, using an RDBMS or Mongodb, or other supported data sources might be better

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!