Skip to content

Commit

Permalink
Merge branch 'main' into EW-1067
Browse files Browse the repository at this point in the history
  • Loading branch information
mkreuzkam-cap authored Nov 26, 2024
2 parents 81285f8 + 1a59f65 commit 324db1e
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions ansible/roles/mongodb_query_exporter/templates/values.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -1056,62 +1056,6 @@ aggregations:
{"$count" : "count"}
]


- database: {{ mongodb_query_exporter_mongodb_sc_db_name }}
collection: users
metrics:
- name: sc_users_without_accounts
type: gauge
help: 'Users which have no accounts grouped by reasons'
value: total
overrideEmpty: true
emptyValue: 0
labels: [reason]
constLabels:
longterm: 'true'
mode: pull
# due to the nature of the query, we can not use push mode since accounts and users change all the time,
# and we need that costly "reverse lookup" to get the unknown metric
cache: 1h
pipeline: |
[
{
"$lookup": {
"from": "accounts",
"localField": "_id",
"foreignField": "userId",
"as": "accountInfo"
}
},
{
"$match": {
"accountInfo": { "$size": 0 }
}
},
{
"$group": {
"_id": {
"$switch": {
"branches": [
{ "case": { "$or": [{ "$eq": ["$firstName", "DELETED"] }, { "$eq": ["$firstName", "Gelöschter"] }] }, "then": "tombstone" },
{ "case": { "$and": [{ "$ifNull": ["$importHash", false] }, { "$ne": ["$importHash", ""] }] }, "then": "not-fully-registered" }
],
"default": "unknown"
}
},
"total": { "$sum": 1 }
}
},
{
"$project": {
"total": 1,
"reason": "$_id",
"_id": 0
}
}
]


- database: {{ mongodb_query_exporter_mongodb_sc_db_name }}
collection: files
metrics:
Expand Down

0 comments on commit 324db1e

Please sign in to comment.