Go Performance Profiler

Go Performance Profiler Extension

The Go Performance Profiler Extension can be used to enable the Go Performance Profiler, also known as pprof, for an Agent. It configures an HTTP server that exposes runtime profiling data in the format expected by the pprof visualization tool.

Configuration Table

ParameterTypeDefaultDescription
listen_addressstring127.0.0.1The IP address or hostname to bind the profiler to. Setting to 0.0.0.0 will listen to all network interfaces.
tcp_portint1777The TCP port to bind the profiler to.
block_profile_fractionfraction0The fraction of blocking events that are profiled, must be a number between 0 and 1. A value of zero will profile no blocking events.
mutex_profile_fractionfraction0The fraction of mutex contention events that are profiled, must be a number between 0 and 1. A value of zero will profile no mutex contention events
should_write_fileboolfalseIf true, the agent will write the CPU profile to a file on shutdown.
cpu_profile_file_namestring$OIQ_OTEL_COLLECTOR_HOME/observiq-otel-collector.pprofThe file name to write the CPU Profile. The default is observiq-otel-collector.pprof written in the Agent's home directory.

note

The CPU profile file is only written once the Agent has been stopped and the should_write_file parameter is set to true.

Example Configuration

Web Interface

observIQ docs - pprof Extension - image 1

Standalone Extension

yaml
1apiVersion: bindplane.observiq.com/v1
2kind: Extension
3metadata:
4  name: go-pprof
5spec:
6  type: pprof
7  parameters:
8    - name: listen_address
9      value: 127.0.0.1
10    - name: tcp_port
11      value: 1777
12    - name: block_profile_fraction
13      value: 0
14    - name: mutex_profile_fraction
15      value: 0
16    - name: should_write_file
17      value: true
18    - name: cpu_profile_file_name
19      value: $OIQ_OTEL_COLLECTOR_HOME/observiq-otel-collector.pprof

Configuration with Embedded Extension

yaml
1apiVersion: bindplane.observiq.com/v1
2kind: Configuration
3metadata:
4  id: linux-metrics
5  name: linux-metrics
6  labels:
7    platform: linux
8spec:
9  extensions:
10    - id: 01HKTMAPMRJEA1EYA4KC10NX5V
11      type: pprof
12      parameters:
13        - name: listen_address
14          value: 127.0.0.1
15        - name: tcp_port
16          value: 1777
17        - name: block_profile_fraction
18          value: 0
19        - name: mutex_profile_fraction
20          value: 0
21        - name: should_write_file
22          value: false
23        - name: cpu_profile_file_name
24          value: $OIQ_OTEL_COLLECTOR_HOME/observiq-otel-collector.pprof
25  selector:
26    matchLabels:
27      configuration: linux-metrics