sonata-nfv / son-gkeeper

SONATA's Service Platform Gatekeeper
http://www.sonata-nfv.eu
Apache License 2.0
2 stars 18 forks source link

Implement request for KPIs #595

Closed jbonnet closed 7 years ago

jbonnet commented 7 years ago

The GUI needs to request existing KPIs. The GUI should request .../api/v2/kpis?name=user_registrations&start=…&end=…&step=... The GK API should transform this into POST .../api/v1/prometheus/metrics/data with body {"name":"user_registrations","start": "2017-05-03T11:41:22Z", "end": "2017-05-03T11:51:11Z", "step": "10s", "labels":[]}

jbonnet commented 7 years ago

@pkarkazis @mzacharioudakis PR #598 introduces the above described API. Can you please check if it is ok from the GUI's side?

pkarkazis commented 7 years ago

@jbonnet Hello we have a problem when I make a request on gkapi: curl https://sp.int3.sonata-nfv.eu/api/v2/kpis?name=user_registrations&start=2017-05-05T14:13:02.699Z&end=2017-05-05T14:33:02.699Z&step=10m I get as response: { "error": { "code": 400, "message": "No list of KPIs was returned" } }

But, if I make the same request directly to Mon-Manager: curl -H "Content-Type: application/json" -d '{"name":"user_registrations","start":"2017-05-05T14:13:02.699Z","end":"2017-05-05T14:33:02.699Z","step":"10m","labels":[{}]}' http://sp.int3.sonata-nfv.eu:8000/api/v1/prometheus/metrics/data

I receive data: { "metrics": { "resultType": "matrix", "result": [{ "metric": { "exported_instance": "gtkapi", "group": "development", "exported_job": "sonata", "module": "users", "elapsed_time": "0.593299396", "instance": "pushgateway:9091", "job": "sonata", "result": "ok", "name": "user_registrations", "method": "POST", "uuid": "b70863c9-9b92-4733-b45a-1990362bb2ef" }, "values": [ [1493994782.699, "1"] ] }] } }

Could you please check the connection timeout in gk's request?

jbonnet commented 7 years ago

Sure, let me check...

On 5 May 2017, at 15:59, Panos Karkazis notifications@github.com wrote:

@jbonnet https://github.com/jbonnet Hello we have a problem when I make a request on gkapi: curl https://sp.int3.sonata-nfv.eu/api/v2/kpis?name=user_registrations&start=2017-05-05T14:13:02.699Z&end=2017-05-05T14:33:02.699Z&step=10m https://sp.int3.sonata-nfv.eu/api/v2/kpis?name=user_registrations&start=2017-05-05T14:13:02.699Z&end=2017-05-05T14:33:02.699Z&step=10m I get as response: { "error": { "code": 400, "message": "No list of KPIs was returned" } }

But, if I make the same request directly to Mon-Manager: curl -H "Content-Type: application/json" -d '{"name":"user_registrations","start":"2017-05-05T14:13:02.699Z","end":"2017-05-05T14:33:02.699Z","step":"10m","labels":[{}]}' http://sp.int3.sonata-nfv.eu:8000/api/v1/prometheus/metrics/data http://sp.int3.sonata-nfv.eu:8000/api/v1/prometheus/metrics/data I receive data: { "metrics": { "resultType": "matrix", "result": [{ "metric": { "exported_instance": "gtkapi", "group": "development", "exported_job": "sonata", "module": "users", "elapsed_time": "0.593299396", "instance": "pushgateway:9091", "job": "sonata", "result": "ok", "name": "user_registrations", "method": "POST", "uuid": "b70863c9-9b92-4733-b45a-1990362bb2ef" }, "values": [ [1493994782.699, "1"] ] }] } }

Could you please check the connection timeout in gk's request?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sonata-nfv/son-gkeeper/issues/595#issuecomment-299488220, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAuQxgNhryitZuGT6HEV3jCwOxTCM0Sks5r2zlSgaJpZM4NPeKx.

jbonnet commented 7 years ago

@pkarkazis Can you try again please?

pkarkazis commented 7 years ago

@jbonnet no change.... it has the same behavior as it did before :(

jbonnet commented 7 years ago

@pkarkazis I've fixed a few glitches and did a couple of PRs. I'll try later to fix this...

Thanks,

jbonnet commented 7 years ago

@mzacharioudakis After chating with you last thursday on what has been implemented in the GUI to show KPIs, I've noticed, I've noticed one thing: maybe what we want to show is not a counter (of registered users and on-boarded packages), as it is implemented, but a gauge, although the details of the counter also carry the time the GK took to create those two entities (users and packages)?

In the end, what I think we should show at the demo, was a graphic showing that 95% of packages were on-boarded in 1minute or less. If we want to show this, what's the best way to save that information, a counter or a gauge? What do you think?

CC: @pkarkazis, @trakadasp, @srodriguezOPT

pkarkazis commented 7 years ago

@jbonnet The most suitable way to store user registrations and packages on board is as gauge metrics because we must be able to dicrease the values of these kpis.

jbonnet commented 7 years ago

Ok, I can change that... @mzacharioudakis, is that ok? You've got code with this already...

jbonnet commented 7 years ago

Closed, continues in #630