Skip to content

Metrics API Scaler support different format #2633

@alileza

Description

@alileza

Proposal

Extend metrics API scaler to support Prometheus format, or new scaler would be preferable?

I'm thinking something like

triggers:
- type: metrics-api
  metadata:
    targetValue: "8"
    url: "http://api:3232/api/v1/stats?format=prometheus"
    valueLocation: "go_memstats_mcache_inuse_bytes"

or instead of relying on ?format we can also rely on content-type: application/json will use gjson and content-type: text/plain will use Prometheus format.

unfortunately most of /metrics mostly use content-type: text/plain instead of explicitly saying it's Prometheus

Use-Case

Currently, metrics API Scaler only support JSON format which is pretty handy if the application exposes metrics using JSON.

but most application currently exposes metrics using Prometheus Metrics format, for example.

Anything else?

I can work on this, in case this feature would be something acceptable

Metadata

Metadata

Assignees

Labels

featureAll issues for new features that have been committed togood first issueGood for newcomershelp wantedLooking for support from communityneeds-discussion

Type

No type

Projects

Status

Ready To Ship

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions