属性 MS_ 出现在 ApplicationInsights 中的 属性 名称中

Attributes MS_ appears in the property name in ApplicationInsights

使用 Serilog 在 ApplicationInsights 中记录信息后,以下属性 MS_ 出现在 属性 名称中。这是什么意思,可以删除吗?

MS_OperationContext MS_HostInstanceId MS_FunctionName

After logging information in ApplicationInsights using a Serilog, the following attributes MS_ appears in the property name. What does it mean and can it be removed?

它的 属性 命名或自定义维度命名约定似乎是设计使然,即 MS_PropertyName


namespace Microsoft.Azure.WebJobs.Logging
{
    /// <summary>
    /// A collection of constants used for logging scope keys.
    /// </summary>
    public static class ScopeKeys
    {
        /// <summary>
        /// A key identifying the function invocation id.
        /// </summary>
        public const string FunctionInvocationId = "MS_FunctionInvocationId";

        /// <summary>
        /// A key identifying the function name.
        /// </summary>
        public const string FunctionName = "MS_FunctionName";

        /// <summary>
        /// A key identifying the event starting with the current scope
        /// </summary>
        public const string Event = "MS_Event";

        /// <summary>
        /// A key identifying the current host instance.
        /// </summary>
        public const string HostInstanceId = "MS_HostInstanceId";

        /// <summary>
        /// A key identifying the current invocation trigger details.
        /// </summary>
        public const string TriggerDetails = "MS_TriggerDetails";
    }
}

可以参考Custom dimension in app insight changed name for FunctionName, ScopeKeys.cs LogWarning 将 LogLevel 显示为信息