StatusWolf icon indicating copy to clipboard operation
StatusWolf copied to clipboard

Issue with suggestion?

Open kitgerrits opened this issue 11 years ago • 7 comments

When I enter a metric in the "Add Widget" window, I get no suggestions. If I hit [Enter], I get: Suggested Tags: No tags found

In the logs, I see:

[2014-08-11 19:37:26] myapp.INFO: Populated SecurityContext with an anonymous Token [] []
[2014-08-11 19:37:26] myapp.INFO: > GET /api/datasource/opentsdb/suggest_metrics?query=proc [] []
[2014-08-11 19:37:26] myapp.INFO: < 200 [] []

On the commandline, I get:

$ curl http://localhost:9653/api/datasource/opentsdb/suggest_metrics?query=proc
{"query":"proc","suggestions":null}

If I query OpenTSDB directly, I get:

$ curl -i  "http://localhost:4242/api/suggest?type=metrics&q=proc"
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 618

["proc.interrupts","proc.kernel.entropy_avail","proc.loadavg.15min","proc.loadavg.1min","proc.loadavg.5min","proc.loadavg.runnable","proc.loadavg.total_threads","proc.meminfo.active","proc.meminfo.anonhugepages","proc.meminfo.anonpages","proc.meminfo.bounce","proc.meminfo.buffers","proc.meminfo.cached","proc.meminfo.commitlimit","proc.meminfo.committed_as","proc.meminfo.directmap1g","proc.meminfo.directmap2m","proc.meminfo.directmap4k","proc.meminfo.dirty","proc.meminfo.hardwarecorrupted","proc.meminfo.hugepagesize","proc.meminfo.inactive","proc.meminfo.kernelstack","proc.meminfo.mapped","proc.meminfo.memfree"] 

It might be a configuration issue, as I don't get any metric data either. Unlike the logs would suggest:

[2014-08-11 19:40:09] myapp.INFO: Populated SecurityContext with an anonymous Token [] []
[2014-08-11 19:40:09] myapp.INFO: > POST /api/datasource/opentsdb/search [] []
[2014-08-11 19:40:09] myapp.INFO: Retrieved metrics from OpenTSDB, total execution time: 0 seconds [] []
[2014-08-11 19:40:09] myapp.INFO: < 200 [] []

This is my sw_datasources.conf: (the :4243 is nginx wrapping to add a header for Grafana, which does suggest timeseries)

$ cat conf/sw_datasource.json 
{
    "datasource": {
        "OpenTSDB": {
            "enabled": true,
            "type": "ajax",
            "url": [
                "7334r.w05.comscore.mgmt:4243/"
            ],
            "trim": "301",
            "proxy": false
        }
    }
}

What is the best place to start looking?

kitgerrits avatar Aug 11 '14 17:08 kitgerrits

can you try a curl from the command line that hits the URL in the StatusWolf config? First guess would be that since you can curl the regular OpenTSDB URL successfully that maybe there's an interaction with the nginx proxy version?

discogestalt avatar Aug 11 '14 23:08 discogestalt

Oh, and also, what happens if you change the sw_datasource.json file to point directly to the OpenTSDB server instead of the proxy?

discogestalt avatar Aug 12 '14 17:08 discogestalt

The only difference between the two is in the header:

7334R W05 * OPENTSDB ie-eu ~ $ curl -i  "http://localhost:4242/api/suggest?type=metrics&q=proc"
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 618

["proc.interrupts","proc.kernel.entropy_avail","proc.loadavg.15min","proc.loadavg.1min","proc.loadavg.5min","proc.loadavg.runnable","proc.loadavg.total_threads","proc.meminfo.active","proc.meminfo.anonhugepages","proc.meminfo.anonpages","proc.meminfo.bounce","proc.meminfo.buffers","proc.meminfo.cached","proc.meminfo.commitlimit","proc.meminfo.committed_as","proc.meminfo.directmap1g","proc.meminfo.directmap2m","proc.meminfo.directmap4k","proc.meminfo.dirty","proc.meminfo.hardwarecorrupted","proc.meminfo.hugepagesize","proc.meminfo.inactive","proc.meminfo.kernelstack","proc.meminfo.mapped","proc.meminfo.memfree"]

7334R W05 * OPENTSDB ie-eu ~ $ curl -i  "http://localhost:4243/api/suggest?type=metrics&q=proc"
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 12 Aug 2014 08:23:06 GMT
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive

