qontract-reconcile 0.10.1rc1139__py3-none-any.whl → 0.10.1rc1140__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc1139
3
+ Version: 0.10.1rc1140
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -194,11 +194,11 @@ reconcile/endpoints_discovery/merge_request_manager.py,sha256=wUMsumxv8RnWaRatta
194
194
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
195
195
  reconcile/external_resources/aws.py,sha256=7W-6d-lXO6JGwaxtO1Uc3Lw0p8csJ1EVgz__O1YWUOc,4793
196
196
  reconcile/external_resources/factories.py,sha256=nhdTqf1WEfRfgd5-70KAUJVz0ZvZ19C3Pz7wmotSdrs,4857
197
- reconcile/external_resources/integration.py,sha256=Ne_D5eXtR2a4kFg2Us5h7Zc_WIRgOBxaKbVPic0c6uw,6619
197
+ reconcile/external_resources/integration.py,sha256=gBVO5dE8JyZ3xYcYik-MTIp_18oU7_hpYc_oztyfElQ,6753
198
198
  reconcile/external_resources/integration_secrets_sync.py,sha256=dX09O3r6KURziUYYfiki10orNjOGVma-XojhVqd0ww4,1667
199
199
  reconcile/external_resources/manager.py,sha256=cs6QEirz9EaLiuxybZ_1ugUn61vNWlKAC4NKouqpd5I,16148
200
200
  reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUxivjDa1I,672
201
- reconcile/external_resources/metrics.py,sha256=jsN3IF78Su23d3Qp4BTKXkgZPN6AKjdS8sZFEXmYCek,863
201
+ reconcile/external_resources/metrics.py,sha256=ORZStR2Hg5dYSXpPnM_ZLz48d3VSbN_WY0TcNogvcWk,1003
202
202
  reconcile/external_resources/model.py,sha256=UuQgrnv-SSkvSEQQGeCE2IZkhXjLTCVkP_mw8zBZsIQ,8349
203
203
  reconcile/external_resources/reconciler.py,sha256=3KFmkHsN7YAwJUSBpN1Xd_D2zM9Ea5_c2uMGWsfruZo,9707
204
204
  reconcile/external_resources/secrets_sync.py,sha256=6n0oDPLjd9Ql0lf6zsr1AZw8A6EEe3yCzl20XodtgkE,16229
@@ -674,7 +674,7 @@ reconcile/utils/exceptions.py,sha256=DwfnWUpVOotpP79RWZ2pycmG6nKCL00RBIeZLYkQPW4
674
674
  reconcile/utils/expiration.py,sha256=3JaXH4psksR7z262k7FmdyREjCLqm66OpVMEbcfdWRo,1213
675
675
  reconcile/utils/extended_early_exit.py,sha256=QSktrmfw37zSRMNk930tDbQsVeKxaPPPD43e79DGwZw,6754
676
676
  reconcile/utils/external_resource_spec.py,sha256=bhH_xneFwATdFumTPkiQmcVKYI0gcaWuqV6FpFdf_P0,7006
677
- reconcile/utils/external_resources.py,sha256=GC4wYuSXwk2ifr3aDEwnEiumaYqWhzgKK-hXp6pXemA,7516
677
+ reconcile/utils/external_resources.py,sha256=n3c7GyFb0o5sgQ67dAsGWV40ELHJH0vMKyJMkvMHEok,7659
678
678
  reconcile/utils/filtering.py,sha256=S4PbMHuFr3ED0P2Q_ea5CAaB7FimI62B-F5YTaKrphA,402
679
679
  reconcile/utils/git.py,sha256=wzVIYAeKlMGW538U1mkJWUI6h_mFRUY4lawh2AR8hw4,2345
680
680
  reconcile/utils/github_api.py,sha256=R8OvqyPdnRqvP-Efnv9RvIcbBlb4M0KC4RlbnJMD0Tg,2426
