Empty service value when enabling Prometheus plugin


#1

Hi,

When I enable the Prometheus plugin, on a specific API, or Globally, I get a lot of data calling /metrics.
But the name of the service is blank. Any idea what is wrong?
I’m using version 0.14.1.

Basically I’m just doing:

# enable plugin
curl localhost:8001/plugins --data "name=prometheus"

#make some requests to a service

#get the metrics
curl localhost:8001/metrics
# TYPE kong_latency histogram
kong_latency_bucket{type="kong",service="",le="00001.0"} 1
kong_latency_bucket{type="kong",service="",le="00002.0"} 1
kong_latency_bucket{type="kong",service="",le="00005.0"} 2
kong_latency_bucket{type="kong",service="",le="00007.0"} 3
kong_latency_bucket{type="kong",service="",le="00010.0"} 4

Br
Jimmy


#2

Hi @jfalkbjer,

Could you share the services you’ve configured?
Also, are you using the older deprecated APIs entity or the Routes & Services entities?


#3

Hi,

Thanks for your response!

A typical service is configured with the deprecated apis style like:

curl -i -X POST http://localhost:8001/apis/ \
  -d 'uris=/api/some_service' \
  -d 'name=api_some_service' \
  -d 'strip_uri=true' \
  -d 'upstream_url=http://some-service:8080/api'

We are about to upgrade to routes and services, but are not there yet.


#4

Hello @jfalkbjer,

The Prometheus plugin doesn’t support APIs entity in Kong.
I recommend you migrate to Routes and Service in Kong to gain advantages and for forward-compatibility reasons.

Please also note that the APIs entity will be removed in Kong 1.0.


#5

Ok. That was also my thinking.
The documentation has example with the api approach with Promerheus, so I had some hope that it should work.

Br
Jimmy