摄取 graphql.operation.name 以在开放遥测中请求数据

问题描述 投票:0回答:0

我正在使用热巧克力(GraphQL)开发我的项目仪器,作为该过程的一部分,我们将开放遥测数据导出到 Azure Application Insight。我有一个关于请求数据的具体问题:

{"name":"Request","time":"2023-07-27T20:58:44.4824818Z","sampleRate":100,"iKey":"e0aadde8-4d01-4aeb-b1f4-455ba57e99e2","tags":{"ai.operation.id":"2936e8c6a52c6bfc2193ce4409a13321","ai.user.userAgent":"PostmanRuntime/7.32.3","ai.cloud.role":"[default-namespace]/default-service","ai.cloud.roleInstance":"2a979b10-b1d7-4bbc-b3f4-3ee75e91ca29","ai.internal.sdkVersion":"dotnet6.0.20:otel1.5.0:ext1.0.0-beta.13","ai.operation.name":"POST /graphql/","ai.location.ip":null},"data":{"baseType":"RequestData","baseData":{"id":"08f6e292b3ac84d7","name":"POST /graphql/","duration":"00:00:02.4003054","success":true,"responseCode":"200","url":"http://localhost:16621/graphql/","properties":{"http.flavor":"1.1","_MS.ProcessedByMetricExtractors":"(Name: X,Ver:\u00271.1\u0027)"},"ver":2}}}
,

您能否指导我如何优雅地将“graphql.operation.name”包含为请求数据中的属性之一?我们将非常感谢您的帮助!

graphql instruments open-telemetry hotchocolate
© www.soinside.com 2019 - 2024. All rights reserved.