Open Madjew opened 5 months ago
i encounter that issue right now too
in my case it complains about the very first aggregation, even though i added one at the end and was just checking the logs
pipeline in question:
[
{"$count":"count"}
]
recently on that aggregation there has been added a new constLabel
and cache: 5m
might be the cause
update
this is the fixed version, applying cache: 5m does cause the collector to stutter and only report every 5m, not only this but all other metrics
aggregations:
- database: scapp
collection: schools
metrics:
- name: sc_schools
type: gauge
help: 'The number of schools'
value: count
overrideEmpty: true
emptyValue: 0
labels: []
constLabels:
mongodb_collection: schools
longterm: 'true'
mode: pull
pipeline: |
[
{"$count":"count"}
]
looking at the service-monitor, the interval is set to 60s and with a scrapeTimeout of 10s if that matters for other metrics which have a cache like 1h this does not happen
hope that gives some insight
Describe the bug
An error has occurred while serving metrics: collected metric "count_docs_by_type_and_region_last_hour_global" { label:<name:"_idForm" value:"107-1/\321\203" > label:<name:"_idRegion" value:"10" > label:<name:"server" value:"main" > gauge: } was collected before with the same name and label values
To Reproduce
configuration
Environment
Additional context
We use this pipeline to find documents that were created an hour ago by adding the following code:
But when using the same query for all documents for all time, we get an error: An error has occurred while serving metrics: collected metric "count_docs_by_type_and_region_last_hour_global" { label:<name:"_idForm" value:"107-1/\321\203" > label:<name:"_idRegion" value:"10" > label:<name:"server" value:"main" > gauge: } was collected before with the same name and label values
Logs