Node.js 中无法使用 application insights trackEvent() 方法记录冗长的消息
Not able to log lengthy messages using application insights trackEvent() method in Node.js
我们正在尝试使用 AppInsights trackEvent() 消息记录一些冗长的消息。但它没有登录 AppInsights 也没有给出任何错误。
请帮我记录冗长的字符串。
请告诉我们 trackEvent() 的最大限制
长度确实有限制。例如,事件的名称 属性 的限制是 512 个字符。参见 https://github.com/Microsoft/ApplicationInsights-dotnet/blob/master/src/Core/Managed/Shared/Extensibility/Implementation/Property.cs#L23
你可以把它分割成子串放在Properties集合中,每个集合值的长度是8 * 1024。我问的时候得到了这个提示。参见 https://social.msdn.microsoft.com/Forums/en-US/84bd5ade-0b21-47cc-9b39-c6c7a292d87e/dependencytelemetry-sql-command-gets-truncated?forum=ApplicationInsights。虽然我自己从未尝试过
如果您想记录 消息,那么您应该使用 AI SDK 的 trackTrace
方法,而不是 trackEvent
。 trackTrace
用于长消息并且有很大的限制:(32k!)参见 https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/Schema/PublicSchema/MessageData.bond#L13
trackEvent
用于命名为 "events",如 "opened file" 或 "clicked retry" 或 "canceled frobulating",您可能希望在其中制作图表并跟踪使用情况随着时间的推移。
您可以将自定义属性(字符串键、字符串值)和自定义指标(字符串键、双精度值)附加到任何内容。如果您在 sdk 中的事物上设置 operationId
字段,则可以通过查询轻松找到具有相同 operationId
的任何内容,或者在 Azure 门户或 Visual Studio 中可视化:
我们正在尝试使用 AppInsights trackEvent() 消息记录一些冗长的消息。但它没有登录 AppInsights 也没有给出任何错误。
请帮我记录冗长的字符串。
请告诉我们 trackEvent() 的最大限制
长度确实有限制。例如,事件的名称 属性 的限制是 512 个字符。参见 https://github.com/Microsoft/ApplicationInsights-dotnet/blob/master/src/Core/Managed/Shared/Extensibility/Implementation/Property.cs#L23
你可以把它分割成子串放在Properties集合中,每个集合值的长度是8 * 1024。我问的时候得到了这个提示。参见 https://social.msdn.microsoft.com/Forums/en-US/84bd5ade-0b21-47cc-9b39-c6c7a292d87e/dependencytelemetry-sql-command-gets-truncated?forum=ApplicationInsights。虽然我自己从未尝试过
如果您想记录 消息,那么您应该使用 AI SDK 的 trackTrace
方法,而不是 trackEvent
。 trackTrace
用于长消息并且有很大的限制:(32k!)参见 https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/Schema/PublicSchema/MessageData.bond#L13
trackEvent
用于命名为 "events",如 "opened file" 或 "clicked retry" 或 "canceled frobulating",您可能希望在其中制作图表并跟踪使用情况随着时间的推移。
您可以将自定义属性(字符串键、字符串值)和自定义指标(字符串键、双精度值)附加到任何内容。如果您在 sdk 中的事物上设置 operationId
字段,则可以通过查询轻松找到具有相同 operationId
的任何内容,或者在 Azure 门户或 Visual Studio 中可视化: