This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Optional | |
import requests | |
def explode_and_filter_by_threshold(value: str, threshold: int) -> List[int]: | |
""" | |
Params: | |
- value : a string of numbers separated by comma | |
- threshold : numerical threshold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from datadog_api_client import Configuration, ApiClient | |
from datadog_api_client.exceptions import ApiAttributeError | |
from datadog_api_client.exceptions import ApiTypeError, ApiValueError | |
from datadog_api_client.v1.api.dashboards_api import DashboardsApi | |
from datadog_api_client.v1.api.monitors_api import MonitorsApi | |
from datadog_api_client.v1.model.formula_and_function_metric_data_source import FormulaAndFunctionMetricDataSource | |
from datadog_api_client.v2.api.metrics_api import MetricsApi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum(rate(http_requests_total(service="my-service" response_code=~"[45].."))) by (service) > 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum(rate(http_requests_total(namesapce="my-namespace", service="my-service" response_code=~"[45].."))) by (namespace, service) > 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum(rate(istio_requests_total{destination_service_name="$destination_service", reporter="source"}[2m])) by (source_workload_namespace, source_app) |