fluent-plugin-jfrog-send-metrics 0.1.10 → 0.1.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dba18a765b27f3db29659ae09f1a1ef75b070c67cbe7a29592377da5356d71f8
4
- data.tar.gz: 2d2da3f01f7ea0edd77a401326514cc564489d7b879d7d54c9044f00300cb29b
3
+ metadata.gz: c85fc37f7c250b2960214bf2cc9a127b33df5b5e1ccdd607fc6e234546893c47
4
+ data.tar.gz: d60d4162c6d4f18d4883a9db57bf99f7f54b39ce5ebd2e6194b7b9ae236178e2
5
5
  SHA512:
6
- metadata.gz: 2b7e3f13368de75df746fc76270933ff705284b9eb6b77eaf4a7ad62a3fb50acbfc0309638cbb4798610202aba38d0bc12cd97f6221bc164668952b8f00594ae
7
- data.tar.gz: 4d0c1a771da41f45fc8924ca9e25caf94d081ea0080c3611151f4c425a792846af9ec1c8a8bd329ee4cf5caf1ae42f5bc67d90a257cf32f6ea274c72ff7b8bec
6
+ metadata.gz: 98dcfb384ba3dbb9e2b29bfb469f5dedacd404a0aab5a16dbc58a003ab5c9b9990ac3e638ad27d530b815065ad4c18945852d70edae70a1a7459919ac1d6a460
7
+ data.tar.gz: 9b7e008c4c98afe1d38bc1e7b3323fc87f6b2b1ce940709d14d49e6643924c490cbe86e312f0f42f187505494ca1c55b14ea0cd92aec7b95c1fd34cb1733a11e
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-jfrog-send-metrics (0.1.10)
4
+ fluent-plugin-jfrog-send-metrics (0.1.10.1)
5
5
  fluentd (>= 0.14.10, < 2)
