Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
adapt queries (#3623)
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavStefanov authored Jan 31, 2024
1 parent f291ccb commit e5f21b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chart/compass/charts/prometheus-postgres-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ config:
description: "Number of tenants which are assigned to at least one runtime or application"
compass_director_customer_adoption:
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE (id IN ( SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key='managed' AND value ? 'false') AND b.parent IS null) OR id IN ( SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id WHERE name <> 'DEFAULT' AND (parent IS null OR parent IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer'))));"
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE (id IN (SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id LEFT JOIN tenant_parents tp on b.id = tp.tenant_id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key = 'managed' AND value ? 'false') AND tp.parent_id IS null) OR id IN (SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id LEFT JOIN tenant_parents tp2 ON b2.id = tp2.tenant_id WHERE name <> 'DEFAULT' AND (tp2.parent_id IS null OR tp2.parent_id IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer'))));"
master: true
cache_seconds: 43200
metrics:
Expand All @@ -304,7 +304,7 @@ config:
description: "Number of tenants that have at least one non auto-discovered Application (the tenant is owner and its parent is null) or tenants that have at least 1 formation different from the default one where their parent is either null or their parent is of type customer"
compass_director_external_customer_adoption:
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE ((id IN ( SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key='managed' AND value ? 'false') AND b.parent IS null) OR id IN ( SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id WHERE name <> 'DEFAULT' AND (parent IS null OR parent IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer')))) AND (id IN (SELECT tenant_id FROM labels WHERE key = 'licensetype' AND (value ? 'PARTNER' OR value ? 'CUSTOMER'))));"
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE ( (id IN (SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id LEFT JOIN tenant_parents tp on b.id = tp.tenant_id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key = 'managed' AND value ? 'false') AND tp.parent_id IS null) OR id IN (SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id LEFT JOIN tenant_parents tp2 ON b2.id = tp2.tenant_id WHERE name <> 'DEFAULT' AND (tp2.parent_id IS null OR tp2.parent_id IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer')))) AND (id IN (SELECT tenant_id FROM labels WHERE key = 'licensetype' AND (value ? 'PARTNER' OR value ? 'CUSTOMER'))));"
master: true
cache_seconds: 43200
metrics:
Expand All @@ -313,7 +313,7 @@ config:
description: "Number of EXTERNAL tenants that have at least one non auto-discovered Application (the tenant is owner and its parent is null) or tenants that have at least 1 formation different from the default one where their parent is either null or their parent is of type customer"
compass_director_internal_customer_adoption:
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE ((id IN ( SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key='managed' AND value ? 'false') AND b.parent IS null) OR id IN ( SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id WHERE name <> 'DEFAULT' AND (parent IS null OR parent IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer')))) AND (id IN (SELECT tenant_id FROM labels WHERE key = 'licensetype' AND NOT (value ? 'PARTNER' OR value ? 'CUSTOMER' OR value ? 'TRIAL'))));"
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE ((id IN (SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id LEFT JOIN tenant_parents tp on b.id = tp.tenant_id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key = 'managed' AND value ? 'false') AND tp.parent_id IS null) OR id IN (SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id LEFT JOIN tenant_parents tp2 ON b2.id = tp2.tenant_id WHERE name <> 'DEFAULT' AND (tp2.parent_id IS null OR tp2.parent_id IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer')))) AND (id IN (SELECT tenant_id FROM labels WHERE key = 'licensetype' AND NOT (value ? 'PARTNER' OR value ? 'CUSTOMER' OR value ? 'TRIAL'))));"
master: true
cache_seconds: 43200
metrics:
Expand All @@ -322,7 +322,7 @@ config:
description: "Number of INTERNAL tenants that have at least one non auto-discovered Application (the tenant is owner and its parent is null) or tenants that have at least 1 formation different from the default one where their parent is either null or their parent is of type customer"
compass_director_trial_customer_adoption:
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE ((id IN ( SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key='managed' AND value ? 'false') AND b.parent IS null) OR id IN ( SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id WHERE name <> 'DEFAULT' AND (parent IS null OR parent IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer')))) AND (id IN (SELECT tenant_id FROM labels WHERE key = 'licensetype' AND (value ? 'TRIAL'))));"
query: "SELECT COUNT(DISTINCT (id)) as quantity FROM business_tenant_mappings WHERE ((id IN (SELECT b.id FROM applications a JOIN tenant_applications ta ON a.id = ta.id JOIN business_tenant_mappings b ON ta.tenant_id = b.id LEFT JOIN tenant_parents tp on b.id = tp.tenant_id WHERE ta.owner IS true AND ta.id IN (SELECT app_id FROM labels WHERE key = 'managed' AND value ? 'false') AND tp.parent_id IS null) OR id IN (SELECT b2.id FROM formations JOIN business_tenant_mappings b2 ON formations.tenant_id = b2.id LEFT JOIN tenant_parents tp2 ON b2.id = tp2.tenant_id WHERE name <> 'DEFAULT' AND (tp2.parent_id IS null OR tp2.parent_id IN (SELECT id FROM business_tenant_mappings b3 WHERE type = 'customer')))) AND (id IN (SELECT tenant_id FROM labels WHERE key = 'licensetype' AND (value ? 'TRIAL'))));"
master: true
cache_seconds: 43200
metrics:
Expand Down

0 comments on commit e5f21b3

Please sign in to comment.