fluent-plugin-jfrog-metrics 0.2.12.2 → 0.2.13

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: 153623916b501853ef025525cefc4551ec8d5d329676ef05d3ad551407c3ab0b
4
+ data.tar.gz: 2b745e254c5c26595fdf613a86db2481043d9200d67e8992fd0916a70ea39148
5
5
  SHA512:
6
- metadata.gz: bcca22a3705f8d6c7b711748203ba7bd3ea06d9779b9dfe4082e1990a19af5d2ed74926e91150f624c9023b830209080594514459dc05ca9faf65c930a568713
7
- data.tar.gz: a218f823e45bf3ff3ac0674d1384c69342fb1e6bffd96ed3fc98b6fb8b3f8d1259af492632f1af7d80d0f0585741858adeedb02c0afb9faae3feae6ea17d28c7
6
+ metadata.gz: fede67bdc22edb80a3b0e70a6c88d11982bd42ea34e3b4f97e4cb5c515f8a1438bc05c6eea9ef4c25fb5dca4a5afba09728765e4a57fc4578fca58580f626830
7
+ data.tar.gz: 9a5200078dec8a016e424af221ad02c0708802f35dba1603ab5b1f415720657f20b0bce18ec78e27fd6313e9b9cac62e24d78b4f7ee644917fbe5b8f15c236aa
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.13)
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.13'
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,14 +1,14 @@
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.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - MahithaB, BenHarosh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-16 00:00:00.000000000 Z
11
+ date: 2024-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler