Skip to content

Commit

Permalink
Profile test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon committed Dec 5, 2024
1 parent 771c3ca commit b47e2a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Elastic.Apm/Report/PayloadSenderV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ private void ProcessQueueItems(object[] queueItems)
}
}

if (_logger.IsEnabled(LogLevel.Trace))


stream.Position = 0;
using (var content = new StreamContent(stream))
{
Expand Down
2 changes: 2 additions & 0 deletions test/Elastic.Apm.Tests.MockApmServer/SpanContextDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Elastic.Apm.Helpers;

using Elastic.Apm.Model;
using Elastic.Apm.Report.Serialization;

// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
Expand All @@ -24,6 +25,7 @@ internal class SpanContextDto : IDto
public Http Http { get; set; }

[JsonPropertyName("tags")]
[JsonConverter(typeof(LabelsJsonConverter))]
public LabelsDictionary Labels { get; set; }

public Message Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public RabbitMqTests(RabbitMqFixture fixture, ITestOutputHelper output)
[InlineData("net8.0")]
public async Task CaptureAutoInstrumentedSpans(string targetFramework)
{
var apmLogger = new InMemoryBlockingLogger(Logging.LogLevel.Error);
var apmLogger = new InMemoryBlockingLogger(Logging.LogLevel.Warning);
var apmServer = new MockApmServer(apmLogger, nameof(CaptureAutoInstrumentedSpans));
var port = apmServer.FindAvailablePortToListen();
apmServer.RunInBackground(port);
Expand All @@ -56,6 +56,9 @@ public async Task CaptureAutoInstrumentedSpans(string targetFramework)
exception => _output.WriteLine($"{exception}"));
}

foreach (var line in apmLogger.Lines)
_output.WriteLine(line);

var transactions = apmServer.ReceivedData.Transactions;
var spans = apmServer.ReceivedData.Spans;

Expand Down

0 comments on commit b47e2a1

Please sign in to comment.