Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

azure - NODEJS code base- Logs appear twice in application insights

we are using Nodejs - AZURE Functions Application Insight Sdk and instrumentation to track end to end logs. The logs are started appearing twice and hence making lot of chaos in analyzing.

// host.json config
{

    "aggregator": {
        "batchSize": 1000,
        "flushTimeout": "00:00:30"
    },

    "logging": {
        "console": {
            "isEnabled": "false"
        },

        "fileLoggingMode": "always",
        "logLevel": {
            "default": "Information",
            "Host.Results": "Information",
            "Function": "Information",
            "Host.Aggregator": "Information"
        },

        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": false,
                "maxTelemetryItemsPerSecond": 20,
                "initialSamplingPercentage": 100.0,
                "excludedTypes": "Dependency;Event;Request;Exception"
            },
            "enableLiveMetrics": false,
            "enableDependencyTracking": false,
            "enablePerformanceCountersCollection": false,
            "httpAutoCollectionOptions": {
                "enableHttpTriggerExtendedInfoCollection": true,
                "enableW3CDistributedTracing": true,
                "enableResponseHeaderInjection": true
            }
        }
    }
}

//appInsight sdk config
  appInsights
            .setup(true)
            .setAutoDependencyCorrelation(true)
            .setAutoCollectRequests(true)
            .setAutoCollectPerformance(true,true)
            .setAutoCollectExceptions(true)
            .setAutoCollectDependencies(true)
            .setAutoCollectConsole(true)
            .setUseDiskRetryCaching(true)
            .setSendLiveMetrics(true)
            .setDistributedTracingMode(appInsights.DistributedTracingModes.AI_AND_W3C)
            .start();

Any fix for this issue?

Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...