fluent-plugin-jfrog-metrics 0.2.12.2 → 0.2.12.3

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: 38cfa0bcb5a231e76d279f77fcc986f593d0b3419a382db75b7fbbced8462afd
4
- data.tar.gz: 569d77cf394b138961124c823e90672d941e1c207acdfcf2eb682632d29b5e05
3
+ metadata.gz: 8b4d1c7705dae2a6fb816d3aef9e5372648b533a809b9a967bf1f94c024b20e8
4
+ data.tar.gz: 6a84d71c12bd89350b51608c738aa30d9f9e86e430213d8f8486ba51c9f12a63
5
5
  SHA512:
6
- metadata.gz: bcca22a3705f8d6c7b711748203ba7bd3ea06d9779b9dfe4082e1990a19af5d2ed74926e91150f624c9023b830209080594514459dc05ca9faf65c930a568713
7
- data.tar.gz: a218f823e45bf3ff3ac0674d1384c69342fb1e6bffd96ed3fc98b6fb8b3f8d1259af492632f1af7d80d0f0585741858adeedb02c0afb9faae3feae6ea17d28c7
6
+ metadata.gz: f4ddb5c65a5760460f48ca17e32fe6ae07a8190ea5020bd5e82ba408902d21d1e0d46728ebdadbe2f26140ab36309e20e6d06f2c47c7b174bd0a105e20ceaa36
7
+ data.tar.gz: 3ca8608a7f5e675b435cf650998e6907f733ce77b14154a9ac5cc1764a316a22ff0ed6ec52a6ceb5951e362467bc4f004d45b0dd851730d0af2c3b04c5b1fa9a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-jfrog-metrics (0.2.12.2)
4
+ fluent-plugin-jfrog-metrics (0.2.12.3)
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-metrics'
6
- spec.version = '0.2.12.2'
6
+ spec.version = '0.2.12.3'
7
7
  spec.authors = ['MahithaB, BenHarosh']
8
8
  spec.email = ['cpe-support@jfrog.com']
9
9
 
@@ -108,6 +108,10 @@ module Fluent
108
108
  metrics_helper = MetricsHelper.new($logger, @metric_prefix, @jpd_url, @username, @apikey, @token, @common_jpd, @verify_ssl, @request_timeout)
109
109
  platform_metrics = metrics_helper.get_metrics
110
110
 
111
+ if platform_metrics.nil?
112
+ raise "Error while fetching platform metrics. Metrics response was null"
113
+ end
114
+
111
115
  additional_metrics = metrics_helper.get_additional_metrics
112
116
  if !additional_metrics.nil? && additional_metrics != ''
113
117
  platform_metrics += additional_metrics.to_s
@@ -30,12 +30,14 @@ class MetricsHelper
30
30
  end
31
31
 
32
32
  @logger.info("Executing #{@metric_prefix} metrics collection from: #{url}")
33
+ metrics = nil
33
34
  if !@token.nil? && @token != ''
34
- execute_rest_call(url, @username, nil, @token, true, @verify_ssl, @request_timeout)
35
+ metrics = execute_rest_call(url, @username, nil, @token, true, @verify_ssl, @request_timeout)
35
36
  elsif !@apikey.nil? && @apikey != ''
36
- execute_rest_call(url, @username, @apikey, nil, false, @verify_ssl, @request_timeout)
37
+ metrics = execute_rest_call(url, @username, @apikey, nil, false, @verify_ssl, @request_timeout)
37
38
  end
38
39
  @logger.debug("Get metrics finished")
40
+ return metrics
39
41
  end
40
42
 
41
43
  def get_additional_metrics
@@ -44,9 +46,10 @@ class MetricsHelper
44
46
  url = "#{@jpd_url}/observability/api/v1/metrics"
45
47
  @logger.info("Collecting additional metrics from: #{url}")
46
48
  check_endpoint(url, @token, @verify_ssl, @request_timeout) if @@obs_endpoint_exists == nil? || !@@obs_endpoint_exists
47
- execute_rest_call(url, @username, nil, @token, true, @verify_ssl, @request_timeout) if @@obs_endpoint_exists
49
+ additional_metrics = execute_rest_call(url, @username, nil, @token, true, @verify_ssl, @request_timeout) if @@obs_endpoint_exists
48
50
  end
49
51
  @logger.info("Aadditional metrics collection finished")
52
+ return additional_metrics
50
53
  end
51
54
 
52
55
  def check_endpoint(url, token, verify_ssl, request_timeout)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-jfrog-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12.2
4
+ version: 0.2.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MahithaB, BenHarosh