Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 【告警策略】告警策略配置事件的时候,支持k8s内置常用事件名 --story=121108438 #4380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tang202388
Copy link
Collaborator

No description provided.

@tang202388 tang202388 added feat A new feature. Correlates with MINOR in SemVer project/monitor project monitor labels Dec 12, 2024
@tang202388
Copy link
Collaborator Author

自测截图:
请求参数:

{
    "bk_biz_id": 2,
    "type": "dimension",
    "params": {
        "data_source_label": "custom",
        "data_type_label": "event",
        "field": "event_name",
        "metric_field": "__INDEX__",
        "result_table_id": "2_test_event_1157286990",
        "where": []
    }
}

1、k8s事件的 event_name 维度原本查询值为空时,可以正常加上默认的事件名

{
    "result": true,
    "code": 200,
    "message": "OK",
    "data": [
        {
            "label": "NodeNetworkUnavailable",
            "value": "NodeNetworkUnavailable"
        },
        {
            "label": "Evicted",
            "value": "Evicted"
        },
        {
            "label": "Unhealthy",
            "value": "Unhealthy"
        },
        {
            "label": "NodeDiskPressure",
            "value": "NodeDiskPressure"
        },
        {
            "label": "FailedScheduling",
            "value": "FailedScheduling"
        },
        {
            "label": "BackOff",
            "value": "BackOff"
        },
        {
            "label": "NodeOutOfDisk",
            "value": "NodeOutOfDisk"
        },
        {
            "label": "ContainerCannotRun",
            "value": "ContainerCannotRun"
        },
        {
            "label": "FailedAttachVolume",
            "value": "FailedAttachVolume"
        },
        {
            "label": "NetworkPolicyViolation",
            "value": "NetworkPolicyViolation"
        },
        {
            "label": "DeadlineExceeded",
            "value": "DeadlineExceeded"
        },
        {
            "label": "NodeMemoryPressure",
            "value": "NodeMemoryPressure"
        },
        {
            "label": "FailedMount",
            "value": "FailedMount"
        },
        {
            "label": "ImagePullBackOff",
            "value": "ImagePullBackOff"
        },
        {
            "label": "OOMKilled",
            "value": "OOMKilled"
        },
        {
            "label": "PVCBoundFailure",
            "value": "PVCBoundFailure"
        },
        {
            "label": "CertificateExpiration",
            "value": "CertificateExpiration"
        },
        {
            "label": "PodStuck",
            "value": "PodStuck"
        },
        {
            "label": "CrashLoopBackOff",
            "value": "CrashLoopBackOff"
        },
        {
            "label": "FailedPull",
            "value": "FailedPull"
        },
        {
            "label": "NodeNotReady",
            "value": "NodeNotReady"
        }
    ]
}

2、k8s事件的 event_name 维度原本查询值有值时,可以正常继续加上默认的事件名,包括原本查询到的值

{
    "result": true,
    "code": 200,
    "message": "OK",
    "data": [
        {
            "label": "NodeOutOfDisk",
            "value": "NodeOutOfDisk"
        },
        {
            "label": "NodeDiskPressure",
            "value": "NodeDiskPressure"
        },
        {
            "label": "PVCBoundFailure",
            "value": "PVCBoundFailure"
        },
        {
            "label": "ccccc",  // 原本查询到的值
            "value": "ccccc"
        },
        {
            "label": "FailedPull",
            "value": "FailedPull"
        },
        {
            "label": "Evicted",
            "value": "Evicted"
        },
        {
            "label": "aaaaa",  // 原本查询到的值
            "value": "aaaaa"
        },
        {
            "label": "FailedScheduling",
            "value": "FailedScheduling"
        },
        {
            "label": "FailedMount",
            "value": "FailedMount"
        },
        {
            "label": "OOMKilled",
            "value": "OOMKilled"
        },
        {
            "label": "PodStuck",
            "value": "PodStuck"
        },
        {
            "label": "CrashLoopBackOff",
            "value": "CrashLoopBackOff"
        },
        {
            "label": "ContainerCannotRun",
            "value": "ContainerCannotRun"
        },
        {
            "label": "Unhealthy",
            "value": "Unhealthy"
        },
        {
            "label": "NodeNotReady",
            "value": "NodeNotReady"
        },
        {
            "label": "BackOff",
            "value": "BackOff"
        },
        {
            "label": "bbbbb",  // 原本查询到的值
            "value": "bbbbb"
        },
        {
            "label": "ImagePullBackOff",
            "value": "ImagePullBackOff"
        },
        {
            "label": "NodeNetworkUnavailable",
            "value": "NodeNetworkUnavailable"
        },
        {
            "label": "NetworkPolicyViolation",
            "value": "NetworkPolicyViolation"
        },
        {
            "label": "FailedAttachVolume",
            "value": "FailedAttachVolume"
        },
        {
            "label": "DeadlineExceeded",
            "value": "DeadlineExceeded"
        },
        {
            "label": "CertificateExpiration",
            "value": "CertificateExpiration"
        },
        {
            "label": "NodeMemoryPressure",
            "value": "NodeMemoryPressure"
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat A new feature. Correlates with MINOR in SemVer project/monitor project monitor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant