Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Monitor Test Error! #41

Open
gcagrici opened this issue May 15, 2014 · 8 comments
Open

Monitor Test Error! #41

gcagrici opened this issue May 15, 2014 · 8 comments

Comments

@gcagrici
Copy link

Hi,

When I push the Test Monitor button, I get the following error without any details:

alias(carbon.agents.ip-10-214-134-148-a.avgUpdateTime,"test")

The log of the rails app is:

I, [2014-05-15T14:20:00.907000 #22029] INFO -- : Started GET "/rearview/monitors/index.json" for 10.226.195.119 at 2014-05-15 14:20:00 +0300
I, [2014-05-15T14:20:01.621000 #22029] INFO -- : Started GET "/rearview/help/quick.html" for 10.226.195.119 at 2014-05-15 14:20:01 +0300
I, [2014-05-15T14:20:08.558000 #22029] INFO -- : Started POST "/monitor.json" for 10.226.195.119 at 2014-05-15 14:20:08 +0300
I, [2014-05-15T14:20:08.582000 #22029] INFO -- : Processing by Rearview::MonitorController#create as JSON
I, [2014-05-15T14:20:08.584000 #22029] INFO -- : Parameters: {"id"=>"", "dashboardId"=>"1", "userId"=>"1", "name"=>"TestMonitor", "active"=>"true", "jobType"=>"monitor", "version"=>"2", "cronExpr"=>"0 0 * ? Feb Sun", "errorTimeout"=>"60", "minutes"=>"1", "metrics"=>["alias(carbon.agents.ip-10-214-134-148-a.avgUpdateTime,"test")"], "monitorExpr"=>"", "toDate"=>"now", "createdAt"=>"", "modifiedAt"=>"", "description"=>""}
I, [2014-05-15T14:20:09.116000 #22029] INFO -- : Rendered /usr/local/rvm/gems/jruby-1.7.12/gems/rearview-1.2.1-java/app/views/rearview/monitor/create.json.jbuilder (10.0ms)
I, [2014-05-15T14:20:09.158000 #22029] INFO -- : Completed 200 OK in 531ms (Views: 58.0ms | ActiveRecord: 2.0ms)

Does anybody have any ideas?

@steveakers
Copy link
Contributor

I don't see any errors in that output. Everything looks OK to me.

@gcagrici
Copy link
Author

Yep that's the point. I only get the "Monitor Test Error!" message. I am now going through the source code and it looks like

if(t.graph_data) { ...

conditional returns false. Furthermore, although t.status is equals to "error", t.output and t.errors are all null.

Any help?

@steveakers
Copy link
Contributor

Does the metric carbon.agents.ip-10-214-134-148-a.avgUpdateTime exist in your graphite instance?

@gcagrici
Copy link
Author

Yes. To confirm that, I renamed the metric to a nonexistent one and that time I got the usual "Monitor Test Error!" message but with a detailed sentence indicating the metric does not exist. On the other hand, when the metric name is true, I only get that "Monitor Test Error!" message. In fact, I can give you RDP access to the machine in case you need.

@steveakers
Copy link
Contributor

Have you tried stopping and starting rearview? Sorry... I'm the product manager, so I'm not being very helpful. Our lead engineer isn't with the company any more.

@gcagrici
Copy link
Author

Yes I did that multiple times already.

@javamonkey79
Copy link

I am getting the same error. Is this project still active?

@DevinDawson
Copy link

Hi all,

I tracked this down. The query issued against graphite is encoding the target as an array rather than repeated key/value pairs. For example, a target of stats.com.foo will result in a query against graphite of http://graphite-1.example.com/render?format=raw&from=23%3A35_20140903&target[]=stats.com.foo&until=23%3A55_20140903

instead of

http://graphite-1.example.com/render?format=raw&from=23%3A35_20140903&target=stats.com.foo&until=23%3A55_20140903

(This occurs even if there is only a single target as the metric is initialized and encoded as an array.)

This has to be patched in the rearview-engine rather than rearview as follows
diff --git a/lib/graphite/client.rb b/lib/graphite/client.rb
index 3c2dd48..911e4a9 100644
--- a/lib/graphite/client.rb
+++ b/lib/graphite/client.rb
@@ -1,9 +1,12 @@
module Graphite
class Client
extend Forwardable
+
attr_reader :connection
def_delegators :@connection, :get, :post
def initialize(options={})

  •  # See https://github.com/lostisland/faraday/issues/182
    
  •  Faraday::Utils.default_params_encoder = Faraday::FlatParamsEncoder
    
    default_options = {}
    default_options[:ssl] = {
    verify: true,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants