Hi,

I am trying to setup the influx with grafana for Gitlab monitoring. I am 
getting below errors while doing the influx-db management.


OS version: RHEL 7.2 
InfluxDB: influxdb-0.13.0-1.x86_64 
Grafana: grafana-4.1.1-1484211277.x86_64 
Ruby: ruby-2.0.0.648-29.el7.x86_64


https://docs.gitlab.com/ce/administration/monitoring/performance/grafana_configuration.html#apply-retention-policies-and-create-continuous-queries


[root@grafa-node influxdb-management]# bundle exec rake --trace 
** Invoke default (first_time) 
** Invoke policies (first_time) 
** Execute policies 
** Invoke queries (first_time) 
** Execute queries 
rake aborted! 
The query in /opt/influxdb-management/queries/events/
commits_pushed_to_non_master_per_hour.txt must specify the database using `ON 
$DATABASE` 
/opt/influxdb-management/Rakefile:54:in `block (2 levels) in <top 
(required)>' 
/opt/influxdb-management/Rakefile:47:in `each' 
/opt/influxdb-management/Rakefile:47:in `block in <top (required)>' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:248:in `call' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:248:in `block in 
execute' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:243:in `each' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:243:in `execute' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:187:in `block in 
invoke_with_call_chain' 
/usr/share/ruby/monitor.rb:211:in `mon_synchronize' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:180:in 
`invoke_with_call_chain' 

/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:209:in `block in 
invoke_prerequisites' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:207:in `each' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:207:in 
`invoke_prerequisites' 

/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:186:in `block in 
invoke_with_call_chain' 
/usr/share/ruby/monitor.rb:211:in `mon_synchronize' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:180:in 
`invoke_with_call_chain' 

/usr/local/share/gems/gems/rake-11.2.2/lib/rake/task.rb:173:in `invoke' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:152:in 
`invoke_task' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:108:in `block 
(2 levels) in top_level' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:108:in `each' 

/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:108:in 
`block in top_level' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:117:in 
`run_with_threads' 

/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:102:in `
top_level' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:80:in `block 
in run' 
/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:178:in 
`standard_exception_handling' 

/usr/local/share/gems/gems/rake-11.2.2/lib/rake/application.rb:77:in `run' 
/usr/local/share/gems/gems/rake-11.2.2/exe/rake:27:in `<top (required)>' 
/usr/local/bin/rake:22:in `load' 
/usr/local/bin/rake:22:in `<top (required)>' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/cli/exec.rb:74:in 
`load' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/cli/exec.rb:74:in 
`kernel_load' 

/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/cli/exec.rb:27:in `run' 

/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/cli.rb:335:in `exec' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor/
command.rb:27:in `run' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in
 
`invoke_command' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor.rb:359:in
 
`dispatch'
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/cli.rb:20:in `dispatch' 

/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in
 
`start' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/cli.rb:11:in `start' 
/usr/local/share/gems/gems/bundler-1.14.5/exe/bundle:32:in `block in <top 
(required)>' 
/usr/local/share/gems/gems/bundler-1.14.5/lib/bundler/friendly_errors.rb:121:in 
`with_friendly_errors' 
/usr/local/share/gems/gems/bundler-1.14.5/exe/bundle:24:in `<top 
(required)>' 
/usr/local/bin/bundle:22:in `load' 
/usr/local/bin/bundle:22:in `<main>' 
Tasks: TOP => default => queries 
[root@grafana-node influxdb-management]#


Could you help me to fix these problems.Normal operations are running fine 
with influxdb. Couldn't find any error messages in the influxdbd logs.


[query] 2017/02/24 19:02:39 SHOW RETENTION POLICIES ON gitlab 
[httpd] 2017/02/24 19:02:39 ::1 - isource [24/Feb/2017:19:02:39 +0200] GET /
query?p=%5BREDACTED%5D&q=SHOW+RETENTION+POLICIES+ON+%22gitlab%22&u=isource 
HTTP/1.1 200 190 - Ruby 0c5f37d3-fab3-11e6-8012-000000000000 2.548514ms 
[query] 2017/02/24 19:02:39 ALTER RETENTION POLICY default_gitlab ON gitlab 
DURATION 1h REPLICATION 1 DEFAULT 
[httpd] 2017/02/24 19:02:39 ::1 - isource [24/Feb/2017:19:02:39 +0200] GET /
query?p=%5BREDACTED%5D&q=ALTER+RETENTION+POLICY+%22default_gitlab%22+ON+
gitlab+DURATION+1h+REPLICATION+1+DEFAULT&u=isource HTTP/1.1 200 195 - Ruby 
0c5fcaee-fab3-11e6-8013-000000000000 4.273993ms 
[query] 2017/02/24 19:02:39 SHOW RETENTION POLICIES ON gitlab 
[httpd] 2017/02/24 19:02:39 ::1 - isource [24/Feb/2017:19:02:39 +0200] GET /
query?p=%5BREDACTED%5D&q=SHOW+RETENTION+POLICIES+ON+%22gitlab%22&u=isource 
HTTP/1.1 200 190 - Ruby 0c609eeb-fab3-11e6-8014-000000000000 2.073061ms

Below is the contents of the file 
"/opt/influxdb-management/queries/events/commits_pushed_to_non_master_per_hour.txt".


[root@grafana-node influxdb-management]# cat 
/opt/influxdb-management/queries/events/commits_pushed_to_non_master_per_hour.txt
 

CREATE CONTINUOUS QUERY commits_pushed_to_non_master_per_hour ON gitlab 
BEGIN 
SELECT sum(count) AS "count" 
INTO year.commits_pushed_to_non_master_per_hour 
FROM "one_hour".events 
WHERE "event" = 'push_commit' 
AND "branch" != 'master' 
GROUP BY time(1h) 
END 
[root@grafana-node influxdb-management]#


-Thanks, 
Rajesh M


-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/101f63d6-9b85-46e2-93cc-24984566ec61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to