qontract-reconcile 0.10.2.dev105__py3-none-any.whl → 0.10.2.dev106__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/RECORD +6 -6
- reconcile/fleet_labeler/integration.py +11 -1
- reconcile/fleet_labeler/metrics.py +47 -2
- {qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.2.
|
3
|
+
Version: 0.10.2.dev106
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
|
6
6
|
Project-URL: repository, https://github.com/app-sre/qontract-reconcile
|
{qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/RECORD
RENAMED
@@ -208,10 +208,10 @@ reconcile/external_resources/secrets_sync.py,sha256=ZDxzGZ6wC4zxLhA7-L39xDRH6rzU
|
|
208
208
|
reconcile/external_resources/state.py,sha256=gF3ACdl7YiUlbQ4uEGrD6i_Txxqr6mT9f8IFlTQ-8dY,13176
|
209
209
|
reconcile/fleet_labeler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
210
210
|
reconcile/fleet_labeler/dependencies.py,sha256=MFiSfT25Ks0X3iQxwayNvFX_l6bQi97f3IiaNR1wtHc,3173
|
211
|
-
reconcile/fleet_labeler/integration.py,sha256=
|
211
|
+
reconcile/fleet_labeler/integration.py,sha256=HGlUJe5BCfAgk7YCxxsIteB8LH1pL8led-KfaIVh214,14614
|
212
212
|
reconcile/fleet_labeler/merge_request.py,sha256=SfGxXInxeJzVnsTtO0ZC9-PesUJMdpKxKY9eCB6ms-g,1538
|
213
213
|
reconcile/fleet_labeler/meta.py,sha256=lWnpH2U0PHCPXu9Ok_CPmO494qQJQ5pOuqo28s0jzIQ,146
|
214
|
-
reconcile/fleet_labeler/metrics.py,sha256=
|
214
|
+
reconcile/fleet_labeler/metrics.py,sha256=n2GkaEEIgIrwMy85Ztm_x34YrrKXKLIPlerxVXExzdE,3255
|
215
215
|
reconcile/fleet_labeler/ocm.py,sha256=qcg1_p7nKlZG7-MQeOZos3rz6YSPAPh-HKxE3OVJwe0,4165
|
216
216
|
reconcile/fleet_labeler/validate.py,sha256=Ch4fe7jXQZKl4pnvl5IxWS-dKSIuuiwdH2B7mivZoco,1654
|
217
217
|
reconcile/fleet_labeler/vcs.py,sha256=6UHUQ08AGAHXF7629I6X-T_E1pvx96LxjS66EeOzve4,1108
|
@@ -786,7 +786,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
786
786
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
|
787
787
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
788
788
|
tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
|
789
|
-
qontract_reconcile-0.10.2.
|
790
|
-
qontract_reconcile-0.10.2.
|
791
|
-
qontract_reconcile-0.10.2.
|
792
|
-
qontract_reconcile-0.10.2.
|
789
|
+
qontract_reconcile-0.10.2.dev106.dist-info/METADATA,sha256=3p7qkhmRv3Ygggl73B74hFVQvPufuOTlfoiDQVNnDWU,24566
|
790
|
+
qontract_reconcile-0.10.2.dev106.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
791
|
+
qontract_reconcile-0.10.2.dev106.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
|
792
|
+
qontract_reconcile-0.10.2.dev106.dist-info/RECORD,,
|
@@ -66,11 +66,11 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
|
|
66
66
|
secret_reader=self.secret_reader,
|
67
67
|
dry_run=dry_run,
|
68
68
|
)
|
69
|
-
self._metrics = dependencies.metrics
|
70
69
|
self.reconcile(dependencies=dependencies)
|
71
70
|
|
72
71
|
def reconcile(self, dependencies: Dependencies) -> None:
|
73
72
|
validate_label_specs(specs=dependencies.label_specs_by_name)
|
73
|
+
all_cluster_ids: set[str] = set()
|
74
74
|
for spec_name, ocm in dependencies.ocm_clients_by_label_spec_name.items():
|
75
75
|
spec = dependencies.label_specs_by_name[spec_name]
|
76
76
|
discovered_clusters = self._discover_desired_clusters(
|
@@ -99,6 +99,16 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
|
|
99
99
|
ocm=ocm,
|
100
100
|
dry_run=synch_labels,
|
101
101
|
)
|
102
|
+
num_labels = 0
|
103
|
+
for cluster in spec.clusters:
|
104
|
+
all_cluster_ids.add(cluster.cluster_id)
|
105
|
+
num_labels += len(cluster.subscription_labels)
|
106
|
+
dependencies.metrics.set_managed_labels_gauge(
|
107
|
+
ocm_name=spec.ocm_env.name,
|
108
|
+
spec_name=spec_name,
|
109
|
+
value=num_labels,
|
110
|
+
)
|
111
|
+
dependencies.metrics.set_managed_clusters_gauge(value=len(all_cluster_ids))
|
102
112
|
|
103
113
|
def _discover_desired_clusters(
|
104
114
|
self, spec: FleetLabelsSpecV1, ocm: OCMClient
|
@@ -36,14 +36,34 @@ class FleetLabelerMetrics:
|
|
36
36
|
value,
|
37
37
|
)
|
38
38
|
|
39
|
+
def set_managed_labels_gauge(
|
40
|
+
self, ocm_name: str, spec_name: str, value: int
|
41
|
+
) -> None:
|
42
|
+
metrics.set_gauge(
|
43
|
+
FleetLabelerManagedLabelsGauge(
|
44
|
+
ocm_name=ocm_name,
|
45
|
+
spec=spec_name,
|
46
|
+
),
|
47
|
+
value,
|
48
|
+
)
|
49
|
+
|
50
|
+
def set_managed_clusters_gauge(self, value: int) -> None:
|
51
|
+
metrics.set_gauge(
|
52
|
+
FleetLabelerManagedClustersGauge(),
|
53
|
+
value,
|
54
|
+
)
|
55
|
+
|
39
56
|
|
40
57
|
class FleetLabelerBaseMetric(BaseModel):
|
41
58
|
integration: str = QONTRACT_INTEGRATION
|
59
|
+
|
60
|
+
|
61
|
+
class FleetLabelerSpecBaseMetric(FleetLabelerBaseMetric):
|
42
62
|
ocm_name: str
|
43
63
|
spec: str
|
44
64
|
|
45
65
|
|
46
|
-
class FleetLabelerDuplicateClusterMatchesGauge(
|
66
|
+
class FleetLabelerDuplicateClusterMatchesGauge(FleetLabelerSpecBaseMetric, GaugeMetric):
|
47
67
|
"""
|
48
68
|
Gauge for the number of clusters that have duplicate matches. Clusters with
|
49
69
|
duplicate matches are being ignored by fleet labeler, as it cannot clearly
|
@@ -56,7 +76,7 @@ class FleetLabelerDuplicateClusterMatchesGauge(FleetLabelerBaseMetric, GaugeMetr
|
|
56
76
|
return "fleet_labeler_duplicate_cluster_matches"
|
57
77
|
|
58
78
|
|
59
|
-
class FleetLabelerLabelRenderingErrorGauge(
|
79
|
+
class FleetLabelerLabelRenderingErrorGauge(FleetLabelerSpecBaseMetric, GaugeMetric):
|
60
80
|
"""
|
61
81
|
Gauge for the number of clusters that have label render errors. This
|
62
82
|
happens when the fleet labeler is unable to render the subscription labels
|
@@ -66,3 +86,28 @@ class FleetLabelerLabelRenderingErrorGauge(FleetLabelerBaseMetric, GaugeMetric):
|
|
66
86
|
@classmethod
|
67
87
|
def name(cls) -> str:
|
68
88
|
return "fleet_labeler_label_rendering_error"
|
89
|
+
|
90
|
+
|
91
|
+
class FleetLabelerManagedLabelsGauge(FleetLabelerSpecBaseMetric, GaugeMetric):
|
92
|
+
"""
|
93
|
+
Gauge for the current number of labels under management.
|
94
|
+
Note, that label<->cluster combination must be unique across all
|
95
|
+
specs, hence we can give the spec as a label here.
|
96
|
+
"""
|
97
|
+
|
98
|
+
@classmethod
|
99
|
+
def name(cls) -> str:
|
100
|
+
return "fleet_labeler_managed_labels"
|
101
|
+
|
102
|
+
|
103
|
+
class FleetLabelerManagedClustersGauge(FleetLabelerBaseMetric, GaugeMetric):
|
104
|
+
"""
|
105
|
+
Gauge for the current number of clusters under management.
|
106
|
+
Note, that a cluster can be part of multiple spec inventories.
|
107
|
+
This metric only cares about the total number of unique clusters,
|
108
|
+
thus the spec is not a label here.
|
109
|
+
"""
|
110
|
+
|
111
|
+
@classmethod
|
112
|
+
def name(cls) -> str:
|
113
|
+
return "fleet_labeler_managed_clusters"
|
{qontract_reconcile-0.10.2.dev105.dist-info → qontract_reconcile-0.10.2.dev106.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|