Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Why Use HTTP POST When Querying '/render' API? #173

Closed
barakAtSoluto opened this issue Jun 28, 2018 · 0 comments · Fixed by #181
Closed

Why Use HTTP POST When Querying '/render' API? #173

barakAtSoluto opened this issue Jun 28, 2018 · 0 comments · Fixed by #181
Labels
bug Something isn't working
Milestone

Comments

@barakAtSoluto
Copy link

barakAtSoluto commented Jun 28, 2018

The Chart class is using "POST" method to query the /render API. I was wondering why?
As you can see in the method called - GraphiteWebClient-> request sends a null body (true, it's only the default but - it's not overwritten in the aforementioned call). So - it seems there is no reason to use "POST".

My motivation here is that I'm using a Graphite as a service called hostedgraphite. While using "POST" they return the "No Data" png as if the metric doesn't exists, but, "GET" works as expected.
An example query:

https://www.hostedgraphite.com/<client_id>/<client_token>/graphite/render?from=1530173184&until=1530173784&width=613&height=220&hideLegend=&tz=Europe%2FHelsinki&_salt=1530173784.000&vTitle=Percent&lineMode=connected&drawNullAsZero=false&graphType=line&majorGridLineColor=%230000003F&minorGridLineColor=%2300000000&_ext=whatever.svg&areaAlpha=0.5&areaMode=all&lineWidth=2&min=0&title=Disk%20_mnt&yUnitSystem=binary&target=alias%28color%28icinga2.icinga2master_soluto_local.services.disk.disk.perfdata._mnt.value%2C%20%27%231a7dd7%27%29%2C%20%27Used%20%28bytes%29%27%29&target=alias%28color%28icinga2.icinga2master_soluto_local.services.disk.disk.perfdata._mnt.max%2C%20%27%23cfd7e6%27%29%2C%20%27Size%20%28bytes%29%27%29.

I'll post an update after I hear back from hostedgraphite as to why the "POST" isn't working. Regardless, I believe "POST" shouldn't be used if there's no reason for it.

Expected Behavior

Plugin to work seamlessly without any regard to where Graphite is hosted.

Current Behavior

The "POST" method creates complications.

Possible Solution

Make the HTTP method configurable.

Steps to Reproduce (for bugs)

  1. Create a hostedgraphite account.
  2. Aquire a token.
  3. Set the base url accordingly.
  4. Check the Connect insecurelyCheck box.
  5. Config your GraphiteWriter accordingly.

Context

No graphs were displayed before the method was changed to "GET".

Your Environment

  • Module version (System - About): 1.0.1
  • Icinga Web 2 version and modules (System - About): 2.5.3
  • Icinga 2 version (icinga2 --version): r2.8.4-1
  • Graphite (carbon, web, whisper) version: Graphite version 0.9.15 with some fixes cherry-picked from upstream.
  • Operating System and version: Ubuntu 16.04.4
  • Webserver, PHP versions: Apache/2.4.18, PHP 7.0.30
@Al2Klimov Al2Klimov self-assigned this Aug 7, 2018
@Al2Klimov Al2Klimov added the bug Something isn't working label Aug 7, 2018
Al2Klimov added a commit that referenced this issue Aug 7, 2018
@Al2Klimov Al2Klimov removed their assignment Aug 7, 2018
@Al2Klimov Al2Klimov added the stalled Blocked or not relevant yet label Aug 8, 2018
Al2Klimov added a commit that referenced this issue Aug 22, 2018
@Al2Klimov Al2Klimov removed the stalled Blocked or not relevant yet label Aug 28, 2019
@Al2Klimov Al2Klimov added this to the v1.2.0 milestone Aug 28, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants