Class: Datadog::SymbolDatabase::ServiceVersion Private
- Inherits:
-
Object
- Object
- Datadog::SymbolDatabase::ServiceVersion
- Defined in:
- lib/datadog/symbol_database/service_version.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Top-level container wrapping scopes for upload to the agent.
ServiceVersion is the root object serialized to JSON for symbol database uploads. Contains service metadata (name, env, version) and all extracted scopes. The language field identifies the tracer.
Created by: Uploader (wraps scopes array before serialization) Contains: Array of top-level Scope objects (FILE scopes) Serialized to: JSON via to_json, then GZIP compressed for upload
Instance Attribute Summary collapse
- #batch_num ⇒ Object readonly private
- #env ⇒ Object readonly private
- #final ⇒ Object readonly private
- #language ⇒ Object readonly private
- #scopes ⇒ Object readonly private
- #service ⇒ Object readonly private
- #upload_id ⇒ Object readonly private
- #version ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(service:, env:, version:, scopes:, upload_id: nil, batch_num: nil, final: nil) ⇒ ServiceVersion
constructor
private
Initialize a new ServiceVersion.
-
#to_h ⇒ Hash
private
Convert service version to Hash for JSON serialization.
-
#to_json(_state = nil) ⇒ String
private
Serialize service version to JSON.
Constructor Details
#initialize(service:, env:, version:, scopes:, upload_id: nil, batch_num: nil, final: nil) ⇒ ServiceVersion
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a new ServiceVersion
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/datadog/symbol_database/service_version.rb', line 30 def initialize(service:, env:, version:, scopes:, upload_id: nil, batch_num: nil, final: nil) raise ArgumentError, "service is required" if service.nil? || service.empty? raise ArgumentError, "scopes must be an array" unless scopes.is_a?(Array) @service = service @env = env @version = version @language = "ruby" @scopes = scopes @upload_id = upload_id @batch_num = batch_num @final = final end |
Instance Attribute Details
#batch_num ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def batch_num @batch_num end |
#env ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def env @env end |
#final ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def final @final end |
#language ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def language @language end |
#scopes ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def scopes @scopes end |
#service ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def service @service end |
#upload_id ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def upload_id @upload_id end |
#version ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/datadog/symbol_database/service_version.rb', line 19 def version @version end |
Instance Method Details
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert service version to Hash for JSON serialization.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/datadog/symbol_database/service_version.rb', line 46 def to_h { service: service, env: env, version: version, language: language, scopes: scopes.map(&:to_h), upload_id: upload_id, batch_num: batch_num, final: final, } end |
#to_json(_state = nil) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Serialize service version to JSON.
61 62 63 |
# File 'lib/datadog/symbol_database/service_version.rb', line 61 def to_json(_state = nil) JSON.generate(to_h) end |