4f04e9e1b5
* add metrics to host apps * merge fixes and compiles * Use ME.Console and OTel for logging to correlate * clean up * clean up for metrics * fix self-review comments * fix seq initialization * clean up for http traces and rhino 8 * use latest SDK * formatting
23 lines
510 B
C#
23 lines
510 B
C#
using OpenTelemetry;
|
|
using OpenTelemetry.Logs;
|
|
|
|
namespace Speckle.Connectors.Logging;
|
|
|
|
internal sealed class ActivityScopeLogProcessor : BaseProcessor<LogRecord>
|
|
{
|
|
public override void OnEnd(LogRecord data)
|
|
{
|
|
if (ActivityScope.Tags.Count > 0)
|
|
{
|
|
if (data.Attributes is null)
|
|
{
|
|
data.Attributes = ActivityScope.TagsList;
|
|
}
|
|
else if (data.Attributes.Count > 0)
|
|
{
|
|
data.Attributes = data.Attributes.Concat(ActivityScope.Tags).ToList();
|
|
}
|
|
}
|
|
}
|
|
}
|