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

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: 01dd0aba88ecd2c738d0a44cd8692c61544ab76472b7e92ca7d2bded0a8cf683
4
- data.tar.gz: 246352647868467d91d88dbe8cda0ce65ed411757f3d86e2fe1bcc9053391662
3
+ metadata.gz: 8c2bbb59536e88ef36eff1311469d0267502fda2055ccbb318998e2df934ce99
4
+ data.tar.gz: 8a0182402b0dc16a93abd622d678b0823e4e86d537f3a6fe1c25e8b0e6e74c83
5
5
  SHA512:
6
- metadata.gz: 8eab565fd17b0a554e12633860b0d8c87a0efdc61b423c19f8b1df80dd2d343169594f73d790efd247b3d4427ef66af293e57e4bc97b212822b77b9cd50c62b7
7
- data.tar.gz: 23a1a59d51b8bf2752770a25df3b2d4f7cf24000cfdc89a59dac1684398d49405614dc80c448ad97fcf6870c2b51991527f5b6a5779d283b8760de9117ea2243
6
+ metadata.gz: fa8f245c2ce2c67812610d0c4859646860813945beb5a3444bfb63f5e1d01d68dfef9e3e4b0b2aef7a493ab634dda0bf3f9262712aa61708263568f12fd1cecd
7
+ data.tar.gz: 21a5875ea3dcf360f99ae02a32949b36cd929342b6e6d8c1c8899d3fc2dbd5521e3152b7394c502a8cc4b4a177abf9e1046cffd2845930cbbd46f6cd707b38dd
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.5)
4
+ fluent-plugin-jfrog-send-metrics (0.1.6)
5
5
  fluentd (>= 0.14.10, < 2)
6
6
  rest-client (~> 2.1.0)
7
7
 
@@ -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.5"
6
+ spec.version = "0.1.6"
7
7
  spec.authors = ["MahithaB", "BenH"]
8
8
  spec.email = ["partner_support@jfrog.com"]
9
9
 
@@ -24,7 +24,7 @@ class DatadogMetrics
24
24
  return record
25
25
  end
26
26
 
27
- def send_metrics(ddtags, http_proxy, record)
27
+ def send_metrics(ddtags, record, http_proxy)
28
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"
@@ -44,23 +44,23 @@ class DatadogMetrics
44
44
  end
45
45
 
46
46
  begin
47
- response = RestClient::Request.new(
48
- method: :post,
49
- url: @url,
50
- payload: metrics_payload.to_json,
51
- headers: {params: {'Api-Key' => @apikey}}
52
- ).execute do |response, request, result|
47
+ response = RestClient::Request.new(
48
+ method: :post,
49
+ url: @url,
50
+ payload: metrics_data.to_json,
51
+ headers: {'DD-API-KEY': @apikey, content_type: :json }
52
+ ).execute do |response, request, result|
53
53
  case response.code
54
54
  when 202
55
55
  puts 'Metrics were successfully sent to DataDog'
56
56
  return response.body
57
57
  else
58
- puts "Cannot send metrics to DataDog. Received response code: %d" % [response&.code]
58
+ puts "Cannot send metrics to DataDog url: %s. Received response code: %d, Response body: %s" % [@url, response.code, response.body]
59
59
  end
60
60
  end
61
61
  rescue Net::HTTPClientException => e
62
62
  # Handle the HTTP client exception
63
- puts "An HTTP client error occurred when calling DataDog metrics: #{e.message}"
63
+ puts "An HTTP client error occurred when sending metrics to DataDog: #{e.message}"
64
64
  rescue StandardError => e
65
65
  # Handle any other exceptions
66
66
  puts "An error occurred when sending metrics to DataDog: #{e.message}"
@@ -39,7 +39,7 @@ class NewRelicMetrics
39
39
  puts 'Metrics were successfully sent to NewRelic'
40
40
  return response.body
41
41
  else
42
- puts "Cannot send metrics to NewRelic. Received response code: %d" % [response&.code]
42
+ puts "Cannot send metrics to NewRelic url: %s. Received response code: %d" % [@url, response&.code]
43
43
  end
44
44
  end
45
45
  rescue Net::HTTPClientException => e
@@ -48,7 +48,7 @@ module Fluent
48
48
  vendor.send_metrics(record, @http_proxy)
49
49
  elsif @target_platform == 'DATADOG'
50
50
  vendor = DatadogMetrics.new(@apikey, @url)
51
- vendor.send_metrics(@ddtags, @http_proxy, record)
51
+ vendor.send_metrics(@ddtags, record, @http_proxy)
52
52
  end
53
53
  end
54
54
  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.5
4
+ version: 0.1.6
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-16 00:00:00.000000000 Z
12
+ date: 2024-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler