nexus_semantic_logger 1.2.0 → 1.3.0

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: 5fb3fba7b28b1b186a3e601dc9901c94acf9db07c5f40b2a4c2357104fcda507
4
- data.tar.gz: d32b561ab333d7240b4d752e3a3faffa1ad95102882644eb045224f3bb493f44
3
+ metadata.gz: 6d90e3661ba7e5c82b2e1777d465df8f88617a3ad8287f8d0b9bdd461f0729a6
4
+ data.tar.gz: 1217216fdf855b72558510e52a50f0308c10b3e07ccbc80369fb228f0fe51040
5
5
  SHA512:
6
- metadata.gz: 23af7bf651c2f48db0411ae861d36a81d652de9af6da5c275b04f66781d45657abecbf31521cb825a7977a90fa32dac3872f3fe47fc3ec07396928b717abb648
7
- data.tar.gz: 9523b13f81fb98da9712e0af779f3b59ff85ae7ba23269c3c2f2845ac91b2ec77674e4cf5985334c1445273d1f12f81dbdba6049d6270ccfb5a6ff454ec30136
6
+ metadata.gz: a4261cc18604aade1ebd48efcd2cbb680ee26da22c366bcb544c786d42bffdad1a57ec2249f53347f1bcb5dadd2b0c13ff20f8699a7e30131e1e85fb7f1d2244
7
+ data.tar.gz: f2ea77247cc5e769e1dc7706595b85dc62179ceef8d05f11d78904632cd6cb39c837d64e401e278edf52333a75552dc6de41634f8b6862ac26155d528de9397b
data/README.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  Configures a [semantic_logger](https://rubygems.org/gems/rails_semantic_logger) as required for NexusMods components.
4
4
 
5
+ ## Telemetry
6
+
7
+ As well as providing a semantic logger, this gem handles datadog telemetry associated with the logging approach:
8
+
9
+ * logs
10
+ * traces
11
+ * metrics
12
+ * statsd is automatically attached to datadog runtime metrics and may also be used for custom metrics.
13
+
14
+ ### Sending metrics
15
+
16
+ Ensure the metric name is in the format: `nexus.{component}.{major}.{minor}`
17
+
18
+ Where _major and minor_ are specific to the component logic e.g. `nexus.uploads.clamscan.pass`
19
+
20
+ For example, to increment a count:
21
+
22
+ ```
23
+ NexusSemanticLogger.metrics.increment('nexus.users.registration.complete')
24
+ ```
25
+
5
26
  # Local gem development
6
27
 
7
28
  Steps to run this gem from local sources in one the nexus 'staged build' rails components:
@@ -3,7 +3,8 @@ require 'singleton'
3
3
 
4
4
  module NexusSemanticLogger
5
5
  # Application wide location to get datadog objects.
6
- # Can be moved to its own gem in future, and there is scope to make the usage code even leaner.
6
+ # dogstatsd-ruby maintains its own queue and thread for flushing, so the client code should never create its
7
+ # own statsd instance.
7
8
  class DatadogSingleton
8
9
  include Singleton
9
10
  attr_accessor :statsd, :tags
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module NexusSemanticLogger
3
- # Leave this as 1.2.0 in order for CI process to replace with the tagged version.
4
- VERSION = '1.2.0'
3
+ # Leave this as 1.3.0 in order for CI process to replace with the tagged version.
4
+ VERSION = '1.3.0'
5
5
  end
@@ -6,4 +6,8 @@ require 'nexus_semantic_logger/datadog_singleton'
6
6
  require 'nexus_semantic_logger/datadog_tracer'
7
7
 
8
8
  module NexusSemanticLogger
9
+ # Get application wide object for sending metrics.
10
+ def metrics
11
+ DatadogSingleton.instance
12
+ end
9
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnathon Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-20 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.3.18
105
+ rubygems_version: 3.3.21
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: semantic_logger usage for nexus