Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kubernetes = "^26.1.0"
prometheus-api-client = "0.5.3"
numpy = ">=1.26.4,<1.27.0"
alive-progress = "^3.1.2"
prometrix = "0.2.1"
prometrix = "0.2.2"
slack-sdk = "^3.21.3"
pandas = "2.2.2"
requests = "2.32.0"
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ google-auth==2.28.2 ; python_version >= "3.9" and python_full_version < "3.13"
grapheme==0.6.0 ; python_version >= "3.9" and python_full_version < "3.13"
httmock==1.4.0 ; python_version >= "3.9" and python_full_version < "3.13"
idna==3.7 ; python_version >= "3.9" and python_full_version < "3.13"
importlib-resources==6.3.0 ; python_version >= "3.9" and python_version < "3.10"
importlib-resources==6.3.0 ; python_version == "3.9"
jmespath==1.0.1 ; python_version >= "3.9" and python_full_version < "3.13"
kiwisolver==1.4.5 ; python_version >= "3.9" and python_full_version < "3.13"
kubernetes==26.1.0 ; python_version >= "3.9" and python_full_version < "3.13"
Expand All @@ -27,7 +27,7 @@ packaging==24.0 ; python_version >= "3.9" and python_full_version < "3.13"
pandas==2.2.2 ; python_version >= "3.9" and python_full_version < "3.13"
pillow==10.3.0 ; python_version >= "3.9" and python_full_version < "3.13"
prometheus-api-client==0.5.3 ; python_version >= "3.9" and python_full_version < "3.13"
prometrix==0.1.17 ; python_version >= "3.9" and python_full_version < "3.13"
prometrix==0.2.2 ; python_version >= "3.9" and python_full_version < "3.13"
pyasn1-modules==0.3.0 ; python_version >= "3.9" and python_full_version < "3.13"
pyasn1==0.5.1 ; python_version >= "3.9" and python_full_version < "3.13"
pydantic==1.10.15 ; python_version >= "3.9" and python_full_version < "3.13"
Expand All @@ -42,15 +42,15 @@ requests==2.32.0 ; python_version >= "3.9" and python_full_version < "3.13"
rich==12.6.0 ; python_version >= "3.9" and python_full_version < "3.13"
rsa==4.9 ; python_version >= "3.9" and python_full_version < "3.13"
s3transfer==0.10.0 ; python_version >= "3.9" and python_full_version < "3.13"
setuptools==78.1.1 ; python_version >= "3.9" and python_full_version < "3.13"
setuptools==80.9.0 ; python_version >= "3.9" and python_full_version < "3.13"
shellingham==1.5.4 ; python_version >= "3.9" and python_full_version < "3.13"
six==1.16.0 ; python_version >= "3.9" and python_full_version < "3.13"
slack-sdk==3.27.1 ; python_version >= "3.9" and python_full_version < "3.13"
typer[all]==0.7.0 ; python_version >= "3.9" and python_full_version < "3.13"
tenacity==9.0.0 ; python_version >= "3.9" and python_full_version < "3.13"
typer==0.7.0 ; python_version >= "3.9" and python_full_version < "3.13"
typing-extensions==4.6.0 ; python_version >= "3.9" and python_full_version < "3.13"
tzdata==2024.1 ; python_version >= "3.9" and python_full_version < "3.13"
tzlocal==5.2 ; python_version >= "3.9" and python_full_version < "3.13"
urllib3==1.26.19 ; python_version >= "3.9" and python_full_version < "3.13"
urllib3==1.26.20 ; python_version >= "3.9" and python_full_version < "3.13"
websocket-client==1.7.0 ; python_version >= "3.9" and python_full_version < "3.13"
zipp==3.19.2 ; python_version >= "3.9" and python_version < "3.13"
tenacity==9.0.0 ; python_version >= "3.9" and python_version < "3.13"
zipp==3.20.2 ; python_version >= "3.9" and python_full_version < "3.13"
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async def gather_data(
async def query_and_validate(self, prom_query) -> Any:
result = await self.query(prom_query)
if len(result) != 1:
logger.warning(f"Error: Expected exactly one result from Prometheus query. {prom_query}")
logger.warning(f"Error: Expected exactly one result from Prometheus query but instead got {len(result)}. {prom_query}")
return None

result_value = result[0].get("value")
Expand Down
5 changes: 4 additions & 1 deletion robusta_krr/core/integrations/prometheus/prometheus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def generate_prometheus_config(
session = boto3.Session(profile_name=settings.eks_managed_prom_profile_name)
credentials = session.get_credentials()
region = settings.eks_managed_prom_region if settings.eks_managed_prom_region else session.region_name
token = None

if settings.eks_access_key and settings.eks_secret_key:
# when we have both access key and secret key, don't try to read credentials which can fail
Expand All @@ -47,7 +48,8 @@ def generate_prometheus_config(
credentials = credentials.get_frozen_credentials()
access_key = settings.eks_access_key if settings.eks_access_key else credentials.access_key
secret_key = settings.eks_secret_key.get_secret_value() if settings.eks_secret_key else credentials.secret_key

token = credentials.token

service_name = settings.eks_service_name if settings.eks_secret_key else "aps"
if not region:
raise Exception("No eks region specified")
Expand All @@ -56,6 +58,7 @@ def generate_prometheus_config(
access_key=access_key,
secret_access_key=secret_key,
aws_region=region,
token=token,
service_name=service_name,
**baseconfig,
)
Expand Down