0

This trace message is popping up all over our AppInsights instance. I don't know what is means, or what could be the cause. I'm happy to provide any details that can help debug.

Trace message

AI (Internal): ERROR: Exception in Command Processing for EventSource Microsoft-ApplicationInsights-Core: An instance of EventSource with Guid 74af9f20-af6a-5582-9382-f21f674fb271 already exists.

sdkVersion : dotnet:2.7.2-23439

Code Sample :

        [FunctionName("UpdateFunction")]
    public async static Task Run(
        [EventHubTrigger("Product-events", Connection = "EventHubConnectionString", ConsumerGroup = "%ConsumerGroupName%")]Message[] objMessage,
        [Blob("%ProductBlobContainerName%", System.IO.FileAccess.Read, Connection = "BlobStorageConnectionString")] CloudBlobContainer productblobContainer,
        [CosmosDB(databaseName: "DatabaseName", collectionName: "procudtCollectionName", ConnectionStringSetting = "DBConnectionString")]DocumentClient client,
        ExecutionContext context, ILogger log)
    {
        TelemetryClient telemetry = TelemetryCreation.Instantiate(context);
        ConcurrentBag<int> DocumentToInsert= new ConcurrentBag<int>();
        ConcurrentBag<Message> DocumentToBeDeleted = new ConcurrentBag<Message>();
        try
        {
            telemetry.TrackTrace($"{context.FunctionName} Started", SeverityLevel.Information, new Dictionary<string, string>
            {
                {
                    "PrefixName",
                    objMessage[0].ToString()
                },
                {
                    "NumberOfMsgs",
                    objMessage.Length.ToString()
                }
            });

            await UpsertProvider(objMessage, productblobContainer, client, telemetry, DocumentToInsert, DocumentToBeDeleted);
            if (DocumentToBeDeleted.Count > 0)
            {
                DeleteProviders.DeleteProvider(DocumentToBeDeleted.ToArray(), client, context, telemetry);
            }

            telemetry.TrackTrace($"{context.FunctionName} Completed", SeverityLevel.Information);
        }
        catch (Exception ex)
        {
            telemetry.TrackException(ex, new Dictionary<string, string> {
                { "Azure Background Function Name",context.FunctionName },
                { "Read Data from container > folder",  productblobContainer.ToString() + ">" + objMessage[0].PrefixName.ToString()},
                { "Total Documents received", objMessage.Length.ToString() },
                { "Number of documents to insert", DocumentToInsert.Count.ToString() },
                 { "List of Documents to be updated", JsonConvert.SerializeObject(DocumentToInsert).ToString() },
                { "Number of documents skipped (Location is null)", DocumentToBeDeleted.Count.ToString() },
                { "List of Documents skipped", JsonConvert.SerializeObject(DocumentToBeDeleted).ToString() },
                { "Exception Message",ex.Message },
                { "Exception InnerMessage",ex.InnerException.ToString() }
                });

            throw;
        }
    }
Rahul Modi
  • 748
  • 11
  • 21
  • Could you please share the code snippet, where you are getting this error – Mohit Verma Jan 28 '19 at 11:50
  • Can you provide more information about your scenario and your function's setup? Are you performing logging operations within your Function or using a custom logger? – Katy Shimizu Jan 29 '19 at 01:43
  • @MohitVerma-MSFT shared a code, Please look once and provide a solution if any. – Rahul Modi Jan 29 '19 at 09:27
  • @KatyShimizu shared a code, Please look once and provide a solution if any. – Rahul Modi Jan 29 '19 at 09:28
  • What is the version of application insight. is it lower or equal than 2.7.2? If not can you try to down grade and see. Also make sure your function doesn't have both the version. Check this thread : https://github.com/Microsoft/ApplicationInsights-dotnet/issues/973 – Mohit Verma Jan 29 '19 at 09:44
  • @MohitVerma-MSFT “Microsoft.ApplicationInsights 2.8.1“ currently. trying to remove package or downgrade it. – Rahul Modi Jan 29 '19 at 09:47

0 Answers0