ruby_for_grafana_loki 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '008364bfc6b1bf0553546183972f87eb93794364317f2cc6a56b944c14a4deb8'
4
- data.tar.gz: 00affa1f6564765b4ad1211e1c3efdae57e2e7c7202f9049e75c572772d237ec
3
+ metadata.gz: 585c4f7f187bc40f31942698a8f46c0dd4ed0939ca47c4e692d5ed53b3e712cc
4
+ data.tar.gz: 29ce38884eb75cc9046b55767256eb999cafc6585606df8de8b620a0962ee891
5
5
  SHA512:
6
- metadata.gz: af9ed24b5ba9981b6cf927928779e33b8e0129a72280acdbc673f712cd33e4c3a98292204abaf7881897635e897b459d61ba024a98cee2a9e0d2df78ec1f3d3d
7
- data.tar.gz: d67fd43f8db4dce356f9bbcf65c6da681b330b9d8ca140aea08ccf78a30b13875c00ce0655328c41bcb8f2bd00ab3c80d704e18ead795934235c09ffe02c15aa
6
+ metadata.gz: 00ea45cbd679c2a9c5388f5935b03eb7b61bf7b8a92c06e5c8d653d854da9b71803837dd91721a5fc9455e81c33607e8a661b55ac9678fdd571bd70d8bf13258
7
+ data.tar.gz: 9beda2ef7e96973cda525d86378213f0d92584596c920e99985779a1e14acc74852a8a33b89fd90204082b490fcf554d59a6d52c7eaf89832f7140ddeb3e2d7e
@@ -1,5 +1,6 @@
1
1
  module RubyForGrafanaLoki
2
2
  LOGS_TYPE = %w(ERROR WARN FATAL INFO DEBUG).freeze
3
+
3
4
  class Client
4
5
  include RubyForGrafanaLoki::Request
5
6
 
@@ -10,9 +11,9 @@ module RubyForGrafanaLoki
10
11
  def initialize(log_file_path, allowed_logs_type = LOGS_TYPE)
11
12
  @log_file_path = log_file_path
12
13
  @allowed_logs_type = allowed_logs_type
13
- @job_name = "job_name"
14
- @host_name = "host_name"
15
- @source_name = "source_name"
14
+ @job_name = "job name"
15
+ @host_name = "host name"
16
+ @source_name = "source name"
16
17
  end
17
18
 
18
19
  def send_all_logs
@@ -53,8 +54,6 @@ module RubyForGrafanaLoki
53
54
  post(uri, json_payload)
54
55
  end
55
56
 
56
- private
57
-
58
57
  def match_logs_type?(log_line)
59
58
  type = log_line.match(/(ERROR|WARN|FATAL|INFO|DEBUG)/)&.to_s
60
59
 
@@ -18,7 +18,7 @@ module RubyForGrafanaLoki
18
18
 
19
19
  # Check if the request was successful
20
20
  if response.success?
21
- return JSON.parse(response.body)
21
+ JSON.parse(response.body)
22
22
  else
23
23
  raise "Failed to make POST request. Response code: #{response.status}, Response body: #{response.body}"
24
24
  end
@@ -30,7 +30,7 @@ module RubyForGrafanaLoki
30
30
  accept: 'application/json',
31
31
  'Content-Type' => 'application/json'
32
32
  }
33
- return {
33
+ {
34
34
  url: BASE_URL,
35
35
  headers: headers
36
36
  }
@@ -1,3 +1,3 @@
1
1
  module RubyForGrafanaLoki
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_for_grafana_loki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Ten
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-06 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: Attempt to make gem
55
+ description: Send logs to Grafana Loki
56
56
  email:
57
57
  - tennet0505@gmail.com
58
58
  executables: []