influxdb-rails 1.0.0.beta3 → 1.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -0
  3. data/CHANGELOG.md +12 -10
  4. data/README.md +193 -168
  5. data/influxdb-rails.gemspec +13 -7
  6. data/lib/influxdb/rails/configuration.rb +88 -192
  7. data/lib/influxdb/rails/context.rb +19 -1
  8. data/lib/influxdb/rails/instrumentation.rb +4 -4
  9. data/lib/influxdb/rails/middleware/render_subscriber.rb +7 -0
  10. data/lib/influxdb/rails/middleware/request_subscriber.rb +22 -24
  11. data/lib/influxdb/rails/middleware/simple_subscriber.rb +12 -25
  12. data/lib/influxdb/rails/middleware/sql_subscriber.rb +7 -3
  13. data/lib/influxdb/rails/middleware/subscriber.rb +19 -8
  14. data/lib/influxdb/rails/railtie.rb +29 -32
  15. data/lib/influxdb/rails/version.rb +1 -1
  16. data/lib/influxdb-rails.rb +20 -81
  17. data/lib/rails/generators/influxdb/influxdb_generator.rb +1 -1
  18. data/lib/rails/generators/influxdb/templates/initializer.rb +39 -9
  19. data/sample-dashboard/Dockerfile +25 -0
  20. data/sample-dashboard/README.md +74 -0
  21. data/sample-dashboard/Rakefile +8 -0
  22. data/sample-dashboard/Ruby On Rails Performance (per Request).json +1053 -0
  23. data/sample-dashboard/Ruby On Rails Performance.json +2011 -0
  24. data/sample-dashboard/docker-compose.yml +33 -0
  25. data/sample-dashboard/provisioning/grafana-dashboards.yml +12 -0
  26. data/sample-dashboard/provisioning/grafana-datasource.yml +10 -0
  27. data/sample-dashboard/provisioning/performance-request.json +1053 -0
  28. data/sample-dashboard/provisioning/performance.json +2011 -0
  29. data/spec/integration/metrics_spec.rb +12 -13
  30. data/spec/shared_examples/data.rb +61 -0
  31. data/spec/spec_helper.rb +3 -1
  32. data/spec/support/rails4/app.rb +4 -0
  33. data/spec/support/rails5/app.rb +4 -0
  34. data/spec/unit/configuration_spec.rb +47 -65
  35. data/spec/unit/middleware/render_subscriber_spec.rb +13 -9
  36. data/spec/unit/middleware/request_subscriber_spec.rb +33 -21
  37. data/spec/unit/middleware/sql_subscriber_spec.rb +35 -8
  38. metadata +42 -30
  39. data/lib/influxdb/rails/air_traffic_controller.rb +0 -41
  40. data/lib/influxdb/rails/backtrace.rb +0 -44
  41. data/lib/influxdb/rails/exception_presenter.rb +0 -94
  42. data/lib/influxdb/rails/logger.rb +0 -16
  43. data/lib/influxdb/rails/middleware/hijack_render_exception.rb +0 -16
  44. data/lib/influxdb/rails/middleware/hijack_rescue_action_everywhere.rb +0 -31
  45. data/lib/influxdb/rails/rack.rb +0 -24
  46. data/spec/integration/exceptions_spec.rb +0 -37
  47. data/spec/shared_examples/tags.rb +0 -42
  48. data/spec/unit/backtrace_spec.rb +0 -85
  49. data/spec/unit/exception_presenter_spec.rb +0 -23
  50. data/spec/unit/influxdb_rails_spec.rb +0 -78
@@ -0,0 +1,33 @@
1
+ version: "3.7"
2
+ services:
3
+ influx:
4
+ image: influxdb:1.7
5
+ environment:
6
+ - INFLUXDB_DB=rails
7
+ - INFLUXDB_USER=root
8
+ - INFLUXDB_USER_PASSWORD=root
9
+ - INFLUXDB_READ_USER=grafana
10
+ - INFLUXDB_READ_USER_PASSWORD=grafana
11
+ volumes:
12
+ - influxdata:/var/lib/influxdb
13
+ ports:
14
+ - 8086:8086
15
+ grafana:
16
+ image: grafana/grafana:6.2.4
17
+ ports:
18
+ - 3000:3000
19
+ depends_on:
20
+ - influx
21
+ volumes:
22
+ - ./provisioning/grafana-datasource.yml:/etc/grafana/provisioning/datasources/grafana-datasource.yml:ro
23
+ - ./provisioning/grafana-dashboards.yml:/etc/grafana/provisioning/dashboards/grafana-dashboards.yml:ro
24
+ - ./provisioning/performance.json:/var/lib/grafana/dashboards/performance.json:ro
25
+ - ./provisioning/performance-request.json:/var/lib/grafana/dashboards/performance-request.json:ro
26
+ - grafanadata:/var/lib/grafana
27
+ rails:
28
+ image: hennevogel/influxdb-rails-sample
29
+ ports:
30
+ - 4000:4000
31
+ volumes:
32
+ influxdata:
33
+ grafanadata:
@@ -0,0 +1,12 @@
1
+ apiVersion: 1
2
+
3
+ providers:
4
+ - name: 'influxdb-rails-samples'
5
+ folder: 'rails'
6
+ type: file
7
+ disableDeletion: false
8
+ editable: true
9
+ updateIntervalSeconds: 600
10
+ options:
11
+ path: /var/lib/grafana/dashboards
12
+
@@ -0,0 +1,10 @@
1
+ apiVersion: 1
2
+
3
+ datasources:
4
+ - name: InfluxDB
5
+ type: influxdb
6
+ access: proxy
7
+ database: rails
8
+ user: grafana
9
+ password: grafana
10
+ url: http://influx:8086