Skip to content

ccp_nodemx_mem_request metric exposes values in kilobytes #4229

@aeroyorch

Description

@aeroyorch

Overview

The ccp_nodemx_mem_request metric exposed by the OTEL-based sidecar reports values in kilobytes, but its description incorrectly states that it reports values in bytes.

Environment

Please provide the following details:

  • Platform: Rancher
  • Platform Version: v1.29.13+rke2r1
  • PGO Image Tag: ubi8-16.8-0
  • Postgres Version 16

Steps to Reproduce

REPRO

Provide steps to get to the error condition:

  1. Activate OTEL metrics and resources in Postgres instance:
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
  name: myinstance
spec:
  postgresVersion: 16
  instrumentation: {}
  image: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.8-0"
  instances:
  - name: instance1
    replicas: 3
    resources:
      requests:
        cpu: "4"
        memory: "32Gi"
  1. Get metrics from Prometheus

  2. Here the extraction from the collector sidecar config:

 - description: Memory request value in bytes
   metric_name: ccp_nodemx_mem_request
   static_attributes:
     server: localhost:5432
   value_column: request

EXPECTED

  1. Metrics provided by ccp_nodemx_mem_request in bytes, as the ccp_nodemx_mem_limit does.

ACTUAL

  1. Metrics are in KiB:
$ kubectl get pod PODNAME -o jsonpath='{.spec.containers[*].resources.requests.memory}'
32Gi

Prometheus output: 32768

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions