Sha256: cbf668d779e02c3d3cedfa05a6ae27fe46f42f74de607bcaacbdae378cccfa9e

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/utils/metrics_hash'

module Contrast
  module Agent
    # This class will hold the basic information for a Telemetry Event
    class TelemetryEvent
      include Contrast::Utils

      attr_reader :timestamp, :tags

      def initialize
        @tags = MetricsHash.new(String)
        @timestamp = Time.now.iso8601
      end

      def path
        ''
      end

      def to_hash **_args
        {
            tags: @tags,
            timestamp: @timestamp,
            instance: Contrast::Agent::Telemetry.instance_id,
            application: Contrast::Agent::Telemetry.application_id
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contrast-agent-5.3.0 lib/contrast/agent/telemetry_event.rb
contrast-agent-5.2.0 lib/contrast/agent/telemetry_event.rb
contrast-agent-5.1.0 lib/contrast/agent/telemetry_event.rb
contrast-agent-5.0.0 lib/contrast/agent/telemetry_event.rb