rhobs / rhobs/observability-operator

negative nativeHistogramBucketLimit breaks reconciliation

Open
#1,128 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
51
Forks
90
Avg merge
5d 15h
Merged PRs (30d)
22

Description

Creating a ServiceMonitor with nativeHistogramBucketLimit set negative (outside range of uint64) can break the operator, it was not reconciling changes to Prometheus instances while a ServiceMonitor in the namespace had the negative value set.

COO Version: 1.3.1
OCP Version: 4.18.33

ts=2026-06-12T18:25:21.159784115Z level=error caller=/cachi2/output/deps/gomod/pkg/mod/k8s.io/client-go@v0.34.2/tools/cache/reflector.go:205 msg="Failed to watch" logger=UnhandledError err="failed to list *v1.ServiceMonitor: json: cannot unmarshal number -2 into Go struct field ServiceMonitorSpec.items.spec.NativeHistogramConfig.nativeHistogramBucketLimit of type uint64" reflector=pkg/mod/k8s.io/client-go@v0.34.2/tools/cache/reflector.go:290 type=*v1.ServiceMonitor
  apiVersion: monitoring.rhobs/v1
  kind: ServiceMonitor
  metadata:
...
  spec:
    nativeHistogramBucketLimit: -2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing ServiceMonitorSpec.nativeHistogramBucketLimit through the ServiceMonitor watch and reconciliation path, using the negative-value manifest and reflector error as the reproduction. Verify that a negative nativeHistogramBucketLimit no longer prevents reconciliation of Prometheus instances, and add or run the relevant validation or reconciliation checks if they exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.