6
- rest-client (>= 2.1.0)
6
+ rest-client (~> 2.1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-jfrog-send-metrics"
6
- spec.version = "0.1.10"
6
+ spec.version = "0.1.10.1"
7
7
  spec.authors = ["MahithaB", "BenH"]
8
8
  spec.email = ["partner_support@jfrog.com"]
9
9
 
@@ -28,22 +28,22 @@ class DatadogMetrics
28
28
 
29
29
  def send_metrics(ddtags, record, http_proxy, verify_ssl, request_timeout, gzip_compression, logger)
30
30
  # Get the current local timestamp
31
- logger.info("#{Utility.get_time} Additional tags to be added to metrics are:", ddtags)
31
+ logger.info("Additional tags to be added to metrics are:", ddtags)
32
32
  metrics_data = add_custom_data(ddtags, record)
33
- logger.info("#{Utility.get_time} Sending received metrics data")
33
+ logger.info("Sending received metrics data")
34
34
 
35
35
  if http_proxy
36
36
  RestClient.proxy = URI.parse(http_proxy)
37
- logger.info("#{Utility.get_time} Using http_proxy param to set proxy for request. Proxy url: #{RestClient.proxy}")
37
+ logger.info("Using http_proxy param to set proxy for request. Proxy url: #{RestClient.proxy}")
38
38
  elsif ENV['HTTP_PROXY']
39
39
  RestClient.proxy = ENV['HTTP_PROXY']
40
- logger.info("#{Utility.get_time} Using 'HTTP_PROXY' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
40
+ logger.info("Using 'HTTP_PROXY' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
41
41
  elsif ENV['http_proxy']
42
42
  RestClient.proxy = ENV['http_proxy']
43
- logger.info("#{Utility.get_time} Using 'http_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
43
+ logger.info("Using 'http_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
44
44
  elsif ENV['https_proxy']
45
45
  RestClient.proxy = ENV['https_proxy']
46
- logger.info("#{Utility.get_time} Using 'https_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
46
+ logger.info("Using 'https_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
47
47
  end
48
48
 
49
49
  headers = {
@@ -53,7 +53,7 @@ class DatadogMetrics
53
53
 
54
54
  payload = metrics_data.to_json
55
55
  if gzip_compression
56
- payload = Utility.compress_payload(metrics_data)
56
+ payload = Utility.compress_payload(metrics_data, logger)
57
57
  headers[:'Content-Encoding'] = 'gzip'
58
58
  end
59
59
 
@@ -69,10 +69,10 @@ class DatadogMetrics
69
69
  request.execute do |response, request, result|
70
70
  case response.code
71
71
  when 202
72
- logger.info("#{Utility.get_time} Metrics were successfully sent to DataDog")
72
+ logger.info("Metrics were successfully sent to DataDog")
73
73
  return response.body
74
74
  else
75
- logger.info("#{Utility.get_time} Cannot send metrics to DataDog url: %s. Received response code: %d, Response body: %s" % [@url, response.code, response.body])
75
+ logger.info("Cannot send metrics to DataDog url: %s. Received response code: %d, Response body: %s" % [@url, response.code, response.body])
76
76
  end
77
77
  end
78
78
  end
@@ -11,22 +11,22 @@ class NewRelicMetrics
11
11
  end
12
12
 
13
13
  def send_metrics(metrics_data, http_proxy, verify_ssl, request_timeout, gzip_compression, logger)
14
- logger.info("#{Utility.get_time} Sending received metrics data")
14
+ logger.info("Sending received metrics data")
15
15
  metrics_payload = []
16
16
  metrics_payload.push(JSON.parse(metrics_data.to_json))
17
17
 
18
18
  if http_proxy
19
19
  RestClient.proxy = URI.parse(http_proxy)
20
- logger.info("#{Utility.get_time} Using http_proxy param to set proxy for request. Proxy url: #{RestClient.proxy}")
20
+ logger.info("Using http_proxy param to set proxy for request. Proxy url: #{RestClient.proxy}")
21
21
  elsif ENV['HTTP_PROXY']
22
22
  RestClient.proxy = ENV['HTTP_PROXY']
23
- logger.info("#{Utility.get_time} Using 'HTTP_PROXY' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
23
+ logger.info("Using 'HTTP_PROXY' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
24
24
  elsif ENV['http_proxy']
25
25
  RestClient.proxy = ENV['http_proxy']
26
- logger.info("#{Utility.get_time} Using 'http_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
26
+ logger.info("Using 'http_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
27
27
  elsif ENV['https_proxy']
28
28
  RestClient.proxy = ENV['https_proxy']
29
- logger.info("#{Utility.get_time} Using 'https_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
29
+ logger.info("Using 'https_proxy' environment variable to set proxy for request. Proxy url: #{RestClient.proxy}")
30
30
  end
31
31
 
32
32
  headers = {
@@ -34,7 +34,7 @@ class NewRelicMetrics
34
34
  }
35
35
  payload = metrics_payload.to_json
36
36
  if gzip_compression
37
- payload = Utility.compress_payload(metrics_payload)
37
+ payload = Utility.compress_payload(metrics_payload, logger)
38
38
  headers[:'Content-Encoding'] = 'gzip'
39
39
  end
40
40
 
@@ -50,10 +50,10 @@ class NewRelicMetrics
50
50
  request.execute do |response, request, result|
51
51
  case response.code
52
52
  when 202
53
- logger.info("#{Utility.get_time} Metrics were successfully sent to NewRelic")
53
+ logger.info("Metrics were successfully sent to NewRelic")
54
54
  return response.body
55
55
  else
56
- logger.info("#{Utility.get_time} Cannot send metrics to NewRelic url: %s. Received response code: %d, Response body: %s" % [@url, response.code, response.body])
56
+ logger.info("Cannot send metrics to NewRelic url: %s. Received response code: %d, Response body: %s" % [@url, response.code, response.body])
57
57
  end
58
58
  end
59
59
  end
@@ -1,8 +1,8 @@
1
1
  require 'zlib'
2
2
 
3
3
  class Utility
4
- def self.compress_payload(payload)
5
- puts "#{self.get_time} Compressing metrics payload"
4
+ def self.compress_payload(payload, logger)
5
+ logger.info("Compressing metrics payload")
6
6
  json_payload = payload.to_json
7
7
 
8
8
  # Compress the JSON string using zlib's GzipWriter
@@ -18,14 +18,9 @@ class Utility
18
18
  # convert the compressed data to a string
19
19
  compressed_data = compressed_payload.string
20
20
 
21
- puts "#{self.get_time} Original metrics payload size: #{json_payload.bytesize} bytes"
22
- puts "#{self.get_time} Compressed metrics payload size: #{compressed_data.bytesize} bytes"
21
+ logger.info("Original metrics payload size: #{json_payload.bytesize} bytes")
22
+ logger.info("Compressed metrics payload size: #{compressed_data.bytesize} bytes")
23
23
 
24
24
  return compressed_data
25
25
  end
26
-
27
- def self.get_time()
28
- return Time.now.strftime("%Y-%m-%d %H:%M:%S")
29
- end
30
-
31
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-jfrog-send-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - MahithaB