REST POST 中的 Application Insight 压缩

问题描述

是否有一种方法或库可以压缩发送到 Azure 应用程序洞察力的 REST 调用正文中发送的 JSON 数据?

在此 URL 上发送(发布)数据: https://dc.applicationinsights.azure.com/v2/track

json 正文包含 250 个左右的自定义字符串:

{
    "tags": {
        "ai.operation.name": "Search parameters","ai.operation.id": "xxxx","ai.id": "xxxx","ai.operation.parentId": "xxxx","ai.session.id": "xxxx","ai.session.isFirst": "false","ai.operation.correlationVector": "0","ai.internal.sdkVersion": "xxxx","ai.cloud.role": "xxxx","ai.cloud.roleInstance": "xxxx","ai.application.ver": "1"
    },"data": {
        "baseData": {
            "properties": {
                "Custom String 1": "xxxx","Custom String 2": "xxxx","...": "...","Custom String 250": "xxxx",},"ver": "2","name": "xxxx"
        },"baseType": "EventData"
    },"time": "2021-06-29T07:25:16Z","iKey": "xxxx","name": "Microsoft.ApplicationInsights.Prod.xxxx.Event"
}

注意事项:

  1. 对于 Azure 应用程序洞察而言,每个数据总共有 1.5 GB。
  2. 压缩它们将节省带宽和发送数据的时间。
  3. 就个人而言,这可能听起来像是一个小小的压缩,但从更大的角度来看,它会带来巨大的好处。

-- 问候, 帕比约特

解决方法

此问题已在此处回答:https://docs.microsoft.com/en-us/answers/questions/464764/application-insight-compression-in-rest-post.html