Sha256: deb476afc99717b2596de01ccd8e4686d640bb77005649254dce43e810f8248b

Contents?: true

Size: 795 Bytes

Versions: 2

Compression:

Stored size: 795 Bytes

Contents

# Copyright (c) 2021 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

2 entries across 2 versions & 1 rubygems

Version Path
contrast-agent-4.14.1 lib/contrast/agent/telemetry_event.rb
contrast-agent-4.14.0 lib/contrast/agent/telemetry_event.rb