Reproduction:
using System;
|
using System.Diagnostics;
|
using System.Linq;
|
using System.Threading.Tasks;
|
using Couchbase.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
|
var serviceProvider = new ServiceCollection()
|
.AddLogging()
|
.AddCouchbase(options =>
|
{
|
options.ConnectionString = "couchbase://localhost";
|
options.ThresholdOptions!.Enabled = true;
|
options.UserName = "Administrator";
|
options.Password = "password";
|
})
|
.BuildServiceProvider();
|
|
var tasks = Enumerable.Range(1, 100)
|
.Select(i => Task.Run(async () =>
|
{
|
for (var j = 1; j <= 1000; j++)
|
{
|
var activity = new Activity("MyTestActivity")
|
.AddTag("key", (i * j).ToString())
|
.Start();
|
|
var bucket = await serviceProvider.GetRequiredService<IBucketProvider>().GetBucketAsync("default");
|
var collection = bucket.DefaultCollection();
|
|
await collection.UpsertAsync($"doc-{i*j}", new {i = i*j});
|
|
activity.Stop();
|
}
|
}));
|
|
await Task.WhenAll(tasks);
|
Note that when the connection pool scales up after 30 seconds of load, the activity from the original operation is the parent of the "initialize_connection" span. This is keeping the same activity alive for the entire life of the application. Combined that with PropagateTagsUpwards and the same Activity keeps getting more tags for every scale up operation or replacement of a dead connection. On top of that, Activity stores tags as a linked list, just pushing new tags in front. So as the same tag key is added repeatedly, it doesn't overwrite the previous value and instead adds a new tag to the linked list.
Reproduction:
.AddLogging()
.AddCouchbase(options =>
{
})
.BuildServiceProvider();
{
{
.Start();
activity.Stop();
}
}));
Note that when the connection pool scales up after 30 seconds of load, the activity from the original operation is the parent of the "initialize_connection" span. This is keeping the same activity alive for the entire life of the application. Combined that with PropagateTagsUpwards and the same Activity keeps getting more tags for every scale up operation or replacement of a dead connection. On top of that, Activity stores tags as a linked list, just pushing new tags in front. So as the same tag key is added repeatedly, it doesn't overwrite the previous value and instead adds a new tag to the linked list.