@@ -871,8 +871,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
871
871
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
872
872
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
873
873
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
874
- qontract_reconcile-0.10.1rc1139.dist-info/METADATA,sha256=bXr1ZVaT9iTVuCUis_xtQiZcLxHtYvCRixacclFAXJs,2213
875
- qontract_reconcile-0.10.1rc1139.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
876
- qontract_reconcile-0.10.1rc1139.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
877
- qontract_reconcile-0.10.1rc1139.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
878
- qontract_reconcile-0.10.1rc1139.dist-info/RECORD,,
874
+ qontract_reconcile-0.10.1rc1140.dist-info/METADATA,sha256=ni5-15CF_5tDAFjlb69EjjEQDKwnhaP6RD6VMA4P2cg,2213
875
+ qontract_reconcile-0.10.1rc1140.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
876
+ qontract_reconcile-0.10.1rc1140.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
877
+ qontract_reconcile-0.10.1rc1140.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
878
+ qontract_reconcile-0.10.1rc1140.dist-info/RECORD,,
@@ -30,6 +30,7 @@ from reconcile.typed_queries.external_resources import (
30
30
  )
31
31
  from reconcile.utils import gql
32
32
  from reconcile.utils.aws_api_typed.api import AWSApi, AWSStaticCredentials
33
+ from reconcile.utils.external_resources import publish_metrics
33
34
  from reconcile.utils.jobcontroller.controller import (
34
35
  build_job_controller,
35
36
  )
@@ -167,6 +168,7 @@ def run(
167
168
  for k, e in er_mgr.errors.items():
168
169
  logging.error("ExternalResourceKey: %s, Error: %s" % (k, e))
169
170
  else:
171
+ publish_metrics(er_mgr.er_inventory, QONTRACT_INTEGRATION)
170
172
  er_mgr.handle_resources()
171
173
 
172
174
 
@@ -1,10 +1,15 @@
1
1
  from pydantic import BaseModel
2
2
 
3
- from reconcile.utils.metrics import CounterMetric, GaugeMetric
3
+ from reconcile.external_resources.meta import QONTRACT_INTEGRATION
4
+ from reconcile.utils.metrics import (
5
+ CounterMetric,
6
+ GaugeMetric,
7
+ normalize_integration_name,
8
+ )
4
9
 
5
10
 
6
11
  class ExternalResourcesBaseMetric(BaseModel):
7
- integration = "external_resources"
12
+ integration = normalize_integration_name(QONTRACT_INTEGRATION)
8
13
  provision_provider: str
9
14
  provisioner_name: str
10
15
  provider: str
@@ -8,6 +8,7 @@ from typing import Any
8
8
 
9
9
  import anymarkup
10
10
 
11
+ from reconcile.external_resources.model import ExternalResourcesInventory
11
12
  from reconcile.utils import (
12
13
  gql,
13
14
  metrics,
@@ -66,14 +67,17 @@ def managed_external_resources(namespace_info: Mapping[str, Any]) -> bool:
66
67
 
67
68
 
68
69
  def get_inventory_count_combinations(
69
- inventory: ExternalResourceSpecInventory,
70
+ inventory: ExternalResourceSpecInventory | ExternalResourcesInventory,
70
71
  ) -> Counter[tuple]:
71
72
  return Counter(
72
73
  (k.provision_provider, k.provisioner_name, k.provider) for k in inventory
73
74
  )
74
75
 
75
76
 
76
- def publish_metrics(inventory: ExternalResourceSpecInventory, integration: str) -> None:
77
+ def publish_metrics(
78
+ inventory: ExternalResourceSpecInventory | ExternalResourcesInventory,
79
+ integration: str,
80
+ ) -> None:
77
81
  count_combinations = get_inventory_count_combinations(inventory)
78
82
  integration_name = metrics.normalize_integration_name(integration)
79
83
  for combination, count in count_combinations.items():