stackify-api-ruby 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/.gitignore +23 -0
- data/Gemfile.lock +5 -2
- data/README.md +2 -2
- data/lib/stackify/env_details.rb +6 -1
- data/lib/stackify/metrics/metrics_sender.rb +4 -1
- data/lib/stackify/version.rb +1 -1
- metadata +60 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d76d06d2286d2e881560f6a1c102259941c8cd87
|
4
|
+
data.tar.gz: 1e90698d40f9f1bf051e1c1586e43309050df0b0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6f8fe718a55a92f1a26756025d12a86ef84b34a252a2501dc933e31cba6305048a8d5749d0608ca35d9a33e5e37557bb46205d5a9e6bf15f08d04c912c098a2b
|
7
|
+
data.tar.gz: f7f6a860b6fd12bd14f8f9c414840d5d3a13f585292fe4adda65cd92464b52e3338ca92c1811c9709cb1b79cce9c24a72e8fa9d486d363ba02ea8e374d27d3f1
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore built gem files
|
11
|
+
/*.gem
|
12
|
+
|
13
|
+
# Ignore the default SQLite database.
|
14
|
+
/db/*.sqlite3
|
15
|
+
/db/*.sqlite3-journal
|
16
|
+
|
17
|
+
# Ignore all logfiles and tempfiles.
|
18
|
+
/log/*.log
|
19
|
+
/tmp
|
20
|
+
|
21
|
+
# Ignore IntelliJ files
|
22
|
+
/.idea
|
23
|
+
*.iml
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stackify-api-ruby (1.0.
|
4
|
+
stackify-api-ruby (1.0.8)
|
5
5
|
faraday (>= 0.8)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
faraday (0.9.
|
10
|
+
faraday (0.9.1)
|
11
11
|
multipart-post (>= 1.2, < 3)
|
12
12
|
multipart-post (2.0.0)
|
13
13
|
rake (0.9.6)
|
@@ -19,3 +19,6 @@ DEPENDENCIES
|
|
19
19
|
bundler (~> 1.6)
|
20
20
|
rake (~> 0)
|
21
21
|
stackify-api-ruby!
|
22
|
+
|
23
|
+
BUNDLED WITH
|
24
|
+
1.10.6
|
data/README.md
CHANGED
@@ -71,7 +71,7 @@ stackify-api-ruby starts with start of Rails. Every error, which occurs within y
|
|
71
71
|
|
72
72
|
If you want to redefine <b>logger</b>, you should add
|
73
73
|
|
74
|
-
config.logger = ::Stackify::LoggerProxy.new(ActiveSupport::Logger.new(
|
74
|
+
config.logger = ::Stackify::LoggerProxy.new(ActiveSupport::Logger.new(Rails.root.join('log', "#{Rails.env}.log")))
|
75
75
|
|
76
76
|
to your config/environments/%environment%. <b>Note:</b> in this case Stackify#config.log_level will affect entire system.
|
77
77
|
|
@@ -129,7 +129,7 @@ Note, "autoreport_last_value_if_nothing_reported" property has influence only on
|
|
129
129
|
If there are problems, you can enable internal logging of the stackify-api-ruby project. Uncomment out the config.logger and config.logger.level lines in the 'config/initializers/stackify.rb' file:
|
130
130
|
|
131
131
|
```
|
132
|
-
config.logger = Logger.new(
|
132
|
+
config.logger = Logger.new(Rails.root.join("log", "stackify.log"))
|
133
133
|
config.logger.level = Logger::DEBUG
|
134
134
|
```
|
135
135
|
|
data/lib/stackify/env_details.rb
CHANGED
@@ -6,6 +6,10 @@ module Stackify
|
|
6
6
|
include Singleton
|
7
7
|
attr_reader :request_details
|
8
8
|
|
9
|
+
@@masked_headers = %w(HTTP_AUTHORIZATION HTTP_COOKIE)
|
10
|
+
@@masked_value = 'X-MASKED-X'
|
11
|
+
|
12
|
+
|
9
13
|
def initialize
|
10
14
|
rails_info = defined?(Rails) ? Rails::Info.properties.to_h : nil
|
11
15
|
@info = rails_info || { 'Application root' => Dir.pwd, 'Environment' => 'development'}
|
@@ -77,7 +81,8 @@ module Stackify
|
|
77
81
|
end
|
78
82
|
|
79
83
|
def headers env
|
80
|
-
env.reject{ |k| !(k.start_with?'HTTP_') }
|
84
|
+
headers = env.reject{ |k| !(k.start_with?'HTTP_') }
|
85
|
+
headers.each_key { | key | headers[key] = @@masked_value if @@masked_headers.include?(key) }
|
81
86
|
end
|
82
87
|
|
83
88
|
def server_variables env
|
@@ -14,11 +14,14 @@ module Stackify::Metrics
|
|
14
14
|
def upload_metrics aggr_metrics
|
15
15
|
return true if aggr_metrics.nil? || aggr_metrics.length == 0
|
16
16
|
current_time = Stackify::Utils.rounded_current_time
|
17
|
+
device_id = Stackify::EnvDetails.instance.auth_info['DeviceID']
|
17
18
|
if Stackify.authorized?
|
18
19
|
records = []
|
19
20
|
aggr_metrics.each_pair do |_key, metric|
|
20
21
|
next if metric.sent || metric.occurred_utc.to_i >= current_time.to_i
|
21
|
-
|
22
|
+
record = Stackify::Metrics::MetricForSubmit.new(metric).to_h
|
23
|
+
record['ClientDeviceID'] = device_id if !device_id.nil?
|
24
|
+
records << record
|
22
25
|
metric.sent = true
|
23
26
|
end
|
24
27
|
if records.any?
|
data/lib/stackify/version.rb
CHANGED
metadata
CHANGED
@@ -1,58 +1,67 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackify-api-ruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Stackify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
version: "1.6"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
22
20
|
type: :development
|
23
|
-
version_requirements: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: rake
|
26
21
|
prerelease: false
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
32
34
|
type: :development
|
33
|
-
version_requirements: *id002
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: faraday
|
36
35
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
39
45
|
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version:
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.8'
|
42
48
|
type: :runtime
|
43
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.8'
|
44
55
|
description: Stackify Logs and Metrics API for Ruby
|
45
|
-
email:
|
56
|
+
email:
|
46
57
|
- support@stackify.com
|
47
58
|
executables: []
|
48
|
-
|
49
59
|
extensions: []
|
50
|
-
|
51
60
|
extra_rdoc_files: []
|
52
|
-
|
53
|
-
|
54
|
-
- .ruby-gemset
|
55
|
-
- .ruby-version
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".ruby-gemset"
|
64
|
+
- ".ruby-version"
|
56
65
|
- Gemfile
|
57
66
|
- Gemfile.lock
|
58
67
|
- README.md
|
@@ -98,30 +107,28 @@ files:
|
|
98
107
|
- spec/spec_helper.rb
|
99
108
|
- stackify-api-ruby.gemspec
|
100
109
|
homepage: http://www.stackify.com/
|
101
|
-
licenses:
|
110
|
+
licenses:
|
102
111
|
- Apache
|
103
112
|
metadata: {}
|
104
|
-
|
105
113
|
post_install_message:
|
106
114
|
rdoc_options: []
|
107
|
-
|
108
|
-
require_paths:
|
115
|
+
require_paths:
|
109
116
|
- lib
|
110
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
-
requirements:
|
112
|
-
-
|
113
|
-
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
119
127
|
requirements: []
|
120
|
-
|
121
128
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.4.
|
129
|
+
rubygems_version: 2.4.5.1
|
123
130
|
signing_key:
|
124
131
|
specification_version: 4
|
125
132
|
summary: Stackify API for Ruby
|
126
|
-
test_files:
|
133
|
+
test_files:
|
127
134
|
- spec/spec_helper.rb
|