deployagram-racecar 0.1.0

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +14 -0
  3. data/README.md +8 -0
  4. data/lib/deployagram/racecar.rb +25 -0
  5. metadata +61 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c39ff9a1f8aa32cee20587a1d9cdc0ad10c44c0581a7cb1a5fe99bc72d6dee39
4
+ data.tar.gz: 2d43e7eaff2ffb653f9c12e087af847f1513c04ac20a289013c47d4c0d93613c
5
+ SHA512:
6
+ metadata.gz: 9f774be34076da9b6cc26a5f7b155cb00d0b29b9eaceb35053209bc7e43181d180de1308864901ccdb810bd5da06e0c24026aa49ad867989aa607465a581cf28
7
+ data.tar.gz: f35d0c8c123e92b5cdf72ff097f4f654fdc12ead2a5765f485b717bbc4632de33ba891679c7841cc208bc40118f324dd94c530e34d05a6104a0f13e2422c3834
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ DEPLOYAGRAM PROPRIETARY LICENSE
2
+
3
+ Copyright (c) 2025 Deployagram, Cookiebit and Andy Muir.
4
+
5
+ Permission is hereby granted to use this software solely for its intended purpose.
6
+
7
+ RESTRICTIONS:
8
+ - No modification of the software is permitted
9
+ - No reverse engineering, decompilation, or disassembly
10
+ - No redistribution without explicit written permission
11
+ - Source code remains proprietary and confidential
12
+ - Usage is limited to the compiled npm package (the distributed tarball) artifact only
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
data/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # deployagram-racecar
2
+
3
+ Records the Kafka records a Racecar consumer reads, to the Deployagram Collector. A Racecar instrumenter: it reports each
4
+ record when Racecar starts processing it, before the consumer runs. Requires the `racecar` gem in the application.
5
+
6
+ Depends on: `deployagram-kafka`.
7
+
8
+ Part of the Deployagram Ruby packages. See `../../README.md`.
@@ -0,0 +1,25 @@
1
+ require "deployagram/kafka"
2
+
3
+ module Deployagram
4
+ # Records the Kafka records that a Racecar consumer reads, from Racecar's instrumentation. Racecar publishes
5
+ # "start_process_message" before the consumer's process method runs, with the record's topic, partition and offset.
6
+ # The recorder reports the record then, so the Collector shows the read before the consumer's HTTP calls, as the Java
7
+ # and Node recorders do. Pass an instance as Racecar's instrumenter.
8
+ class Racecar
9
+ EVENT = "start_process_message".freeze
10
+
11
+ def initialize(logger, consuming_app:)
12
+ @logger = logger
13
+ @consuming_app = consuming_app
14
+ end
15
+
16
+ # Racecar calls instrument(name, payload) and, for some events, with a block that does the work.
17
+ def instrument(name, payload = {}, &block)
18
+ if name == EVENT
19
+ Kafka.record_consumed(@logger, consuming_app: @consuming_app, topic: payload.fetch(:topic),
20
+ partition: payload.fetch(:partition), offset: payload.fetch(:offset))
21
+ end
22
+ block ? block.call : nil
23
+ end
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: deployagram-racecar
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Deployagram
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: deployagram-kafka
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ -
17
+ - "="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ -
25
+ - "="
26
+ - !ruby/object:Gem::Version
27
+ version: 0.1.0
28
+ description: A Racecar instrumenter that reports each consumed record before the consumer processes it. Requires the racecar gem in the application.
29
+ email:
30
+ - andy@deployagram.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - LICENSE
36
+ - README.md
37
+ - lib/deployagram/racecar.rb
38
+ licenses:
39
+ - SEE LICENSE IN LICENSE
40
+ metadata:
41
+ rubygems_mfa_required: "true"
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ -
48
+ - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "3.2"
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ -
54
+ - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ requirements: []
58
+ rubygems_version: 4.1.0
59
+ specification_version: 4
60
+ summary: "Records the Kafka records a Racecar consumer reads, to the Deployagram Collector"
61
+ test_files: []