["proc.interrupts","proc.kernel.entropy_avail","proc.loadavg.15min","proc.loadavg.1min","proc.loadavg.5min","proc.loadavg.runnable","proc.loadavg.total_threads","proc.meminfo.active","proc.meminfo.anonhugepages","proc.meminfo.anonpages","proc.meminfo.bounce","proc.meminfo.buffers","proc.meminfo.cached","proc.meminfo.commitlimit","proc.meminfo.committed_as","proc.meminfo.directmap1g","proc.meminfo.directmap2m","proc.meminfo.directmap4k","proc.meminfo.dirty","proc.meminfo.hardwarecorrupted","proc.meminfo.hugepagesize","proc.meminfo.inactive","proc.meminfo.kernelstack","proc.meminfo.mapped","proc.meminfo.memfree"]

The nginx proxy is to enable CORS with OpenTSDB 2.0: http://grafana.org/docs/features/opentsdb/

kitgerrits avatar Aug 12 '14 18:08 kitgerrits

I updated from OpenTSDB 2.0.0. to 2.1.0 in the meantime (yay for search support), but I still have the same issue. I also tried setting StatusWolf to port 4242, same issue.

kitgerrits avatar Aug 12 '14 18:08 kitgerrits

As noted on the site: exactly the same thing.

Is there a way to enable more verbose output to see what it's doing with OpenTSDB? Debug was already set to true, a log has been attached.

I've attached a session log of StatusWolf and openTSDB, pulling data (successfully) via OpenTSDB and (unsuccessfully) via StatusWolf.

These are my configs: $ cat sw_datasource.json { "datasource": { "OpenTSDB": { "enabled": true, "type": "ajax", "url": [ "7334r.w05.comscore.mgmt:4242/" ], "trim": "301", "proxy": false } } }

$ cat sw_config.json { "sw_app": { "debug": true, "installed": true }, "db_options": { "driver": "pdo_mysql", "host": "localhost", "dbname": "statuswolf", "user": "statuswolf", "password": "statuswolf" }, "auth_config": { "with_csrf": true, "users": { "auto_create": true, "default_auth_type": "ldap", "default_role": "ROLE_USER" }, "ldap_options": { "url": "ldaps://office.comscore.com:3268", "binddn": "CN=,OU=Users-Robotic,DC=office,DC=comscore,DC=com", "bindpw": "", "basedn": "DC=office,DC=comscore,DC=com", "userattr": "samAccountName", "name_key": "cn" } }, "logging": { "level": "INFO" }, "graphing": { "d3_location": "local" } }

Could this be due to the fact that I am unable to authenticate with LDAP? (I can pull data from OpenTSDB without authentication)

I stole this form a working Apache implementation: AuthLDAPURL "ldap:// office.comscore.com:3268/dc=office,dc=comscore,dc=com?samAccountName" AuthLDAPBindDN "<censored1" AuthLDAPBindPassword ""

to: "auth_config": { "with_csrf": true, "users": { "auto_create": true, "default_auth_type": "ldap", "default_role": "ROLE_USER" }, "ldap_options": { "url": "ldaps://office.comscore.com:3268", "binddn": "CN=,OU=Users-Robotic,DC=office,DC=comscore,DC=com", "bindpw": "<censored2", "basedn": "DC=office,DC=comscore,DC=com", "userattr": "samAccountName", "name_key": "cn" }

On Tue, Aug 12, 2014 at 7:26 PM, Mark Troyer [email protected] wrote:

Oh, and also, what happens if you change the sw_datasource.json file to point directly to the OpenTSDB server instead of the proxy?

— Reply to this email directly or view it on GitHub https://github.com/box/StatusWolf/issues/60#issuecomment-51947298.

He attacked everything in life with a mix of extraordinary genius and naive incompetence, and it was often difficult to tell which was which.

  • Douglas Adams

kitgerrits avatar Aug 12 '14 18:08 kitgerrits

I pulled the same graph with Grafana (see attached)

On Tue, Aug 12, 2014 at 7:26 PM, Mark Troyer [email protected] wrote:

Oh, and also, what happens if you change the sw_datasource.json file to point directly to the OpenTSDB server instead of the proxy?

— Reply to this email directly or view it on GitHub https://github.com/box/StatusWolf/issues/60#issuecomment-51947298.

He attacked everything in life with a mix of extraordinary genius and naive incompetence, and it was often difficult to tell which was which.

  • Douglas Adams

kitgerrits avatar Aug 12 '14 18:08 kitgerrits

I'm not seeing the attached log with DEBUG turned on - can you send it to my email address? [email protected]

Setting DEBUG will also give you more info in the browser console - can you check that as well and see if there are any apparent errors showing?

thanks.

discogestalt avatar Aug 12 '14 19:08 discogestalt