Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

A metric can be a Prometheus metric #9

Closed
mtneug opened this issue Nov 27, 2016 · 0 comments
Closed

A metric can be a Prometheus metric #9

mtneug opened this issue Nov 27, 2016 · 0 comments

Comments

@mtneug
Copy link
Owner

mtneug commented Nov 27, 2016

Description

One monitoring solutions that has gotten a lot of attention in the container ecosystem is Prometheus. It defines formats for pull based metric gathering that spate can also use for autoscaling.

Design

Prometheus metric have the metric type prometheus. To function correctly additional labels have to be specified. In particular spate needs to know the HTTP url exposing the metrics, the name of the metric, and the kind (see #6) as well as the target value (see #10). localhost in urls refers to individual replicas. This is especially necessary for replica metrics, as there each replica needs to be queried individually. If localhost is not used as the host part and the metric is a replica metric, a warning should be logged. If localhost is used and the metric is a system metric any replica is used for querying. If HTTPS is used the full certificate validation must succeed. There is no option for turning this off. The name must be a valid Prometheus metric name. If more than one Prometheus metric with the exact same url and name is declared, autoscaling is deactivated and an error is logged.

$ docker service create \
   --name service \
   --label de.mtneug.spate.metrics.mymetric.type=prometheus \
   --label de.mtneug.spate.metrics.mymetric.kind=replica \
   --label de.mtneug.spate.metrics.mymetric.prometheus.endpoint=http://localhost:8080/metrics \
   --label de.mtneug.spate.metrics.mymetric.prometheus.name=mymetric \
   --label de.mtneug.spate.metrics.mymetric.target=20 \
   ...
   my/service
@mtneug mtneug modified the milestone: 0.1.0 Nov 27, 2016
@mtneug mtneug self-assigned this Nov 27, 2016
@mtneug mtneug changed the title A metric can be a Prometheus metrics A metric can be a Prometheus metric Nov 30, 2016
@mtneug mtneug closed this as completed Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant