azure - 如何确定 Azure EventGrid 消息传递失败的原因?

如何确定 EventGrid 消息传递失败的原因?

到目前为止尝试过:

  • 在 EventGrid 系统主题上设置诊断设置
  • 打开 Log Analytics 并使用以下命令查询 AEGDeliveryFailureLogs
//==================================================//
// Assign variables
//==================================================//
let varStart = ago(5h);
let varEnd = now();
//==================================================//
// Query table
//==================================================//
AegDeliveryFailureLogs
| where TimeGenerated between (varStart .. varEnd)
| project split(Message, ',')
  • 在我的案例中产生了 1700 多条记录
  • 结果示例:
[
"outcome=Aborted",
" latencyInMs=180004",
" id=<redacted>",
" outputEventSystemId=<redacted>",
" state=Filtered",
" deliveryTime=5/26/2021 3:22:01 PM",
" deliveryCount=3",
" probationCount=1",
" deliverySchema=EventGridEvent",
" eventSubscriptionDeliverySchema=EventGridEvent",
" outputEventFields=InputEvent| EventSubscriptionId| DeliveryTime| DeliveryCount| State| Id| ProbationCount| LastDeliveryOutcome| DeliverySchema| LastDeliveryAttemptTime| SystemId| UseMappedResourceArmIdForBilling",
" outputEventFieldCount=12",
" requestExpiration=5/26/2021 3:23:01 PM",
" delivered=False id=<redacted>",
" inputEventSystemId=<redacted> publishTime=5/26/2021 3:14:42 PM",
" eventTime=5/26/2021 3:14:42 PM",
" eventType=Microsoft.Storage.BlobCreated",
" deliveryTime=1/1/0001 12:00:00 AM",
" filteringState=FilteringPending",
" inputSchema=EventGridEvent",
" publisher=MICROSOFT-STORAGE-STORAGEACCOUNTS.<redacted>.EVENTGRID.AZURE.NET",
" size=1162",
" subject=/blobServices/default/containers/<redacted>/blobs/2021-05-25/<redacted>/<redacted>.csv",
" inputEventFields=Id| PublishTime| SerializedBody| EventType| Topic| Subject| FilteringHashCode| SystemId| Publisher| FilteringTopic| TopicCategory| DataVersion| MetadataVersion| InputSchema| EventTime| FilteringPolicy",
" inputEventFieldCount=16",
" type=AzureFunction",
" subType=NotApplicable",
" supportsBatching=False",
" aadIntegration=False",
" useSystemIdentity=False",
"armId=/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.Web/sites/<redacted>/functions/<redacted>",
" deliveryResponse=",
" httpStatusCode=InternalServerError",
" errorType=UnexpectedError",
" errorMessage=An unexpected error has occurred. Please report the x-ms-request-id header value to our forums for assistance or raise a support ticket.",
" errorMessage=The operation timed out after: 00:03:00"
]   

有一个明确的 outcome=Aborted 以及 httpStatusCode/errorType/errorMessage 表明存在问题,但这就是调查停止的地方。

是什么导致了这些 EventGrid 消息问题以及如何确定原因?

最佳答案

确定事件网格消息发送失败的原因唯一方法似乎是打开死信。

这是一个死信消息示例。

  • 它清楚地显示了 deadLetterReason 和其他一些有值(value)的调试信息:
[
    {
        "id": "redacted",
        "eventTime": "2021-06-07T22:52:42.7156553Z",
        "eventType": "Microsoft.Storage.BlobCreated",
        "dataVersion": "",
        "metadataVersion": "1",
        "topic": "/subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.Storage/storageAccounts/redacted",
        "subject": "/blobServices/default/containers/redacted/blobs/20210525/redacted.csv",
        "deadLetterReason": "TimeToLiveExceeded",
        "deliveryAttempts": 12,
        "lastDeliveryOutcome": "TimedOut",
        "publishTime": "2021-06-07T22:52:43.1497044Z",
        "lastDeliveryAttemptTime": "2021-06-08T21:50:11.3677712Z",
        "data": {
            "api": "PutBlockList",
            "clientRequestId": "redacted",
            "requestId": "redacted",
            "eTag": "0x8D92A06F5883BA6",
            "contentType": "application/octet-stream",
            "contentLength": 4767672448,
            "blobType": "BlockBlob",
            "blobUrl": "https://redacted.blob.core.windows.net/redacted/20210525/redacted.csv",
            "url": "https://redacted.blob.core.windows.net/redacted/20210525/redacted.csv",
            "sequencer": "000000000000000000000000000093100000000000001286",
            "storageDiagnostics": {
                "batchId": "redacted"
            }
        }
    }
]

https://stackoverflow.com/questions/67711129/

相关文章:

.net-core - 仅禁用与 HealthCheck 相关的日志记录

java - 打开Feign java.lang.NoSuchFieldError : MULTIP

reactjs - 当将组件作为函数调用而不是将其用作标签时,React 没有相同的执行顺序?

azure - 如何在 Azure DevOps yaml 管道中设置环境状态

android - 如何更改android studio中的默认主题?

python - InvalidArgumentError : Expected 'tf.Tenso

python - Pydantic Enum 加载名称而不是值

c# - Docker 客户端 - Windows 上的独立(可移植)版本

python - 在 Jupyter 中将警告转化为错误

javascript - 将 HTML 内容转换为字符串并在文本文件中打印