Problem
When using autocomplete for metric names that contain dots (e.g. kubernetes.pod.id), selecting a suggestion produces a duplicated prefix.
Steps to reproduce:
- Open the query editor
- Start typing a dotted metric name, e.g. kubernetes.pod
- Autocomplete suggests kubernetes.pod.id
- Select the suggestion
Expected result: kubernetes.pod.id
Actual result: kubernetes.kubernetes.pod.id
Root cause
Monaco's getWordAtPosition() relies on the wordPattern regex defined in promql.ts, which treats dots (.) as word separators. When the cursor is at kubernetes.pod|, Monaco identifies only pod as the current word.
The completion replace range covers only pod, but insertText contains the full metric name kubernetes.pod.id. As a result, the text before the dot (kubernetes.) is preserved and the full metric name is inserted
after it.
Affected metrics
Any metric name containing dots, commonly seen in environments using Kubernetes, OpenTelemetry, or other systems that use dot-separated naming conventions (e.g. container.cpu.usage, k8s.node.memory,
process.runtime.gc.count).
Problem
When using autocomplete for metric names that contain dots (e.g. kubernetes.pod.id), selecting a suggestion produces a duplicated prefix.
Steps to reproduce:
Expected result: kubernetes.pod.id
Actual result: kubernetes.kubernetes.pod.id
Root cause
Monaco's getWordAtPosition() relies on the wordPattern regex defined in promql.ts, which treats dots (.) as word separators. When the cursor is at kubernetes.pod|, Monaco identifies only pod as the current word.
The completion replace range covers only pod, but insertText contains the full metric name kubernetes.pod.id. As a result, the text before the dot (kubernetes.) is preserved and the full metric name is inserted
after it.
Affected metrics
Any metric name containing dots, commonly seen in environments using Kubernetes, OpenTelemetry, or other systems that use dot-separated naming conventions (e.g. container.cpu.usage, k8s.node.memory,
process.runtime.gc.count).