blob: e1151ea6a7249c3aa281fa820a6d568cb004da35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import datetime
from abc import ABC, abstractmethod
from robusta_krr.core.abstract.strategies import PodsTimeData
from robusta_krr.core.models.objects import K8sWorkload
class BaseMetric(ABC):
"""
This abstraction is done for a future use.
Currently we only scrape metrics from Prometheus,
but in the future we may want to support other metric sources like Datadog, etc.
TODO: When we want to support other metric sources, we should maybe rethink an interface here.
"""
@abstractmethod
async def load_data(
self, object: K8sWorkload, period: datetime.timedelta, step: datetime.timedelta
) -> PodsTimeData:
...
|