signalfx 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -6
- data/lib/signalfx.rb +17 -8
- data/lib/signalfx/conf.rb +1 -1
- data/lib/signalfx/json_signal_fx_client.rb +1 -1
- data/lib/signalfx/protobuf_signal_fx_client.rb +1 -1
- data/lib/signalfx/signal_fx_client.rb +10 -6
- data/lib/signalfx/version.rb +1 -1
- data/signalfx.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e95b59377f963bd7d58da66522048b421077cd
|
4
|
+
data.tar.gz: 300ab136c02605ccdf4c984be4d1d8978711868e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 146a8cdb0ff97ef3027f4a545051af579860a8a46cee893186f61d6e539774537fa3031317deb7f0127747ce4ce3f915bccd5149435636278d0f07d6113cccb3
|
7
|
+
data.tar.gz: d45317cab75adabb588f0b67c5048007e083ac8bc557fc5827b153c55f33dd535a40e37409c9ece1b553d4078ec30b9d8ed7d5d26e0a6adbb7d3a6e0adbdb685
|
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
signalfx (1.0.1)
|
5
5
|
protobuf (~> 3.5.1, >= 3.5.1)
|
6
|
-
rest-client (~>
|
6
|
+
rest-client (~> 2.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -27,7 +27,9 @@ GEM
|
|
27
27
|
i18n (0.7.0)
|
28
28
|
json (1.8.3)
|
29
29
|
middleware (0.1.0)
|
30
|
-
mime-types (
|
30
|
+
mime-types (3.1)
|
31
|
+
mime-types-data (~> 3.2015)
|
32
|
+
mime-types-data (3.2016.0521)
|
31
33
|
minitest (5.9.0)
|
32
34
|
netrc (0.11.0)
|
33
35
|
protobuf (3.5.5)
|
@@ -36,10 +38,10 @@ GEM
|
|
36
38
|
thor
|
37
39
|
thread_safe
|
38
40
|
rake (10.4.2)
|
39
|
-
rest-client (
|
41
|
+
rest-client (2.0.0)
|
40
42
|
http-cookie (>= 1.0.2, < 2.0)
|
41
|
-
mime-types (>= 1.16, <
|
42
|
-
netrc (~> 0.
|
43
|
+
mime-types (>= 1.16, < 4.0)
|
44
|
+
netrc (~> 0.8)
|
43
45
|
rspec (3.3.0)
|
44
46
|
rspec-core (~> 3.3.0)
|
45
47
|
rspec-expectations (~> 3.3.0)
|
@@ -83,4 +85,4 @@ DEPENDENCIES
|
|
83
85
|
webmock (~> 2.1)
|
84
86
|
|
85
87
|
BUNDLED WITH
|
86
|
-
1.
|
88
|
+
1.13.1
|
data/lib/signalfx.rb
CHANGED
@@ -20,21 +20,30 @@ module SignalFx
|
|
20
20
|
# @param timeout - number
|
21
21
|
# @param batch_size - number
|
22
22
|
# @param user_agents - array
|
23
|
-
def self.new(api_token,
|
24
|
-
|
25
|
-
|
23
|
+
def self.new(api_token,
|
24
|
+
enable_aws_unique_id: false,
|
25
|
+
ingest_endpoint: RbConfig::DEFAULT_INGEST_ENDPOINT,
|
26
|
+
timeout: RbConfig::DEFAULT_TIMEOUT,
|
27
|
+
batch_size: RbConfig::DEFAULT_BATCH_SIZE,
|
28
|
+
user_agents: [])
|
26
29
|
begin
|
27
30
|
require_relative './proto/signal_fx_protocol_buffers.pb'
|
28
|
-
ProtoBufSignalFx.new(api_token,
|
31
|
+
ProtoBufSignalFx.new(api_token,
|
32
|
+
enable_aws_unique_id: enable_aws_unique_id,
|
33
|
+
ingest_endpoint: ingest_endpoint,
|
29
34
|
timeout: timeout,
|
30
|
-
batch_size: batch_size,
|
35
|
+
batch_size: batch_size,
|
36
|
+
user_agents: user_agents)
|
31
37
|
|
32
38
|
rescue Exception => e
|
33
|
-
puts "Protocol Buffers not installed properly.
|
39
|
+
puts "Protocol Buffers not installed properly. Switching to JSON.
|
34
40
|
#{e}"
|
35
|
-
JsonSignalFx.new(api_token,
|
41
|
+
JsonSignalFx.new(api_token,
|
42
|
+
enable_aws_unique_id: enable_aws_unique_id,
|
43
|
+
ingest_endpoint: ingest_endpoint,
|
36
44
|
timeout: timeout,
|
37
|
-
batch_size: batch_size,
|
45
|
+
batch_size: batch_size,
|
46
|
+
user_agents: user_agents)
|
38
47
|
end
|
39
48
|
end
|
40
49
|
end
|
data/lib/signalfx/conf.rb
CHANGED
@@ -27,9 +27,12 @@ class SignalFxClient
|
|
27
27
|
|
28
28
|
$event_categories = EVENT_CATEGORIES
|
29
29
|
|
30
|
-
def initialize(api_token,
|
31
|
-
|
32
|
-
|
30
|
+
def initialize(api_token,
|
31
|
+
enable_aws_unique_id: false,
|
32
|
+
ingest_endpoint: RbConfig::DEFAULT_INGEST_ENDPOINT,
|
33
|
+
timeout: RbConfig::DEFAULT_TIMEOUT,
|
34
|
+
batch_size: RbConfig::DEFAULT_BATCH_SIZE,
|
35
|
+
user_agents: [])
|
33
36
|
|
34
37
|
@api_token = api_token
|
35
38
|
@ingest_endpoint = ingest_endpoint
|
@@ -152,7 +155,7 @@ class SignalFxClient
|
|
152
155
|
}
|
153
156
|
|
154
157
|
if @aws_unique_id
|
155
|
-
data[:dimensions][
|
158
|
+
data[:dimensions][RbConfig::AWS_UNIQUE_ID_DIMENSION_NAME] = @aws_unique_id
|
156
159
|
end
|
157
160
|
|
158
161
|
post(build_event(data), @ingest_endpoint, EVENT_ENDPOINT_SUFFIX)
|
@@ -222,7 +225,8 @@ class SignalFxClient
|
|
222
225
|
|
223
226
|
def retrieve_aws_unique_id(&block)
|
224
227
|
begin
|
225
|
-
RestClient::Request.execute(method: :get,
|
228
|
+
RestClient::Request.execute(method: :get,
|
229
|
+
url: RbConfig::AWS_UNIQUE_ID_URL,
|
226
230
|
timeout: 1) { |response|
|
227
231
|
case response.code
|
228
232
|
when 200
|
@@ -245,7 +249,7 @@ class SignalFxClient
|
|
245
249
|
if datapoint[:dimensions] == nil
|
246
250
|
datapoint[:dimensions] = []
|
247
251
|
end
|
248
|
-
datapoint[:dimensions] << {:key =>
|
252
|
+
datapoint[:dimensions] << {:key => RbConfig::AWS_UNIQUE_ID_DIMENSION_NAME, :value => @aws_unique_id}
|
249
253
|
end
|
250
254
|
|
251
255
|
add_to_queue(metric_type, datapoint)
|
data/lib/signalfx/version.rb
CHANGED
data/signalfx.gemspec
CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.3"
|
35
35
|
spec.add_development_dependency "webmock", "~> 2.1"
|
36
36
|
spec.add_dependency "protobuf", "~> 3.5.1", ">= 3.5.1"
|
37
|
-
spec.add_dependency "rest-client", "~>
|
37
|
+
spec.add_dependency "rest-client", "~> 2.0"
|
38
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signalfx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SignalFx, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '2.0'
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '2.0'
|
103
103
|
description: This is a programmatic interface in Ruby for SignalFx's metadata and
|
104
104
|
ingest APIs. It is meant to provide a base for communicating with SignalFx APIs
|
105
105
|
that can be easily leveraged by scripts and applications to interact with SignalFx
|