slack-ruby-bot-server 0.12.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +4 -9
- data/.travis.yml +0 -1
- data/CHANGELOG.md +4 -0
- data/DEBUGGING.md +0 -20
- data/README.md +29 -81
- data/UPGRADING.md +14 -0
- data/lib/slack-ruby-bot-server.rb +3 -3
- data/lib/slack-ruby-bot-server/api/endpoints/teams_endpoint.rb +7 -3
- data/lib/slack-ruby-bot-server/api/middleware.rb +4 -5
- data/lib/slack-ruby-bot-server/config.rb +8 -2
- data/lib/slack-ruby-bot-server/ext.rb +1 -1
- data/lib/slack-ruby-bot-server/loggable.rb +25 -0
- data/lib/slack-ruby-bot-server/rspec.rb +0 -1
- data/lib/slack-ruby-bot-server/service.rb +7 -33
- data/lib/slack-ruby-bot-server/version.rb +1 -1
- data/public/index.html.erb +1 -1
- data/slack-ruby-bot-server.gemspec +2 -2
- data/tasks/db.rake +0 -36
- metadata +11 -51
- data/images/slackbotserver.gif +0 -0
- data/images/slackbutton.gif +0 -0
- data/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb +0 -18
- data/lib/slack-ruby-bot-server/ext/slack-ruby-bot.rb +0 -2
- data/lib/slack-ruby-bot-server/ext/slack-ruby-bot/client.rb +0 -12
- data/lib/slack-ruby-bot-server/server.rb +0 -31
- data/sample_apps/README.md +0 -11
- data/sample_apps/sample_app_activerecord/.rspec +0 -3
- data/sample_apps/sample_app_activerecord/.standalone_migrations +0 -3
- data/sample_apps/sample_app_activerecord/Gemfile +0 -24
- data/sample_apps/sample_app_activerecord/Procfile +0 -1
- data/sample_apps/sample_app_activerecord/README.md +0 -12
- data/sample_apps/sample_app_activerecord/Rakefile +0 -14
- data/sample_apps/sample_app_activerecord/commands.rb +0 -2
- data/sample_apps/sample_app_activerecord/commands/help.rb +0 -19
- data/sample_apps/sample_app_activerecord/commands/whoami.rb +0 -6
- data/sample_apps/sample_app_activerecord/config.ru +0 -22
- data/sample_apps/sample_app_activerecord/config/newrelic.yml +0 -217
- data/sample_apps/sample_app_activerecord/config/postgresql.yml +0 -17
- data/sample_apps/sample_app_activerecord/db/migrate/20170307164946_create_teams_table.rb +0 -12
- data/sample_apps/sample_app_activerecord/db/migrate/20190323181453_add_activated_fields.rb +0 -7
- data/sample_apps/sample_app_activerecord/db/schema.rb +0 -29
- data/sample_apps/sample_app_activerecord/spec/api/root_spec.rb +0 -16
- data/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb +0 -14
- data/sample_apps/sample_app_activerecord/spec/commands/whoami_spec.rb +0 -14
- data/sample_apps/sample_app_activerecord/spec/spec_helper.rb +0 -19
- data/sample_apps/sample_app_mongoid/.rspec +0 -3
- data/sample_apps/sample_app_mongoid/Gemfile +0 -20
- data/sample_apps/sample_app_mongoid/Procfile +0 -1
- data/sample_apps/sample_app_mongoid/README.md +0 -14
- data/sample_apps/sample_app_mongoid/Rakefile +0 -10
- data/sample_apps/sample_app_mongoid/commands.rb +0 -2
- data/sample_apps/sample_app_mongoid/commands/help.rb +0 -19
- data/sample_apps/sample_app_mongoid/commands/whoami.rb +0 -6
- data/sample_apps/sample_app_mongoid/config.ru +0 -14
- data/sample_apps/sample_app_mongoid/config/mongoid.yml +0 -27
- data/sample_apps/sample_app_mongoid/config/newrelic.yml +0 -217
- data/sample_apps/sample_app_mongoid/spec/api/root_spec.rb +0 -16
- data/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb +0 -14
- data/sample_apps/sample_app_mongoid/spec/commands/whoami_spec.rb +0 -14
- data/sample_apps/sample_app_mongoid/spec/spec_helper.rb +0 -27
data/public/index.html.erb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
</p>
|
17
17
|
<p id='messages' />
|
18
18
|
<p id='register'>
|
19
|
-
<a href="https://slack.com/oauth/authorize?scope
|
19
|
+
<a href="https://slack.com/oauth/authorize?scope=<%= SlackRubyBotServer::Config.oauth_scope_s %>&client_id=<%= ENV['SLACK_CLIENT_ID'] %>"><img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x"></a>
|
20
20
|
</p>
|
21
21
|
<p id='active_teams_count'> </p>
|
22
22
|
<p>
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
|
-
spec.add_dependency 'async
|
17
|
+
spec.add_dependency 'async'
|
18
18
|
spec.add_dependency 'foreman'
|
19
19
|
spec.add_dependency 'grape'
|
20
20
|
spec.add_dependency 'grape-roar', '>= 0.4.0'
|
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'rack-cors'
|
24
24
|
spec.add_dependency 'rack-rewrite'
|
25
25
|
spec.add_dependency 'rack-server-pages'
|
26
|
-
spec.add_dependency 'slack-ruby-
|
26
|
+
spec.add_dependency 'slack-ruby-client'
|
27
27
|
end
|
data/tasks/db.rake
CHANGED
@@ -5,40 +5,4 @@ namespace :db do
|
|
5
5
|
Logger.new(STDOUT)
|
6
6
|
end
|
7
7
|
end
|
8
|
-
|
9
|
-
namespace :heroku do
|
10
|
-
desc 'Mongodump the BotServer database for a slack-ruby-bot-server Heroku app.'
|
11
|
-
task :backup, [:app] do |_t, args|
|
12
|
-
require 'mongoid-shell'
|
13
|
-
|
14
|
-
logger.info("[#{Time.now}] db:heroku:backup started")
|
15
|
-
|
16
|
-
# get heroku configuration info
|
17
|
-
app = args[:app] || raise('Missing app.')
|
18
|
-
JSON.parse(`bundle exec heroku config --app #{app} --json`).each_pair do |k, v|
|
19
|
-
ENV[k] = v
|
20
|
-
end
|
21
|
-
|
22
|
-
# connect to MongoDB
|
23
|
-
env = (ENV['RACK_ENV'] || 'development').to_s
|
24
|
-
logger.info "Connecting to the #{env} environment."
|
25
|
-
Mongoid.load! 'config/mongoid.yml', env
|
26
|
-
|
27
|
-
# mongodump
|
28
|
-
mongodump = Mongoid::Shell::Commands::Mongodump.new(session: Mongoid.default_client)
|
29
|
-
mongodump.out = File.join(Dir.tmpdir, 'db/' + mongodump.host.tr(':', '_'))
|
30
|
-
logger.info("[#{Time.now}] clearing (#{mongodump.out})")
|
31
|
-
FileUtils.rm_rf mongodump.out if File.directory? mongodump.out
|
32
|
-
logger.info("[#{Time.now}] mongodump to #{mongodump.out}")
|
33
|
-
system mongodump.to_s
|
34
|
-
|
35
|
-
# backup
|
36
|
-
backup_name = "#{app}-#{Time.now.strftime('%Y-%m-%d-%H%M%S')}"
|
37
|
-
tmp_db_filename = File.join(mongodump.out, backup_name)
|
38
|
-
logger.info("[#{Time.now}] compressing (#{tmp_db_filename}.tar.gz)")
|
39
|
-
system "tar -cvf #{tmp_db_filename}.tar #{mongodump.out}/#{mongodump.db}"
|
40
|
-
system "gzip #{tmp_db_filename}.tar"
|
41
|
-
logger.info "Created #{tmp_db_filename}.tar.gz."
|
42
|
-
end
|
43
|
-
end
|
44
8
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-ruby-bot-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: async
|
14
|
+
name: async
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: foreman
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,19 +137,19 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: slack-ruby-
|
140
|
+
name: slack-ruby-client
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0
|
145
|
+
version: '0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0
|
152
|
+
version: '0'
|
153
153
|
description:
|
154
154
|
email:
|
155
155
|
- dblock@dblock.org
|
@@ -175,8 +175,6 @@ files:
|
|
175
175
|
- Rakefile
|
176
176
|
- UPGRADING.md
|
177
177
|
- images/create-app.png
|
178
|
-
- images/slackbotserver.gif
|
179
|
-
- images/slackbutton.gif
|
180
178
|
- lib/slack-ruby-bot-server.rb
|
181
179
|
- lib/slack-ruby-bot-server/api.rb
|
182
180
|
- lib/slack-ruby-bot-server/api/endpoints.rb
|
@@ -200,19 +198,16 @@ files:
|
|
200
198
|
- lib/slack-ruby-bot-server/config/database_adapters/activerecord.rb
|
201
199
|
- lib/slack-ruby-bot-server/config/database_adapters/mongoid.rb
|
202
200
|
- lib/slack-ruby-bot-server/ext.rb
|
203
|
-
- lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb
|
204
201
|
- lib/slack-ruby-bot-server/ext/bson/object_id.rb
|
205
202
|
- lib/slack-ruby-bot-server/ext/grape/sort_extension.rb
|
206
203
|
- lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
|
207
|
-
- lib/slack-ruby-bot-server/ext/slack-ruby-bot.rb
|
208
|
-
- lib/slack-ruby-bot-server/ext/slack-ruby-bot/client.rb
|
209
204
|
- lib/slack-ruby-bot-server/info.rb
|
205
|
+
- lib/slack-ruby-bot-server/loggable.rb
|
210
206
|
- lib/slack-ruby-bot-server/models/team/activerecord.rb
|
211
207
|
- lib/slack-ruby-bot-server/models/team/methods.rb
|
212
208
|
- lib/slack-ruby-bot-server/models/team/mongoid.rb
|
213
209
|
- lib/slack-ruby-bot-server/rspec.rb
|
214
210
|
- lib/slack-ruby-bot-server/rspec/fabricators/team.rb
|
215
|
-
- lib/slack-ruby-bot-server/server.rb
|
216
211
|
- lib/slack-ruby-bot-server/service.rb
|
217
212
|
- lib/slack-ruby-bot-server/version.rb
|
218
213
|
- public/favicon.ico
|
@@ -224,41 +219,6 @@ files:
|
|
224
219
|
- public/scripts/register.js
|
225
220
|
- public/scripts/stats.js
|
226
221
|
- public/scripts/url.min.js
|
227
|
-
- sample_apps/README.md
|
228
|
-
- sample_apps/sample_app_activerecord/.rspec
|
229
|
-
- sample_apps/sample_app_activerecord/.standalone_migrations
|
230
|
-
- sample_apps/sample_app_activerecord/Gemfile
|
231
|
-
- sample_apps/sample_app_activerecord/Procfile
|
232
|
-
- sample_apps/sample_app_activerecord/README.md
|
233
|
-
- sample_apps/sample_app_activerecord/Rakefile
|
234
|
-
- sample_apps/sample_app_activerecord/commands.rb
|
235
|
-
- sample_apps/sample_app_activerecord/commands/help.rb
|
236
|
-
- sample_apps/sample_app_activerecord/commands/whoami.rb
|
237
|
-
- sample_apps/sample_app_activerecord/config.ru
|
238
|
-
- sample_apps/sample_app_activerecord/config/newrelic.yml
|
239
|
-
- sample_apps/sample_app_activerecord/config/postgresql.yml
|
240
|
-
- sample_apps/sample_app_activerecord/db/migrate/20170307164946_create_teams_table.rb
|
241
|
-
- sample_apps/sample_app_activerecord/db/migrate/20190323181453_add_activated_fields.rb
|
242
|
-
- sample_apps/sample_app_activerecord/db/schema.rb
|
243
|
-
- sample_apps/sample_app_activerecord/spec/api/root_spec.rb
|
244
|
-
- sample_apps/sample_app_activerecord/spec/commands/help_spec.rb
|
245
|
-
- sample_apps/sample_app_activerecord/spec/commands/whoami_spec.rb
|
246
|
-
- sample_apps/sample_app_activerecord/spec/spec_helper.rb
|
247
|
-
- sample_apps/sample_app_mongoid/.rspec
|
248
|
-
- sample_apps/sample_app_mongoid/Gemfile
|
249
|
-
- sample_apps/sample_app_mongoid/Procfile
|
250
|
-
- sample_apps/sample_app_mongoid/README.md
|
251
|
-
- sample_apps/sample_app_mongoid/Rakefile
|
252
|
-
- sample_apps/sample_app_mongoid/commands.rb
|
253
|
-
- sample_apps/sample_app_mongoid/commands/help.rb
|
254
|
-
- sample_apps/sample_app_mongoid/commands/whoami.rb
|
255
|
-
- sample_apps/sample_app_mongoid/config.ru
|
256
|
-
- sample_apps/sample_app_mongoid/config/mongoid.yml
|
257
|
-
- sample_apps/sample_app_mongoid/config/newrelic.yml
|
258
|
-
- sample_apps/sample_app_mongoid/spec/api/root_spec.rb
|
259
|
-
- sample_apps/sample_app_mongoid/spec/commands/help_spec.rb
|
260
|
-
- sample_apps/sample_app_mongoid/spec/commands/whoami_spec.rb
|
261
|
-
- sample_apps/sample_app_mongoid/spec/spec_helper.rb
|
262
222
|
- script/console
|
263
223
|
- slack-ruby-bot-server.gemspec
|
264
224
|
- tasks/db.rake
|
data/images/slackbotserver.gif
DELETED
Binary file
|
data/images/slackbutton.gif
DELETED
Binary file
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module SlackRubyBot
|
2
|
-
module Commands
|
3
|
-
class Base
|
4
|
-
class << self
|
5
|
-
alias _invoke invoke
|
6
|
-
|
7
|
-
def invoke(client, data)
|
8
|
-
_invoke client, data
|
9
|
-
rescue StandardError => e
|
10
|
-
logger.info "#{name.demodulize.upcase}: #{client.owner}, #{e.class}: #{e}"
|
11
|
-
logger.debug e.backtrace.join("\n")
|
12
|
-
client.say(channel: data.channel, text: e.message)
|
13
|
-
true
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module SlackRubyBot
|
2
|
-
class Client
|
3
|
-
# keep track of the team that the client is connected to
|
4
|
-
attr_accessor :owner
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
SlackRubyBot::Client.logger.level = Logger::WARN
|
9
|
-
|
10
|
-
Slack::RealTime::Client.configure do |config|
|
11
|
-
config.store_class = Slack::RealTime::Stores::Starter
|
12
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative 'ext/slack-ruby-bot/client'
|
2
|
-
|
3
|
-
module SlackRubyBotServer
|
4
|
-
class Server < SlackRubyBot::Server
|
5
|
-
attr_accessor :team
|
6
|
-
|
7
|
-
def initialize(attrs = {})
|
8
|
-
attrs = attrs.dup
|
9
|
-
@team = attrs.delete(:team)
|
10
|
-
raise 'Missing team' unless @team
|
11
|
-
|
12
|
-
attrs[:token] = @team.token
|
13
|
-
super(attrs)
|
14
|
-
open!
|
15
|
-
end
|
16
|
-
|
17
|
-
def restart!(wait = 1)
|
18
|
-
# when an integration is disabled, a live socket is closed, which causes the default behavior of the client to restart
|
19
|
-
# it would keep retrying without checking for account_inactive or such, we want to restart via service which will disable an inactive team
|
20
|
-
logger.info "#{team.name}: socket closed, restarting ..."
|
21
|
-
SlackRubyBotServer::Service.instance.restart! team, self, wait
|
22
|
-
open!
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def open!
|
28
|
-
client.owner = team
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
data/sample_apps/README.md
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
To run samples, [register a new Slack app](https://api.slack.com/apps), configure a bot user, and OAuth redirect URL to http://localhost:9292 (for development). Configure your development environment by editing `.env` and setting the client ID and secret you were given during registration.
|
2
|
-
|
3
|
-
```
|
4
|
-
SLACK_CLIENT_ID=1111111111.2222222
|
5
|
-
SLACK_CLIENT_SECRET=abcdef012345679
|
6
|
-
PORT=9292
|
7
|
-
```
|
8
|
-
|
9
|
-
Run tests with `bundle exec rake`.
|
10
|
-
|
11
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'activerecord', '~> 5.0.0', require: 'active_record'
|
4
|
-
gem 'newrelic-slack-ruby-bot'
|
5
|
-
gem 'otr-activerecord', '~> 1.2.1'
|
6
|
-
gem 'pg'
|
7
|
-
gem 'rack-server-pages'
|
8
|
-
gem 'rack-test'
|
9
|
-
gem 'slack-ruby-bot-server', path: '../../'
|
10
|
-
gem 'unicorn'
|
11
|
-
|
12
|
-
group :development, :test do
|
13
|
-
gem 'standalone_migrations', '~> 5.2'
|
14
|
-
end
|
15
|
-
|
16
|
-
group :test do
|
17
|
-
gem 'database_cleaner'
|
18
|
-
gem 'fabrication'
|
19
|
-
gem 'faker'
|
20
|
-
gem 'rake'
|
21
|
-
gem 'rspec'
|
22
|
-
gem 'vcr'
|
23
|
-
gem 'webmock'
|
24
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
web: bundle exec unicorn -p $PORT
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler/setup'
|
3
|
-
|
4
|
-
require 'rspec/core'
|
5
|
-
require 'rspec/core/rake_task'
|
6
|
-
|
7
|
-
require 'standalone_migrations'
|
8
|
-
StandaloneMigrations::Tasks.load_tasks
|
9
|
-
|
10
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
11
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
12
|
-
end
|
13
|
-
|
14
|
-
task default: [:spec]
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class Help < SlackRubyBot::Commands::Base
|
2
|
-
HELP = <<-EOS.freeze
|
3
|
-
```
|
4
|
-
I am your friendly slack-ruby-bot-server, here to help.
|
5
|
-
|
6
|
-
General
|
7
|
-
-------
|
8
|
-
|
9
|
-
help - get this helpful message
|
10
|
-
whoami - print your username
|
11
|
-
|
12
|
-
```
|
13
|
-
EOS
|
14
|
-
def self.call(client, data, _match)
|
15
|
-
client.say(channel: data.channel, text: [HELP, SlackRubyBotServer::INFO].join("\n"))
|
16
|
-
client.say(channel: data.channel)
|
17
|
-
logger.info "HELP: #{client.owner}, user=#{data.user}"
|
18
|
-
end
|
19
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
ENV['RACK_ENV'] ||= 'development'
|
2
|
-
|
3
|
-
Bundler.require :default
|
4
|
-
|
5
|
-
require_relative 'commands'
|
6
|
-
require 'yaml'
|
7
|
-
require 'erb'
|
8
|
-
|
9
|
-
ActiveRecord::Base.establish_connection(
|
10
|
-
YAML.safe_load(
|
11
|
-
ERB.new(
|
12
|
-
File.read('config/postgresql.yml')
|
13
|
-
).result, [], [], true
|
14
|
-
)[ENV['RACK_ENV']]
|
15
|
-
)
|
16
|
-
|
17
|
-
NewRelic::Agent.manual_start
|
18
|
-
|
19
|
-
SlackRubyBotServer::App.instance.prepare!
|
20
|
-
SlackRubyBotServer::Service.start!
|
21
|
-
|
22
|
-
run SlackRubyBotServer::Api::Middleware.instance
|
@@ -1,217 +0,0 @@
|
|
1
|
-
# Here are the settings that are common to all environments
|
2
|
-
common: &default_settings
|
3
|
-
# ============================== LICENSE KEY ===============================
|
4
|
-
|
5
|
-
# You must specify the license key associated with your New Relic
|
6
|
-
# account. This key binds your Agent's data to your account in the
|
7
|
-
# New Relic service.
|
8
|
-
license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>'
|
9
|
-
|
10
|
-
# Application Name Set this to be the name of your application as
|
11
|
-
# you'd like it show up in New Relic. The service will then auto-map
|
12
|
-
# instances of your application into an "application" on your
|
13
|
-
# dashboard page. If you want to map this instance into multiple
|
14
|
-
# apps, like "AJAX Requests" and "All UI" then specify a semicolon
|
15
|
-
# separated list of up to three distinct names, or a yaml list.
|
16
|
-
app_name: <%= ENV["NEW_RELIC_APP_NAME"] || 'SlackRubyBotServer' %>
|
17
|
-
|
18
|
-
# When "true", the agent collects performance data about your
|
19
|
-
# application and reports this data to the New Relic service at
|
20
|
-
# newrelic.com. This global switch is normally overridden for each
|
21
|
-
# environment below. (formerly called 'enabled')
|
22
|
-
monitor_mode: true
|
23
|
-
|
24
|
-
# Developer mode should be off in every environment but
|
25
|
-
# development as it has very high overhead in memory.
|
26
|
-
developer_mode: false
|
27
|
-
|
28
|
-
# The newrelic agent generates its own log file to keep its logging
|
29
|
-
# information separate from that of your application. Specify its
|
30
|
-
# log level here.
|
31
|
-
log_level: info
|
32
|
-
|
33
|
-
# Optionally set the path to the log file This is expanded from the
|
34
|
-
# root directory (may be relative or absolute, e.g. 'log/' or
|
35
|
-
# '/var/log/') The agent will attempt to create this directory if it
|
36
|
-
# does not exist.
|
37
|
-
# log_file_path: 'log'
|
38
|
-
|
39
|
-
# Optionally set the name of the log file, defaults to 'newrelic_agent.log'
|
40
|
-
# log_file_name: 'newrelic_agent.log'
|
41
|
-
|
42
|
-
# The newrelic agent communicates with the service via http by
|
43
|
-
# default. If you want to communicate via https to increase
|
44
|
-
# security, then turn on SSL by setting this value to true. Note,
|
45
|
-
# this will result in increased CPU overhead to perform the
|
46
|
-
# encryption involved in SSL communication, but this work is done
|
47
|
-
# asynchronously to the threads that process your application code,
|
48
|
-
# so it should not impact response times.
|
49
|
-
ssl: false
|
50
|
-
|
51
|
-
# EXPERIMENTAL: enable verification of the SSL certificate sent by
|
52
|
-
# the server. This setting has no effect unless SSL is enabled
|
53
|
-
# above. This may block your application. Only enable it if the data
|
54
|
-
# you send us needs end-to-end verified certificates.
|
55
|
-
#
|
56
|
-
# This means we cannot cache the DNS lookup, so each request to the
|
57
|
-
# service will perform a lookup. It also means that we cannot
|
58
|
-
# use a non-blocking lookup, so in a worst case, if you have DNS
|
59
|
-
# problems, your app may block indefinitely.
|
60
|
-
# verify_certificate: true
|
61
|
-
|
62
|
-
# Set your application's Apdex threshold value with the 'apdex_t'
|
63
|
-
# setting, in seconds. The apdex_t value determines the buckets used
|
64
|
-
# to compute your overall Apdex score.
|
65
|
-
# Requests that take less than apdex_t seconds to process will be
|
66
|
-
# classified as Satisfying transactions; more than apdex_t seconds
|
67
|
-
# as Tolerating transactions; and more than four times the apdex_t
|
68
|
-
# value as Frustrating transactions.
|
69
|
-
# For more about the Apdex standard, see
|
70
|
-
# http://newrelic.com/docs/general/apdex
|
71
|
-
|
72
|
-
apdex_t: 0.5
|
73
|
-
|
74
|
-
#============================== Browser Monitoring ===============================
|
75
|
-
# New Relic Real User Monitoring gives you insight into the performance real users are
|
76
|
-
# experiencing with your website. This is accomplished by measuring the time it takes for
|
77
|
-
# your users' browsers to download and render your web pages by injecting a small amount
|
78
|
-
# of JavaScript code into the header and footer of each page.
|
79
|
-
browser_monitoring:
|
80
|
-
# By default the agent automatically injects the monitoring JavaScript
|
81
|
-
# into web pages. Set this attribute to false to turn off this behavior.
|
82
|
-
auto_instrument: true
|
83
|
-
|
84
|
-
# Proxy settings for connecting to the service.
|
85
|
-
#
|
86
|
-
# If a proxy is used, the host setting is required. Other settings
|
87
|
-
# are optional. Default port is 8080.
|
88
|
-
#
|
89
|
-
# proxy_host: hostname
|
90
|
-
# proxy_port: 8080
|
91
|
-
# proxy_user:
|
92
|
-
# proxy_pass:
|
93
|
-
|
94
|
-
|
95
|
-
# Tells transaction tracer and error collector (when enabled)
|
96
|
-
# whether or not to capture HTTP params. When true, frameworks can
|
97
|
-
# exclude HTTP parameters from being captured.
|
98
|
-
# Rails: the RoR filter_parameter_logging excludes parameters
|
99
|
-
# Java: create a config setting called "ignored_params" and set it to
|
100
|
-
# a comma separated list of HTTP parameter names.
|
101
|
-
# ex: ignored_params: credit_card, ssn, password
|
102
|
-
capture_params: true
|
103
|
-
|
104
|
-
|
105
|
-
# Transaction tracer captures deep information about slow
|
106
|
-
# transactions and sends this to the service once a
|
107
|
-
# minute. Included in the transaction is the exact call sequence of
|
108
|
-
# the transactions including any SQL statements issued.
|
109
|
-
transaction_tracer:
|
110
|
-
|
111
|
-
# Transaction tracer is enabled by default. Set this to false to
|
112
|
-
# turn it off. This feature is only available at the Professional
|
113
|
-
# and above product levels.
|
114
|
-
enabled: true
|
115
|
-
|
116
|
-
# Threshold in seconds for when to collect a transaction
|
117
|
-
# trace. When the response time of a controller action exceeds
|
118
|
-
# this threshold, a transaction trace will be recorded and sent to
|
119
|
-
# the service. Valid values are any float value, or (default)
|
120
|
-
# "apdex_f", which will use the threshold for an dissatisfying
|
121
|
-
# Apdex controller action - four times the Apdex T value.
|
122
|
-
transaction_threshold: apdex_f
|
123
|
-
|
124
|
-
# When transaction tracer is on, SQL statements can optionally be
|
125
|
-
# recorded. The recorder has three modes, "off" which sends no
|
126
|
-
# SQL, "raw" which sends the SQL statement in its original form,
|
127
|
-
# and "obfuscated", which strips out numeric and string literals
|
128
|
-
record_sql: obfuscated
|
129
|
-
|
130
|
-
# Threshold in seconds for when to collect stack trace for a SQL
|
131
|
-
# call. In other words, when SQL statements exceed this threshold,
|
132
|
-
# then capture and send the current stack trace. This is
|
133
|
-
# helpful for pinpointing where long SQL calls originate from
|
134
|
-
stack_trace_threshold: 0.500
|
135
|
-
|
136
|
-
# Determines whether the agent will capture query plans for slow
|
137
|
-
# SQL queries. Only supported in mysql and postgres. Should be
|
138
|
-
# set to false when using other adapters.
|
139
|
-
# explain_enabled: true
|
140
|
-
|
141
|
-
# Threshold for query execution time below which query plans will not
|
142
|
-
# not be captured. Relevant only when `explain_enabled` is true.
|
143
|
-
# explain_threshold: 0.5
|
144
|
-
|
145
|
-
# Error collector captures information about uncaught exceptions and
|
146
|
-
# sends them to the service for viewing
|
147
|
-
error_collector:
|
148
|
-
|
149
|
-
# Error collector is enabled by default. Set this to false to turn
|
150
|
-
# it off. This feature is only available at the Professional and above
|
151
|
-
# product levels
|
152
|
-
enabled: true
|
153
|
-
|
154
|
-
# Rails Only - tells error collector whether or not to capture a
|
155
|
-
# source snippet around the place of the error when errors are View
|
156
|
-
# related.
|
157
|
-
capture_source: true
|
158
|
-
|
159
|
-
# To stop specific errors from reporting to New Relic, set this property
|
160
|
-
# to comma separated values. Default is to ignore routing errors
|
161
|
-
# which are how 404's get triggered.
|
162
|
-
#
|
163
|
-
ignore_errors: ActionController::RoutingError
|
164
|
-
|
165
|
-
# (Advanced) Uncomment this to ensure the cpu and memory samplers
|
166
|
-
# won't run. Useful when you are using the agent to monitor an
|
167
|
-
# external resource
|
168
|
-
# disable_samplers: true
|
169
|
-
|
170
|
-
# If you aren't interested in visibility in these areas, you can
|
171
|
-
# disable the instrumentation to reduce overhead.
|
172
|
-
#
|
173
|
-
# disable_view_instrumentation: true
|
174
|
-
# disable_activerecord_instrumentation: true
|
175
|
-
# disable_memcache_instrumentation: true
|
176
|
-
# disable_dj: true
|
177
|
-
|
178
|
-
# If you're interested in capturing memcache keys as though they
|
179
|
-
# were SQL uncomment this flag. Note that this does increase
|
180
|
-
# overhead slightly on every memcached call, and can have security
|
181
|
-
# implications if your memcached keys are sensitive
|
182
|
-
# capture_memcache_keys: true
|
183
|
-
|
184
|
-
# Certain types of instrumentation such as GC stats will not work if
|
185
|
-
# you are running multi-threaded. Please let us know.
|
186
|
-
# multi_threaded = false
|
187
|
-
|
188
|
-
# Application Environments
|
189
|
-
# ------------------------------------------
|
190
|
-
|
191
|
-
development:
|
192
|
-
<<: *default_settings
|
193
|
-
# Turn off communication to New Relic service in development mode (also
|
194
|
-
# 'enabled').
|
195
|
-
# NOTE: for initial evaluation purposes, you may want to temporarily
|
196
|
-
# turn the agent on in development mode.
|
197
|
-
monitor_mode: false
|
198
|
-
|
199
|
-
# Rails Only - when running in Developer Mode, the New Relic Agent will
|
200
|
-
# present performance information on the last 100 transactions you have
|
201
|
-
# executed since starting the mongrel.
|
202
|
-
# NOTE: There is substantial overhead when running in developer mode.
|
203
|
-
# Do not use for production or load testing.
|
204
|
-
developer_mode: true
|
205
|
-
|
206
|
-
# Enable textmate links
|
207
|
-
# textmate: true
|
208
|
-
|
209
|
-
test:
|
210
|
-
<<: *default_settings
|
211
|
-
# It almost never makes sense to turn on the agent when running
|
212
|
-
# unit, functional or integration tests or the like.
|
213
|
-
monitor_mode: false
|
214
|
-
|
215
|
-
production:
|
216
|
-
<<: *default_settings
|
217
|
-
monitor_mode: true
|