Skip to content

agent config

Mehrdad Arshad Rad edited this page Feb 6, 2021 · 3 revisions

Simple example

The below configuration exports the fields which defined under latency profile and print them out on the console once a TCP connection became close. you can check out other examples here.

tracepoints:
  - name: sock:inet_sock_set_state
    fields: latency
    tcp_state: TCP_CLOSE
    inet: [4,6]
    egress: console

fields:
  latency:
     - name: PID
     - name: Task
     - name: SAddr
     - name: RTT
     - name: TotalRetrans

egress:
  console:
    type: console
    config:
      output: stdout  

Define a tracepoint

tracepoints:
  - name: VALID_TCP_TRACEPOINT
    fields: FIELDS_PROFILE
    tcp_state: VALID_TCP_STATE
    sample: SAMPLING_RATE
    inet: [IP_VERSION]
    egress: EGRESS_PROFILE

Define a fields profile

fields:
  FIELDS_PROFILE_NAME:
     - name: VALID_FIELD_NAME
       math: OPTIONAL_MATH
       filter: OPTIONAL_FILTER

Define an egress profile

egress:
  EGRESS_PROFILE_NAME:
    type: VALID_EGRESS_TYPE
    config:
      VALID_CONFIG_KEY: VALID_CONFIG_VALUE

Valid TCP tracepoint

- sock:inet_sock_set_state
- tcp:tcp_retransmit_skb
- tcp:tcp_destroy_sock
- tcp:tcp_send_reset
- tcp:tcp_receive_reset
- tcp:tcp_probe

for more information I suggest you to check this post from Brendan Gregg's Blog.

Valid TCP states

- TCP_ESTABLISHED
- TCP_SYN_SENT
- TCP_SYN_RECV
- TCP_FIN_WAIT1
- TCP_FIN_WAIT2
- TCP_TIME_WAIT
- TCP_CLOSE
- TCP_CLOSE_WAIT
- TCP_ALL

Valid egress types

- grpc-pb : sending out the output to specific destination through gRPC protocol.
- grpc-spb : sending out the output to specific destination through gRPC protocol with structpb.
- kafka : producing the output to configured Kafka broker(s) through JSON or Protobuf or Struct Protobuf serialization. 
- console : printing out the output to the console.
- jsonl : storing the output to specific file with JSON Lines format.
- csv : storing the output to specific file with CSV format.

Kafka config (producer)

topic: TOPIC_NAME
brokers:
  - ADDRESS_PORT
serialization: json_OR_pb_OR_spb # default json
compression: gzip_OR_lz4_OR_snappy # default none
retryMax: MAX_RETRY #default 3
retryBackoff: BACKOFF_MS # default 250 milliseconds
workers: WORKER_NUMBER # default 2 in case of pb or spb serializations.
tlsConfig: TLS_CONFIGURATION # check TLS Config page.

TLS config