Step 1: Configure the Collector's OTLP Endpoint

The pganalyze collector can receive logs over OTLP using the db_log_otel_server setting. If you’re using the Secret-based INI config from Initial Setup Step 3, add it to the section for your CNPG cluster:

[pganalyze]
api_key = your_pga_organization_api_key

[my-cluster]
db_host = my-cluster-rw
...
db_log_otel_server = 0.0.0.0:4318

If you configured the collector with extraEnv instead, add the equivalent LOG_OTEL_SERVER environment variable:

extraEnv:
  # ... your existing PGA_API_KEY, DB_HOST, etc.
  LOG_OTEL_SERVER: 0.0.0.0:4318

Either way, this starts an HTTP server inside the collector container, listening on the given port, that accepts OpenTelemetry log messages at /v1/logs. Use an unprivileged port (1024 and up) to avoid running the collector as root.

Expose it as a Kubernetes Service

Vector (deployed in the next step) needs a stable address to send logs to. The collector’s collector-values.yaml already includes a service block with the right name, port, and targetPort. Only create needs to change, since it defaults to false:

service:
  create: true # defaults to false in the chart — this is the line to change
  name: pganalyze-collector-otel-service
  type: ClusterIP
  port: 4318
  targetPort: 4318

Then apply it:

helm upgrade --install my-collector pganalyze/pganalyze-collector --values=collector-values.yaml

This creates a pganalyze-collector-otel-service Service, which is the address you’ll point Vector at in the next step.

Monitoring multiple CNPG clusters with one collector

If you’re monitoring more than one CNPG cluster, you can run multiple OTLP servers on the same collector, one per monitored cluster, each on a different port:

[pganalyze]
api_key = your_pga_organization_api_key

[cluster-one]
db_host = cluster-one-rw
...
db_log_otel_server = 0.0.0.0:4318

[cluster-two]
db_host = cluster-two-rw
...
db_log_otel_server = 0.0.0.0:4319

Add a matching entry to the Service’s ports list. Once ports is set, the chart ignores the single port/targetPort fields above entirely. Remove them.

service:
  create: true
  name: pganalyze-collector-otel-service
  type: ClusterIP
  ports:
    - name: pganalyze-collector-otel1
      port: 4318
      targetPort: 4318
    - name: pganalyze-collector-otel2
      port: 4319
      targetPort: 4319

Alternatively, a single OTLP endpoint can receive logs from multiple clusters and split them apart using db_log_otel_k8s_pod / db_log_otel_k8s_labels. See the collector settings reference for details.

Proceed to Step 2: Deploy Vector


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →