How can I get the metrics from the openziti controller?
I played aroung with 0.0.0.0 and 127.0.0.1 but always get curl: (52) Empty reply from server
I'm using curl --request GET "http://127.0.0.1:10004/metrics" to querry the metrics.
My Config:
- name: apis-metrics-localhost
bindPoints:
#interface - required
# A host:port string on which network interface to listen on. 0.0.0.0 will listen on all interfaces
- interface: 0.0.0.0:10004
# address - required
# The public address that external incoming requests will be able to resolve. Used in request processing and
# response content that requires full host:port/path addresses.
address: 0.0.0.0:10004
options:
apis:
- binding: metrics
options: {
includeTimestamps: true
}
The endpoint is a Prometheus endpoint. You can use Prometheus to collect them, or you can get them from the logs directly and parse them with something else. You do need to make sure the filters are set to record the metrics you intend to view, those configurations are on the same page.
There is also a page on using Grafana to visualize the metrics gathered by Prometheus.
Have you followed the authentication piece of the Prometheus page? https is the protocol, not http, so you have to use https in the url and skip TLS verification (Since it uses a private cert), or you can also set up a key and cert. Depending on how else you are securing the metrics endpoint, it's a decision to make. You have the endpoint bound to all interfaces, so if it is remotely accessible, I would secure it completely. If you are using a cloud or host based security group to keep the port closed off, then the easier thing to do is to use https and set the skip authentication (insecure_skip_verify: true).
Could be a version thing, but the syntax I have in Prometheus is insecure_skip_verify: true rather than tls_skip_verify:true. I use a remote scraper, so I have the full cert enabled, but if it helps.
My Prometheus config is
job_name: ziti
scheme: https
metrics_path: /metrics
honor_labels: true # Ziti supplies system labels for the edge routers, so we need to obey them
honor_timestamps: true # Honor server timestamps instead of using the scrape timestamp for metrics
tls_config:
cert_file: /opt/bitnami/prometheus/conf/prom-client.crt
key_file: /opt/bitnami/prometheus/conf/prom-client.key
insecure_skip_verify: true
static_configs:
I never got that far on the OpenZiti side. On the CloudZiti side, we have a bunch of alerts and alarms, but that is all based on an ElasticSearch system, not Prometheus. We use Grafana for visualization of that data, but the alerts are driven with Elastalert.