hayk96 / prometheus-api

Extended HTTP API service for Prometheus
https://hayk96.github.io/prometheus-api/
MIT License
26 stars 1 forks source link

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

Closed hayk96 closed 3 months ago

hayk96 commented 3 months ago

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