Class: StackifyRubyAPM::AgentBaseTransport Private

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/stackify_apm/transport/agent_base.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.

This class will take care of building a protobuf message.

Direct Known Subclasses

AgentHTTPClient, UnixSocketClient

Constant Summary

Constants included from Log

Log::PREFIX

Instance Method Summary collapse

Methods included from Log

#debug, #error, #fatal, #info, #log, #warn

Constructor Details

#initialize(config) ⇒ AgentBaseTransport

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.

Returns a new instance of AgentBaseTransport.



10
11
12
13
# File 'lib/stackify_apm/transport/agent_base.rb', line 10

def initialize(config)
  @config = config
  @transaction_serializers = Serializers::Transactions.new(config)
end

Instance Method Details

#build_message(transactions = []) ⇒ Object

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.

This method will build a group of Stackify::Traces from the protobuf objects. It accept Array of transactions.



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/stackify_apm/transport/agent_base.rb', line 17

def build_message(transactions = [])
  # convert transactions to protobuf
  traces = StackifyProtoBuf::Traces.new
  transactions.each do |transaction|
    # convert transaction to protobuf
    protobuf_transaction = @transaction_serializers.build_protobuf(@config, transaction)
    # add to traces array
    traces.traces.push(protobuf_transaction)
  end
  return traces
rescue StandardError => e
  debug "[AgentBaseTransport] build_message() exception: #{e.inspect}"
end

#post(_transactions = []) ⇒ Object

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.

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/stackify_apm/transport/agent_base.rb', line 31

def post(_transactions = [])
  raise NotImplementedError
end