fluent-plugin-jfrog-send-metrics 0.1.6 → 0.1.7

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: 8c2bbb59536e88ef36eff1311469d0267502fda2055ccbb318998e2df934ce99
4
- data.tar.gz: 8a0182402b0dc16a93abd622d678b0823e4e86d537f3a6fe1c25e8b0e6e74c83
3
+ metadata.gz: 156657150eee6dad8aa4df6dd50ac2e3faf3b881b9e2e21d56bb1a976b36ce67
4
+ data.tar.gz: 5d544ba0a9cd7ec28a195486a4b9c33e417b1856507e2623bbed556cf8dca305
5
5
  SHA512:
6
- metadata.gz: fa8f245c2ce2c67812610d0c4859646860813945beb5a3444bfb63f5e1d01d68dfef9e3e4b0b2aef7a493ab634dda0bf3f9262712aa61708263568f12fd1cecd
7
- data.tar.gz: 21a5875ea3dcf360f99ae02a32949b36cd929342b6e6d8c1c8899d3fc2dbd5521e3152b7394c502a8cc4b4a177abf9e1046cffd2845930cbbd46f6cd707b38dd
6
+ metadata.gz: ba4a3cacd19a5e5745b7daf3f6e5d99764295f803bd6535c130e74ef78afd67934c3e40cdabf753532143d6ff595089629254947424838372942f13d08b7563e
7
+ data.tar.gz: 0b95d910ab9bee0581411d0c883ad63d6de201bbd09b45a3703a73b66b0c9806b193dd65951f5708b5b2a71c5c6ccce7f4c4b7a0d2f19a9806ba2af009b86872
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-jfrog-send-metrics (0.1.6)
4
+ fluent-plugin-jfrog-send-metrics (0.1.7)
5
5
  fluentd (>= 0.14.10, < 2)
6
6
  rest-client (~> 2.1.0)
7
7
 
data/README.md CHANGED
@@ -79,6 +79,8 @@ Obtain respective authentication credentials for log-vendors
79
79
  * **apikey**(string)(required): APIKEY is the apikey of log-vendor for authentication(LicenseKey for NewRelic)
80
80
  * **url**(string)(required): Metrics url of the mertics-vendor (Metrics URL for NewRelic or DataDog)
81
81
  * **http_proxy**(string)(optional): Proxy server URL - which will proxy http/s calls to your observability vendor (DataDog/NewRelic)
82
+ * **verify_ssl** (true / false) (optional): This flag should be set as false in order to bypass client's ssl certificate verification. When false, sets ssl_opts['verify_ssl'] to OpenSSL::SSL::VERIFY_NONE. Otherwise, sets ssl_opts['verify_ssl'] to OpenSSL::SSL::VERIFY_PEER
83
+ * Default value: true
82
84
 
83
85
  ## Copyright
84
86
 
@@ -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.6"
6
+ spec.version = "0.1.7"
7
7
  spec.authors = ["MahithaB", "BenH"]
8
8
  spec.email = ["partner_support@jfrog.com"]
9
9
 
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "> 1.14"
24
24
  spec.add_development_dependency "rake", "~> 12.0"
25
25
  spec.add_development_dependency "test-unit", "~> 3.0"
26
- spec.add_development_dependency "rest-client", "~> 2.0"
26
+ spec.add_development_dependency "rest-client", "~> 2.1.0"
27
27
  spec.add_runtime_dependency "fluentd", [">= 0.14.10", "< 2"]
28
28
  spec.add_runtime_dependency "rest-client", "~> 2.1.0"
29
29
  end
@@ -24,8 +24,8 @@ class DatadogMetrics
24
24
  return record
25
25
  end
26
26
 
27
- def send_metrics(ddtags, record, http_proxy)
28
- puts "Additional tags to be added to metrics are", ddtags
27
+ def send_metrics(ddtags, record, http_proxy, verify_ssl)
28
+ puts "Additional tags to be added to metrics are:", ddtags
29
29
  metrics_data = add_custom_data(ddtags, record)
30
30
  puts "Sending received metrics data"
31
31
 
@@ -48,7 +48,8 @@ class DatadogMetrics
48
48
  method: :post,
49
49
  url: @url,
50
50
  payload: metrics_data.to_json,
51
- headers: {'DD-API-KEY': @apikey, content_type: :json }
51
+ headers: {'DD-API-KEY': @apikey, content_type: :json },
52
+ verify_ssl: verify_ssl
52
53
  ).execute do |response, request, result|
53
54
  case response.code
54
55
  when 202
@@ -8,7 +8,7 @@ class NewRelicMetrics
8
8
  @url = url
9
9
  end
10
10
 
11
- def send_metrics(metrics_data, http_proxy)
11
+ def send_metrics(metrics_data, http_proxy, verify_ssl)
12
12
  puts "Sending received metrics data"
13
13
  metrics_payload = []
14
14
  metrics_payload.push(JSON.parse(metrics_data.to_json))
@@ -32,14 +32,15 @@ class NewRelicMetrics
32
32
  method: :post,
33
33
  url: @url,
34
34
  payload: metrics_payload.to_json,
35
- headers: {params: {'Api-Key' => @apikey}}
35
+ headers: {params: {'Api-Key' => @apikey}},
36
+ verify_ssl: verify_ssl
36
37
  ).execute do |response, request, result|
37
38
  case response.code
38
39
  when 202
39
40
  puts 'Metrics were successfully sent to NewRelic'
40
41
  return response.body
41
42
  else
42
- puts "Cannot send metrics to NewRelic url: %s. Received response code: %d" % [@url, response&.code]
43
+ puts "Cannot send metrics to NewRelic url: %s. Received response code: %d, Response body: %s" % [@url, response.code, response.body]
43
44
  end
44
45
  end
45
46
  rescue Net::HTTPClientException => e
@@ -30,6 +30,7 @@ module Fluent
30
30
  config_param :url, :string, default: 'https://metric-api.newrelic.com/metric/v1'
31
31
  config_param :ddtags, :array, default: []
32
32
  config_param :http_proxy, :string, :default => nil
33
+ config_param :verify_ssl, :bool, default: true
33
34
 
34
35
  # `configure` is called before `start`.
35
36
  # 'conf' is a `Hash` that includes the configuration parameters.
@@ -45,10 +46,10 @@ module Fluent
45
46
  es.each do |time, record|
46
47
  if @target_platform == 'NEWRELIC'
47
48
  vendor = NewRelicMetrics.new(@apikey, @url)
48
- vendor.send_metrics(record, @http_proxy)
49
+ vendor.send_metrics(record, @http_proxy, @verify_ssl)
49
50
  elsif @target_platform == 'DATADOG'
50
51
  vendor = DatadogMetrics.new(@apikey, @url)
51
- vendor.send_metrics(@ddtags, record, @http_proxy)
52
+ vendor.send_metrics(@ddtags, record, @http_proxy, @verify_ssl)
52
53
  end
53
54
  end
54
55
  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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - MahithaB
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-08-20 00:00:00.000000000 Z
12
+ date: 2024-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '2.0'
62
+ version: 2.1.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '2.0'
69
+ version: 2.1.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: fluentd
72
72
  requirement: !ruby/object:Gem::Requirement