Skip to content

Commit 3f1d204

Browse files
authored
[ROB-1923] - amp irsa support (#465)
1 parent 97b49a5 commit 3f1d204

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

poetry.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ kubernetes = "^26.1.0"
3030
prometheus-api-client = "0.5.3"
3131
numpy = ">=1.26.4,<1.27.0"
3232
alive-progress = "^3.1.2"
33-
prometrix = "0.2.1"
33+
prometrix = "0.2.2"
3434
slack-sdk = "^3.21.3"
3535
pandas = "2.2.2"
3636
requests = "2.32.0"

requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ google-auth==2.28.2 ; python_version >= "3.9" and python_full_version < "3.13"
1616
grapheme==0.6.0 ; python_version >= "3.9" and python_full_version < "3.13"
1717
httmock==1.4.0 ; python_version >= "3.9" and python_full_version < "3.13"
1818
idna==3.7 ; python_version >= "3.9" and python_full_version < "3.13"
19-
importlib-resources==6.3.0 ; python_version >= "3.9" and python_version < "3.10"
19+
importlib-resources==6.3.0 ; python_version == "3.9"
2020
jmespath==1.0.1 ; python_version >= "3.9" and python_full_version < "3.13"
2121
kiwisolver==1.4.5 ; python_version >= "3.9" and python_full_version < "3.13"
2222
kubernetes==26.1.0 ; python_version >= "3.9" and python_full_version < "3.13"
@@ -27,7 +27,7 @@ packaging==24.0 ; python_version >= "3.9" and python_full_version < "3.13"
2727
pandas==2.2.2 ; python_version >= "3.9" and python_full_version < "3.13"
2828
pillow==10.3.0 ; python_version >= "3.9" and python_full_version < "3.13"
2929
prometheus-api-client==0.5.3 ; python_version >= "3.9" and python_full_version < "3.13"
30-
prometrix==0.1.17 ; python_version >= "3.9" and python_full_version < "3.13"
30+
prometrix==0.2.2 ; python_version >= "3.9" and python_full_version < "3.13"
3131
pyasn1-modules==0.3.0 ; python_version >= "3.9" and python_full_version < "3.13"
3232
pyasn1==0.5.1 ; python_version >= "3.9" and python_full_version < "3.13"
3333
pydantic==1.10.15 ; python_version >= "3.9" and python_full_version < "3.13"
@@ -42,15 +42,15 @@ requests==2.32.0 ; python_version >= "3.9" and python_full_version < "3.13"
4242
rich==12.6.0 ; python_version >= "3.9" and python_full_version < "3.13"
4343
rsa==4.9 ; python_version >= "3.9" and python_full_version < "3.13"
4444
s3transfer==0.10.0 ; python_version >= "3.9" and python_full_version < "3.13"
45-
setuptools==78.1.1 ; python_version >= "3.9" and python_full_version < "3.13"
45+
setuptools==80.9.0 ; python_version >= "3.9" and python_full_version < "3.13"
4646
shellingham==1.5.4 ; python_version >= "3.9" and python_full_version < "3.13"
4747
six==1.16.0 ; python_version >= "3.9" and python_full_version < "3.13"
4848
slack-sdk==3.27.1 ; python_version >= "3.9" and python_full_version < "3.13"
49-
typer[all]==0.7.0 ; python_version >= "3.9" and python_full_version < "3.13"
49+
tenacity==9.0.0 ; python_version >= "3.9" and python_full_version < "3.13"
50+
typer==0.7.0 ; python_version >= "3.9" and python_full_version < "3.13"
5051
typing-extensions==4.6.0 ; python_version >= "3.9" and python_full_version < "3.13"
5152
tzdata==2024.1 ; python_version >= "3.9" and python_full_version < "3.13"
5253
tzlocal==5.2 ; python_version >= "3.9" and python_full_version < "3.13"
53-
urllib3==1.26.19 ; python_version >= "3.9" and python_full_version < "3.13"
54+
urllib3==1.26.20 ; python_version >= "3.9" and python_full_version < "3.13"
5455
websocket-client==1.7.0 ; python_version >= "3.9" and python_full_version < "3.13"
55-
zipp==3.19.2 ; python_version >= "3.9" and python_version < "3.13"
56-
tenacity==9.0.0 ; python_version >= "3.9" and python_version < "3.13"
56+
zipp==3.20.2 ; python_version >= "3.9" and python_full_version < "3.13"

robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async def gather_data(
216216
async def query_and_validate(self, prom_query) -> Any:
217217
result = await self.query(prom_query)
218218
if len(result) != 1:
219-
logger.warning(f"Error: Expected exactly one result from Prometheus query. {prom_query}")
219+
logger.warning(f"Error: Expected exactly one result from Prometheus query but instead got {len(result)}. {prom_query}")
220220
return None
221221

222222
result_value = result[0].get("value")

robusta_krr/core/integrations/prometheus/prometheus_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def generate_prometheus_config(
3737
session = boto3.Session(profile_name=settings.eks_managed_prom_profile_name)
3838
credentials = session.get_credentials()
3939
region = settings.eks_managed_prom_region if settings.eks_managed_prom_region else session.region_name
40+
token = None
4041

4142
if settings.eks_access_key and settings.eks_secret_key:
4243
# when we have both access key and secret key, don't try to read credentials which can fail
@@ -47,7 +48,8 @@ def generate_prometheus_config(
4748
credentials = credentials.get_frozen_credentials()
4849
access_key = settings.eks_access_key if settings.eks_access_key else credentials.access_key
4950
secret_key = settings.eks_secret_key.get_secret_value() if settings.eks_secret_key else credentials.secret_key
50-
51+
token = credentials.token
52+
5153
service_name = settings.eks_service_name if settings.eks_secret_key else "aps"
5254
if not region:
5355
raise Exception("No eks region specified")
@@ -56,6 +58,7 @@ def generate_prometheus_config(
5658
access_key=access_key,
5759
secret_access_key=secret_key,
5860
aws_region=region,
61+
token=token,
5962
service_name=service_name,
6063
**baseconfig,
6164
)

0 commit comments

Comments
 (0)