Code Monkey home page Code Monkey logo

prometheus-api's Introduction

contributors stars forks visitors profileViews

Typing SVG

Property Data
Language / IDE Python Badge Pycharm Badge Python Badge Pycharm Badge
Domain Knowledge DevOps Badge Software Development Badge
CI/CD Gitlab Badge
Databases Redis Badge MongoDB Badge Redis Badge
OS Ubuntu Badge
DevOps Helm Badge K8s Badge Helm Badge
Monitoring Tools / Platforms Prometheus Badge Grafana Badge ELK Badge DataDog Badge

πŸ“Š GitHub Activity:

hayk96's GitHub activity graph

Β  Β 
hayk96's GitHub stats hayk96's github stats

hayk96's GitHub stats


  • πŸ“ I regularly write articles on Medium

  • πŸ’¬ Ask me about Docker, Kubernetes, Prometheus, PromQL, Loki, LogQL, Grafana


πŸ“« How to Reach me:

Linkedin Gmail


πŸ‘€ Follow me:

Medium Stackoverflow

prometheus-api's People

Contributors

hayk96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hanjingnuo

prometheus-api's Issues

[BUG] Server Generates CSV Files with Static Defined Names

Describe the bug
When calling the /export API to generate CSV reports, the server creates a file with the static name data.csv (code). If multiple users call this API at the same time, they will receive incorrect responses from the server

To Reproduce

  1. Call the /export API for heavy data that will take more than 10 seconds to process.
  2. Once the first request has been sent, send a second heavy request. It is preferred to call for different metrics.
  3. The responses of both requests will be the same because both calls will generate the same file.

Expected behavior
The server should generate files with random names. It would be better to generate these files in the /tmp directory.

Screenshots
N/A

Specifications

  • Platform: any
  • Deployment model: any
  • Version v0.4.0

Additional context
N/A

Add functionality to replace labels (fields) in /export API

Is your feature request related to a problem? Please describe.
Add functionality to override (rename) labels/fields in the /export API. This solution will make the reports more flexible and business-oriented.

Describe the solution you'd like
The request body JSON should accept new fields, such as fields_override, with the type map (dictionary). For example:

{
  "expr": "users_login_count{status=success}",
  "start": "2024-01-30T00:00:00Z",
  "end": "2024-01-31T23:59:59Z",
  "step": "1h",
  "replace_fields": {
    "__name__": "Name",
    "job": "Group",
    "timestamp": "Date"
  }
}

Describe alternatives you've considered
N/A

Additional context
N/A

Support filtering of rules by type from the UI

Is your feature request related to a problem? Please describe.
Support the filtering of rules by type (Recording or Alerting) from the UI. This feature will allow users to filter the necessary rule types from the 'Rules Management' page.

image

Describe the solution you'd like
Addition of a new button on the 'Rules Management' page, which will allow for the selection of a type: Alerting, Recording, or All.

Describe alternatives you've considered
N/A
Additional context
N/A

Whether to support thanos-ruler

1、Does the current project support modifying rules for Thanos Ruler via API calls?
2、If it does not support currently, are there any plans to do so in the future?

Add support for multiple time formats for the timestamp field in the /export API.

Is your feature request related to a problem? Please describe.
In some cases, the timestamp format used in the timestamp field is not convenient for data representation.

__name__,instance,job,timestamp,value
up,prometheus-api:5000,prometheus-api,1719131438.585,1
up,localhost:9090,prometheus,1719131438.585,1

Describe the solution you'd like
It would be much better to support several time formats such as ISO8601, RFC2822, RFC-3339, etc.

Describe alternatives you've considered
N/A

Additional context
N/A

Add Unit Tests for All API Endpoints

Is your feature request related to a problem? Please describe.
We need to add unit tests to ensure the reliability and correctness of all API endpoints. This will help catch bugs early and maintain the quality of our codebase.

Describe the solution you'd like
Use a testing framework like unittest, pytest, or nose.

Describe alternatives you've considered
N/A

Additional context

  • All API endpoints have corresponding unit tests.
  • Tests cover all critical paths, edge cases, and error handling.
  • Tests are run automatically as part of the CI/CD pipeline.
  • Code coverage meets the project's standards (e.g., 80%+).

Integration of Web UI

Is your feature request related to a problem? Please describe.
This proposal aims to solve challenges such as managing Prometheus rules (alerting and recording) via text editors, which require reloading (restarting in the worst cases) Prometheus service after each rule change. Considering the enhanced API functionality that the Prometheus API provides, it is fully possible to build a lightweight user interface on top of this proxy application.

Describe the solution you'd like
Create a simple, yet highly functional, user interface using HTML, CSS, and JS on top of the prometheus-api project. It is suggested that this UI be disabled by default because the primary goal of the prometheus-api project is to provide API functionalities.

Describe alternatives you've considered
N/A

Additional context
This functionality will make the development, debugging, and management of production rules processes faster and more flexible while engineers work on their Prometheus rules.

Add Reporting web page

Is your feature request related to a problem? Please describe.
As the application already has an API for exporting data from Prometheus in multiple formats, this feature needs to be made available on the web.

Describe the solution you'd like
Build a web page, "Reporting Page," where users can type their PromQL, provide necessary attributes like times, field names, etc., and export the required data by accessing everything that the /export API provides.

Describe alternatives you've considered
N/A

Additional context
N/A

Add a new API for exporting data as a CSV

Is your feature request related to a problem? Please describe.
Add a new API that allows users to export data as a CSV file based on their Prometheus queries.

Describe the solution you'd like
This API should use the native Prometheus API /api/v1/query.

Describe alternatives you've considered
N/A

Additional context
N/A

Support configuration management API

Is your feature request related to a problem? Please describe.
Add a new API that will allow configuring and updating the main Prometheus configuration file (prometheus.yml) through the API.

Describe the solution you'd like
This API should be based on the following API.

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.
In addition to all of this, the feature should be visible on the UI as well where users can easily add or update Prometheus targets, etc.

Add health endpoint

Is your feature request related to a problem? Please describe.
The proposed endpoint should return "OK" when the dependent application, Prometheus, is ready and running properly.

Describe the solution you'd like
Implement a new FastAPI route, for example, /health, and include all checks that we use in the main module, such as filesystem checks, Prometheus checks, etc.

Describe alternatives you've considered
N/A

Additional context
N/A

Add support for exporting data in several file formats

Is your feature request related to a problem? Please describe.
As we already have an /export API that returns the requested data from Prometheus as a CSV file, we need to support additional formats such as YAML, JSON and NDJSON.

Describe the solution you'd like
The API must take HTTP query parameters like ?format=csv|yaml|yml|json default should be csv

Describe alternatives you've considered
N/A

Additional context
N/A

Support of optional theme dark/light

Is your feature request related to a problem? Please describe.
Currently, the 'Rules Management' page supports only a light theme. The purpose of this feature request is to add support for a dark theme as well, allowing users to choose their preferred color theme.

Describe the solution you'd like
An additional button is needed on the 'Rules Management' page that will allow users to select their preferred theme mode.

Describe alternatives you've considered
N/A

Additional context
N/A

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.