diff --git a/.github/workflows/bootstrap/action.yml b/.github/workflows/bootstrap/action.yml
index 6dd6532b3..d5b4b52d5 100644
--- a/.github/workflows/bootstrap/action.yml
+++ b/.github/workflows/bootstrap/action.yml
@@ -45,13 +45,13 @@ runs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
- 6.0.x
8.0.x
- id: dotnet
shell: bash
run: |
dotnet --list-sdks
+ dotnet --version
dotnet tool restore
AGENT_VERSION=$(dotnet minver -t=v -p=canary.0 -v=e)
echo "Version Number: ${AGENT_VERSION}"
diff --git a/.github/workflows/install-dependencies/action.yml b/.github/workflows/install-dependencies/action.yml
index df05f3bde..0b4f65c99 100644
--- a/.github/workflows/install-dependencies/action.yml
+++ b/.github/workflows/install-dependencies/action.yml
@@ -59,15 +59,15 @@
if: "${{ inputs.azure == 'true' && runner.os == 'Linux' }}"
shell: bash
run: |
- wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
+ wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
- sudo apt-get install azure-functions-core-tools-4
+ sudo apt-get install azure-functions-core-tools-4=4.0.6280-1
- name: 'Windows: Azure functions core tools'
if: "${{ inputs.azure == 'true' && runner.os == 'Windows' }}"
shell: cmd
- run: choco install azure-functions-core-tools -y --no-progress -r --version 4.0.4829
+ run: choco install azure-functions-core-tools -y --no-progress -r --version 4.0.6280
# TEST CONTAINERS CLOUD
# If no PR event or if a PR event that's caused by a non-fork and non dependabot actor
diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml
index c44a0772d..338bad2f9 100644
--- a/.github/workflows/test-linux.yml
+++ b/.github/workflows/test-linux.yml
@@ -123,7 +123,15 @@ jobs:
- name: 'Tests: Integrations'
run: ./build.sh test --test-suite integrations
-
+
+ - name: Store crash dumps
+ uses: actions/upload-artifact@v4
+ if: success() || failure()
+ with:
+ name: results
+ retention-days: 1
+ path: build/output/**/*.dmp
+
startup-hook-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
@@ -134,7 +142,7 @@ jobs:
- name: 'Tests: StartupHooks'
run: ./build.sh test --test-suite startuphooks
-
+
profiler-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml
index 610314bf7..96ac00e54 100644
--- a/.github/workflows/test-windows.yml
+++ b/.github/workflows/test-windows.yml
@@ -71,6 +71,14 @@ jobs:
- name: 'Tests: Integrations'
run: ./build.bat test --test-suite integrations
+
+ - name: Store crash dumps
+ uses: actions/upload-artifact@v4
+ if: success() || failure()
+ with:
+ name: results
+ retention-days: 1
+ path: build/output/**/*.dmp
startup-hook-tests:
runs-on: windows-2022
@@ -82,7 +90,7 @@ jobs:
- name: 'Tests: StartupHooks'
run: ./build.bat test --test-suite startuphooks
-
+
profiler-tests:
runs-on: windows-2022
needs: [ 'format', 'tests' ]
@@ -114,7 +122,6 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
-
- name: Clean the application
run: msbuild /t:Clean /p:Configuration=Release
@@ -166,7 +173,6 @@ jobs:
--logger:"junit;LogFilePath=%cd%\build\output\junit-{framework}-{assembly}.xml;MethodFormat=Class;FailureBodyFormat=Verbose"
- name: Store test results
- if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-results-iis
diff --git a/Directory.Packages.props b/Directory.Packages.props
index dc7fefcd7..8e37e4d0c 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -2,10 +2,9 @@
true
-
-
+
@@ -53,15 +52,15 @@
-
+
-
+
-
+
-
-
+
+
@@ -77,7 +76,6 @@
-
@@ -98,28 +96,26 @@
-
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -127,14 +123,14 @@
-
+
-
+
diff --git a/ElasticApmAgent.sln b/ElasticApmAgent.sln
index eb3268681..56ed373a1 100644
--- a/ElasticApmAgent.sln
+++ b/ElasticApmAgent.sln
@@ -18,9 +18,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleAspNetCoreApp", "test
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{267A241E-571F-458F-B04C-B6C4DE79E735}"
ProjectSection(SolutionItems) = preProject
+ test\.runsettings = test\.runsettings
test\Directory.Build.props = test\Directory.Build.props
test\xunit.runner.json = test\xunit.runner.json
- test\.runsettings = test\.runsettings
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elastic.Apm", "src\Elastic.Apm\Elastic.Apm.csproj", "{90BC9629-C8D2-4FD5-863E-EA2D5FB37341}"
@@ -240,6 +240,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostingTestApp", "test\inte
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Apm.Extensions.Tests.Shared", "test\integrations\Elastic.Apm.Extensions.Tests.Shared\Elastic.Apm.Extensions.Tests.Shared.csproj", "{7482D2D9-BBF7-4C8B-B26C-BEA9BCF345B0}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7A07D777-DEC2-4BB7-B4A1-028BA658762A}"
+ ProjectSection(SolutionItems) = preProject
+ Directory.Build.props = Directory.Build.props
+ Directory.Packages.props = Directory.Packages.props
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/build/scripts/Build.fs b/build/scripts/Build.fs
index af344d962..4baf887d8 100644
--- a/build/scripts/Build.fs
+++ b/build/scripts/Build.fs
@@ -173,13 +173,27 @@ module Build =
let testElseWhere = ["Tests"; "OpenTelemetry.Tests"; "StartupHook.Tests"; "Profiler.Managed.Tests"; "Azure"]
let filter = testElseWhere |> List.map (fun s -> $"FullyQualifiedName!~Elastic.Apm.%s{s}") |> String.concat "&"
Some filter
- | _ -> None
+ | _ -> None
+
+ let verbosity =
+ match suite with
+ | TestSuite.Integrations -> "detailed"
+ | _ -> "minimal"
+
+ let blame =
+ match suite with
+ | TestSuite.Integrations -> Some [
+ "--blame-hang-timeout"; "15m";
+ "--blame-crash-dump-type"; "mini";
+ "--results-directory"; "build/output"]
+ | _ -> None
let command =
- ["test"; "-c"; "Release"; sln; "--no-build"; "--verbosity"; "minimal"; "-s"; "test/.runsettings"]
+ ["test"; "-c"; "Release"; sln; "--no-build"; "--verbosity"; verbosity; "-s"; "test/.runsettings"]
@ (match filter with None -> [] | Some f -> ["--filter"; f])
@ (match framework with None -> [] | Some f -> ["-f"; f])
@ (match logger with None -> [] | Some l -> [l])
+ @ (match blame with None -> [] | Some l -> l)
@ ["--"; "RunConfiguration.CollectSourceInformation=true"]
DotNet.ExecWithTimeout command (TimeSpan.FromMinutes 30)
@@ -236,16 +250,14 @@ module Build =
ToolRestore()
DotNet.Exec ["restore" ; Paths.Solution; "-v"; "q"]
if isWindows then DotNet.Exec ["restore" ; aspNetFullFramework; "-v"; "q"]
-
let Format () =
- DotNet.Exec ["dotnet"; "format"; "--verbosity"; "quiet"; "--exclude"; "src/Elastic.Apm/Libraries/"]
-
+ DotNet.Exec ["format"; "--verbosity"; "quiet"; "--verify-no-changes"; "--exclude"; "src/Elastic.Apm/Libraries/"]
let private copyDllsAndPdbs (destination: DirectoryInfo) (source: DirectoryInfo) =
source.GetFiles()
|> Seq.filter (fun file -> file.Extension = ".dll" || file.Extension = ".pdb")
|> Seq.iter (fun file -> file.CopyTo(Path.combine destination.FullName file.Name, true) |> ignore)
- /// Creates versioned ElasticApmAgent.zip file
+ /// Creates versioned ElasticApmAgent.zip file
let AgentZip () =
let name = "ElasticApmAgent"
let currentAssemblyVersion = Versioning.CurrentVersion.FileVersion
@@ -277,7 +289,7 @@ module Build =
// assemblies compiled against 6.0 version of System.Diagnostics.DiagnosticSource
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major))
- ++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net6.0" diagnosticSourceVersion6.Major))
+ ++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net8.0" diagnosticSourceVersion6.Major))
|> Seq.filter Path.isDirectory
|> Seq.map DirectoryInfo
|> Seq.iter (copyDllsAndPdbs (agentDir.CreateSubdirectory(sprintf "%i.0.0" diagnosticSourceVersion6.Major)))
diff --git a/sample/ApiSamples/Program.cs b/sample/ApiSamples/Program.cs
index 58d3eb5dc..ef51c3f08 100644
--- a/sample/ApiSamples/Program.cs
+++ b/sample/ApiSamples/Program.cs
@@ -314,7 +314,7 @@ public static void SampleSpanWithCustomContextFillAll()
// ReSharper restore ArrangeMethodOrOperatorBody
#pragma warning restore IDE0022
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
///
/// Test for https://github.com/elastic/apm-agent-dotnet/issues/884
///
diff --git a/src/Elastic.Apm/Api/Service.cs b/src/Elastic.Apm/Api/Service.cs
index 4a827d2bd..07107c7a9 100644
--- a/src/Elastic.Apm/Api/Service.cs
+++ b/src/Elastic.Apm/Api/Service.cs
@@ -96,8 +96,8 @@ static bool CheckForLoadedAssembly(string name)
// Legacy mechanism: if the profiler is loaded add a `p` suffix to Agent.Version
service.Agent.Version += "-p";
// Check if profiler was injected via K8S hook.
- var envvars =new EnvironmentVariables(logger);
- if (envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S")
+ var envvars = new EnvironmentVariables(logger);
+ if (envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S")
|| envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S_ATTACH"))
activationMethod = Consts.ActivationK8SAttach;
else
diff --git a/src/Elastic.Apm/Elastic.Apm.csproj b/src/Elastic.Apm/Elastic.Apm.csproj
index ef7b4ae93..361acc507 100644
--- a/src/Elastic.Apm/Elastic.Apm.csproj
+++ b/src/Elastic.Apm/Elastic.Apm.csproj
@@ -1,6 +1,6 @@
- netstandard2.0;net462;net472;net6.0
+ netstandard2.0;net462;net472;net8.0true
@@ -103,7 +103,7 @@
-
+
diff --git a/src/Elastic.Apm/Filters/CookieHeaderRedactionFilter.cs b/src/Elastic.Apm/Filters/CookieHeaderRedactionFilter.cs
index ed81382fb..b8574c057 100644
--- a/src/Elastic.Apm/Filters/CookieHeaderRedactionFilter.cs
+++ b/src/Elastic.Apm/Filters/CookieHeaderRedactionFilter.cs
@@ -9,7 +9,7 @@
using Elastic.Apm.Config;
using Elastic.Apm.Helpers;
using Elastic.Apm.Model;
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
using System.Buffers;
#endif
@@ -45,7 +45,7 @@ internal static void HandleCookieHeader(Dictionary headers, IRea
// e.g. Cookies | cookies | COOKIES
const int maxKeys = 4;
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
var matchedKeys = ArrayPool.Shared.Rent(maxKeys);
var matchedValues = ArrayPool.Shared.Rent(maxKeys);
#else
@@ -81,7 +81,7 @@ internal static void HandleCookieHeader(Dictionary headers, IRea
}
}
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
ArrayPool.Shared.Return(matchedKeys);
ArrayPool.Shared.Return(matchedValues);
#endif
diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/JsonException.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/JsonException.cs
index a570b8ab7..c0548f1c2 100644
--- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/JsonException.cs
+++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/JsonException.cs
@@ -73,9 +73,11 @@ public JsonException(string message, Exception? innerException)
/// The parameter is null.
/// The class name is null or is zero (0).
public JsonException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
+#pragma warning disable SYSLIB0051
+ : base(info, context)
+#pragma warning restore SYSLIB0051
+ {
+ }
#endif
internal static JsonException Create(IJsonLineInfo lineInfo, string path, string message)
diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs
index bc8c03805..1282cd9cf 100644
--- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs
+++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs
@@ -1,4 +1,4 @@
-#region License
+#region License
// Copyright (c) 2007 James Newton-King
//
@@ -35,9 +35,11 @@
#nullable enable
namespace Elastic.Apm.Libraries.Newtonsoft.Json.Serialization
{
- internal class JsonFormatterConverter : IFormatterConverter
- {
- private readonly JsonSerializerInternalReader _reader;
+#pragma warning disable SYSLIB0050
+ internal class JsonFormatterConverter : IFormatterConverter
+#pragma warning restore SYSLIB0050
+ {
+ private readonly JsonSerializerInternalReader _reader;
private readonly JsonISerializableContract _contract;
private readonly JsonProperty? _member;
diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonObjectContract.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonObjectContract.cs
index f23fe0274..47dd88017 100644
--- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonObjectContract.cs
+++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonObjectContract.cs
@@ -1,4 +1,4 @@
-#region License
+#region License
// Copyright (c) 2007 James Newton-King
//
@@ -183,8 +183,10 @@ internal object GetUninitializedObject()
throw new JsonException("Insufficient permissions. Creating an uninitialized '{0}' type requires full trust.".FormatWith(CultureInfo.InvariantCulture, NonNullableUnderlyingType));
}
- return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType);
- }
+#pragma warning disable SYSLIB0050
+ return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType);
+#pragma warning restore SYSLIB0050
+ }
#endif
}
}
diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs
index 92ea3d3b0..ade850b08 100644
--- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs
+++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs
@@ -1552,9 +1552,11 @@ private object CreateISerializable(JsonReader reader, JsonISerializableContract
TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, "Deserializing {0} using ISerializable constructor.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);
}
- SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new JsonFormatterConverter(this, contract, member));
+#pragma warning disable SYSLIB0050
+ SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new JsonFormatterConverter(this, contract, member));
+#pragma warning restore SYSLIB0050
- bool finished = false;
+ bool finished = false;
do
{
switch (reader.TokenType)
diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs
index f79534f72..2bc1540b8 100644
--- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs
+++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs
@@ -761,10 +761,12 @@ private void SerializeISerializable(JsonWriter writer, ISerializable value, Json
WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty);
- SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new FormatterConverter());
+#pragma warning disable SYSLIB0050
+ SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new FormatterConverter());
value.GetObjectData(serializationInfo, Serializer._context);
+#pragma warning restore SYSLIB0050
- foreach (SerializationEntry serializationEntry in serializationInfo)
+ foreach (SerializationEntry serializationEntry in serializationInfo)
{
JsonContract? valueContract = GetContractSafe(serializationEntry.Value);
diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/AsyncUtils.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/AsyncUtils.cs
index 063bf03da..7fae325f5 100644
--- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/AsyncUtils.cs
+++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/AsyncUtils.cs
@@ -100,7 +100,7 @@ public static Task ReadAsync(this TextReader reader, char[] buffer, int ind
public static bool IsCompletedSucessfully(this Task task)
{
// IsCompletedSuccessfully is the faster method, but only currently exposed on .NET Core 2.0
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
return task.IsCompletedSuccessfully;
#else
return task.Status == TaskStatus.RanToCompletion;
diff --git a/src/Elastic.Apm/Logging/IApmLoggingExtensions.cs b/src/Elastic.Apm/Logging/IApmLoggingExtensions.cs
index b645b54ca..4b9b4521c 100644
--- a/src/Elastic.Apm/Logging/IApmLoggingExtensions.cs
+++ b/src/Elastic.Apm/Logging/IApmLoggingExtensions.cs
@@ -72,7 +72,7 @@ private static LogValuesFormatter GetOrAddFormatter(string message, IReadOnlyCol
return formatter;
formatter = new LogValuesFormatter(message, args);
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
Formatters.AddOrUpdate(message, formatter);
return formatter;
#else
diff --git a/src/Elastic.Apm/Logging/ScopedLogger.cs b/src/Elastic.Apm/Logging/ScopedLogger.cs
index fd01dd417..ed49289f1 100644
--- a/src/Elastic.Apm/Logging/ScopedLogger.cs
+++ b/src/Elastic.Apm/Logging/ScopedLogger.cs
@@ -30,7 +30,7 @@ internal LogValuesFormatter GetOrAddFormatter(string message, IReadOnlyCollectio
return formatter;
formatter = new LogValuesFormatter($"{{{{{{Scope}}}}}} {message}", args, Scope);
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
Formatters.AddOrUpdate(message, formatter);
return formatter;
#else
diff --git a/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs b/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs
index 0cb69e84a..025a097c6 100644
--- a/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs
+++ b/src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs
@@ -8,7 +8,7 @@
using System.Runtime.InteropServices;
using Elastic.Apm.Logging;
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
using System.Buffers;
using System.Buffers.Text;
#endif
@@ -19,7 +19,7 @@ internal static class GlobalMemoryStatus
{
public const string ProcMemInfo = "/proc/meminfo";
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
private static readonly FileStreamOptions Options = new() { BufferSize = 0, Mode = FileMode.Open, Access = FileAccess.Read };
private static readonly byte Space = (byte)' ';
@@ -57,7 +57,7 @@ internal static (long totalMemory, long availableMemory) GetTotalAndAvailableSys
}
try
{
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
using var fs = new FileStream(memInfoPath, Options);
var buffer = ArrayPool.Shared.Rent(8192); // Should easily be large enough for max meminfo file.
diff --git a/src/Elastic.Apm/Metrics/MetricsProvider/CgroupMetricsProvider.cs b/src/Elastic.Apm/Metrics/MetricsProvider/CgroupMetricsProvider.cs
index fad8b88d1..d1f64a488 100644
--- a/src/Elastic.Apm/Metrics/MetricsProvider/CgroupMetricsProvider.cs
+++ b/src/Elastic.Apm/Metrics/MetricsProvider/CgroupMetricsProvider.cs
@@ -12,7 +12,7 @@
using Elastic.Apm.Helpers;
using Elastic.Apm.Logging;
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
using System.Buffers.Text;
using System.Runtime.CompilerServices;
using System.Text;
@@ -46,7 +46,7 @@ internal class CgroupMetricsProvider : IMetricsProvider
internal static readonly Regex Cgroup2MountPoint = new("^\\d+? \\d+? .+? .+? (.*?) .*cgroup2.*cgroup.*");
internal static readonly Regex MemoryCgroup = new("^\\d+:memory:.*");
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
private static readonly FileStreamOptions Options = new() { BufferSize = 0, Mode = FileMode.Open, Access = FileAccess.Read };
#endif
@@ -316,7 +316,7 @@ private MetricSample GetMemoryMemLimitBytes()
return new MetricSample(SystemProcessCgroupMemoryMemLimitBytes, totalMemory);
}
-#if NET6_0_OR_GREATER // Optimised code for newer runtimes
+#if NET8_0_OR_GREATER // Optimised code for newer runtimes
return GetLongValueFromFile(_cGroupFiles.MaxMemoryFile, SystemProcessCgroupMemoryMemLimitBytes);
#else
using var reader = new StreamReader(_cGroupFiles.MaxMemoryFile);
@@ -339,7 +339,7 @@ private MetricSample GetMemoryMemUsageBytes()
{
try
{
-#if NET6_0_OR_GREATER // Optimised code for newer runtimes
+#if NET8_0_OR_GREATER // Optimised code for newer runtimes
return GetLongValueFromFile(_cGroupFiles.UsedMemoryFile, SystemProcessCgroupMemoryMemUsageBytes);
#else
using var reader = new StreamReader(_cGroupFiles.UsedMemoryFile);
@@ -356,7 +356,7 @@ private MetricSample GetMemoryMemUsageBytes()
return null;
}
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private MetricSample GetLongValueFromFile(string path, string sampleName)
{
diff --git a/src/Elastic.Apm/OpenTelemetry/ElasticActivityListener.cs b/src/Elastic.Apm/OpenTelemetry/ElasticActivityListener.cs
index d045e8ceb..dca9db9c7 100644
--- a/src/Elastic.Apm/OpenTelemetry/ElasticActivityListener.cs
+++ b/src/Elastic.Apm/OpenTelemetry/ElasticActivityListener.cs
@@ -200,7 +200,7 @@ private void CreateSpanForActivity(Activity activity, long timestamp, List(response.Content.ReadAsStream());
#else
var intakeResponse = _payloadItemSerializer.Deserialize(response.Content.ReadAsStreamAsync().GetAwaiter().GetResult());
diff --git a/src/azure/Elastic.Apm.Azure.ServiceBus/Elastic.Apm.Azure.ServiceBus.csproj b/src/azure/Elastic.Apm.Azure.ServiceBus/Elastic.Apm.Azure.ServiceBus.csproj
index 391eebd8a..f703a4abc 100644
--- a/src/azure/Elastic.Apm.Azure.ServiceBus/Elastic.Apm.Azure.ServiceBus.csproj
+++ b/src/azure/Elastic.Apm.Azure.ServiceBus/Elastic.Apm.Azure.ServiceBus.csproj
@@ -1,7 +1,7 @@
- netstandard2.0; net6.0
+ netstandard2.0;net8.0Elastic.Apm.Azure.ServiceBusElastic.Apm.Azure.ServiceBusElastic.Apm.Azure.ServiceBus
diff --git a/src/instrumentations/Elastic.Apm.EntityFrameworkCore/Elastic.Apm.EntityFrameworkCore.csproj b/src/instrumentations/Elastic.Apm.EntityFrameworkCore/Elastic.Apm.EntityFrameworkCore.csproj
index cbedad1a4..46bf44606 100644
--- a/src/instrumentations/Elastic.Apm.EntityFrameworkCore/Elastic.Apm.EntityFrameworkCore.csproj
+++ b/src/instrumentations/Elastic.Apm.EntityFrameworkCore/Elastic.Apm.EntityFrameworkCore.csproj
@@ -1,6 +1,6 @@
- netstandard2.0;net6.0
+ netstandard2.0;net8.0Elastic.Apm.EntityFrameworkCoreElastic.Apm.EntityFrameworkCoreElastic.Apm.EntityFrameworkCore
@@ -11,7 +11,7 @@
-
+
diff --git a/src/instrumentations/Elastic.Apm.MongoDb/LICENSE b/src/instrumentations/Elastic.Apm.MongoDb/LICENSE
index ad5f27ac6..950d224c1 100644
--- a/src/instrumentations/Elastic.Apm.MongoDb/LICENSE
+++ b/src/instrumentations/Elastic.Apm.MongoDb/LICENSE
@@ -1,208 +1,208 @@
-Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2018 Elasticsearch BV
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-==========
-Elastic.Apm.MongoDb
-----------
-
-The code for Elastic.Apm.MongoDb is based on the elastic-apm-mongo project by Vadim Hatsura (@vhatsura),
-licensed under the Apache 2.0 License. https://github.com/vhatsura/elastic-apm-mongo
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2018 Elasticsearch BV
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+==========
+Elastic.Apm.MongoDb
+----------
+
+The code for Elastic.Apm.MongoDb is based on the elastic-apm-mongo project by Vadim Hatsura (@vhatsura),
+licensed under the Apache 2.0 License. https://github.com/vhatsura/elastic-apm-mongo
diff --git a/src/integrations/Elastic.Apm.AspNetCore/ApplicationBuilderExtensions.cs b/src/integrations/Elastic.Apm.AspNetCore/ApplicationBuilderExtensions.cs
index 1efbfe841..3cc8e7465 100644
--- a/src/integrations/Elastic.Apm.AspNetCore/ApplicationBuilderExtensions.cs
+++ b/src/integrations/Elastic.Apm.AspNetCore/ApplicationBuilderExtensions.cs
@@ -93,7 +93,7 @@ params IDiagnosticsSubscriber[] subscribers
}
private static string GetEnvironmentName(this IServiceProvider serviceProvider) =>
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
(serviceProvider.GetService(typeof(IWebHostEnvironment)) as IWebHostEnvironment)?.EnvironmentName;
#else
#pragma warning disable CS0246
diff --git a/src/integrations/Elastic.Apm.AspNetCore/Elastic.Apm.AspNetCore.csproj b/src/integrations/Elastic.Apm.AspNetCore/Elastic.Apm.AspNetCore.csproj
index 245a1fe50..54566d7eb 100644
--- a/src/integrations/Elastic.Apm.AspNetCore/Elastic.Apm.AspNetCore.csproj
+++ b/src/integrations/Elastic.Apm.AspNetCore/Elastic.Apm.AspNetCore.csproj
@@ -5,7 +5,7 @@
Elastic.Apm.AspNetCoreElastic APM for ASP.NET Core. This package contains auto instrumentation for ASP.NET Core. See: https://github.com/elastic/apm-agent-dotnet/tree/main/docsapm, monitoring, elastic, elasticapm, analytics, aspnetcore
- netstandard2.0;netstandard2.1;net6.0
+ netstandard2.0;netstandard2.1;net8.0true
@@ -23,7 +23,7 @@
-
+
diff --git a/src/integrations/Elastic.Apm.Extensions.Hosting/CompositeLogger.cs b/src/integrations/Elastic.Apm.Extensions.Hosting/CompositeLogger.cs
index efa3b5039..6c3bddee8 100644
--- a/src/integrations/Elastic.Apm.Extensions.Hosting/CompositeLogger.cs
+++ b/src/integrations/Elastic.Apm.Extensions.Hosting/CompositeLogger.cs
@@ -30,6 +30,4 @@ public void Log(LogLevel level, TState state, Exception e, Func ApmLogger.IsEnabled(logLevel) || TraceLogger.IsEnabled(logLevel);
-
-
}
diff --git a/src/integrations/Elastic.Apm.Extensions.Hosting/Elastic.Apm.Extensions.Hosting.csproj b/src/integrations/Elastic.Apm.Extensions.Hosting/Elastic.Apm.Extensions.Hosting.csproj
index 96cd9a6e0..0a148d83f 100644
--- a/src/integrations/Elastic.Apm.Extensions.Hosting/Elastic.Apm.Extensions.Hosting.csproj
+++ b/src/integrations/Elastic.Apm.Extensions.Hosting/Elastic.Apm.Extensions.Hosting.csproj
@@ -4,22 +4,20 @@
Elastic.Apm.Extensions.HostingElastic APM .NET Agent. This package offers integration with Microsoft.Extensions.Hosting.IHostBuilder for agent registrationapm, monitoring, elastic, elasticapm, analytics, netcore
- netstandard2.0;net6.0
+ netstandard2.0;net8.0true
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -29,11 +27,13 @@
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/integrations/Elastic.Apm.Extensions.Hosting/ServiceCollectionExtensions.cs b/src/integrations/Elastic.Apm.Extensions.Hosting/ServiceCollectionExtensions.cs
index 2931fe1a3..afb85db01 100644
--- a/src/integrations/Elastic.Apm.Extensions.Hosting/ServiceCollectionExtensions.cs
+++ b/src/integrations/Elastic.Apm.Extensions.Hosting/ServiceCollectionExtensions.cs
@@ -106,7 +106,7 @@ public static IServiceCollection AddElasticApm(this IServiceCollection services,
}
private static string GetDefaultEnvironmentName(IServiceProvider serviceProvider) =>
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
(serviceProvider.GetService(typeof(IHostEnvironment)) as IHostEnvironment)?.EnvironmentName; // This is preferred since 3.0
#else
#pragma warning disable CS0246
diff --git a/src/integrations/Elastic.Apm.Extensions.Logging/Elastic.Apm.Extensions.Logging.csproj b/src/integrations/Elastic.Apm.Extensions.Logging/Elastic.Apm.Extensions.Logging.csproj
index 88cd762a6..0c9255e35 100644
--- a/src/integrations/Elastic.Apm.Extensions.Logging/Elastic.Apm.Extensions.Logging.csproj
+++ b/src/integrations/Elastic.Apm.Extensions.Logging/Elastic.Apm.Extensions.Logging.csproj
@@ -1,7 +1,7 @@
- netstandard2.0;net6.0
+ netstandard2.0;net8.0Elastic.Apm.Extensions.LoggingElastic.Apm.Extensions.LoggingElastic.Apm.Extensions.Logging
@@ -19,8 +19,8 @@
-
-
+
+
diff --git a/src/integrations/Elastic.Apm.NetCoreAll/Elastic.Apm.NetCoreAll.csproj b/src/integrations/Elastic.Apm.NetCoreAll/Elastic.Apm.NetCoreAll.csproj
index 1d1ba10d2..583242880 100644
--- a/src/integrations/Elastic.Apm.NetCoreAll/Elastic.Apm.NetCoreAll.csproj
+++ b/src/integrations/Elastic.Apm.NetCoreAll/Elastic.Apm.NetCoreAll.csproj
@@ -1,6 +1,6 @@
- netstandard2.0;net6.0
+ netstandard2.0;net8.0Elastic.Apm.NetCoreAllElastic.Apm.NetCoreAllElastic APM .NET agent. This is a convenient package that automatically pulls in ASP.NET Core, and Entity Framework Core auto instrumentation with the Elastic APM .NET Agent. If your application uses the Microsoft.AspNetCore.All package the easiest way to reference the Elastic APM project is to use this package. If you only need specific functionalities (e.g. EF Core monitoring, or ASP.NET Core without EF Core monitoring, etc) you can reference specific Elastic.Apm packages. See: https://github.com/elastic/apm-agent-dotnet/tree/main/docs
diff --git a/src/profiler/Elastic.Apm.Profiler.Managed.Core/Elastic.Apm.Profiler.Managed.Core.csproj b/src/profiler/Elastic.Apm.Profiler.Managed.Core/Elastic.Apm.Profiler.Managed.Core.csproj
index cc9b62bf3..ac11a7546 100644
--- a/src/profiler/Elastic.Apm.Profiler.Managed.Core/Elastic.Apm.Profiler.Managed.Core.csproj
+++ b/src/profiler/Elastic.Apm.Profiler.Managed.Core/Elastic.Apm.Profiler.Managed.Core.csproj
@@ -1,7 +1,7 @@
- net462;netstandard2.0;net6.0
+ net462;netstandard2.0;net8.0false
diff --git a/src/profiler/Elastic.Apm.Profiler.Managed/DuckTyping/DuckType.Statics.cs b/src/profiler/Elastic.Apm.Profiler.Managed/DuckTyping/DuckType.Statics.cs
index e4c1ba5c2..06e95ca64 100644
--- a/src/profiler/Elastic.Apm.Profiler.Managed/DuckTyping/DuckType.Statics.cs
+++ b/src/profiler/Elastic.Apm.Profiler.Managed/DuckTyping/DuckType.Statics.cs
@@ -66,7 +66,7 @@ public static partial class DuckType
private static Dictionary> _ignoresAccessChecksToAssembliesSetDictionary =
new Dictionary>();
#pragma warning restore IDE0044, IDE1006
-
+
internal static long AssemblyCount => _assemblyCount;
internal static long TypeCount => _typeCount;
diff --git a/test/Elastic.Apm.Tests/LoggerTests.cs b/test/Elastic.Apm.Tests/LoggerTests.cs
index 10a02acb4..1be429dd6 100644
--- a/test/Elastic.Apm.Tests/LoggerTests.cs
+++ b/test/Elastic.Apm.Tests/LoggerTests.cs
@@ -156,7 +156,7 @@ public void EnsureFormattersAreShared()
var scopedLogger = consoleLogger.Scoped("MyTestScope");
for (var i = 0; i < 10; i++)
scopedLogger.Warning()?.Log("This is a test log from the test StructuredLogTemplateWith1MissingArgument, args: {arg1}", i);
-#if NET6_0_OR_GREATER
+#if NET8_0_OR_GREATER
var cachedFormatterCount = scopedLogger.Formatters.Count();
cachedFormatterCount.Should().Be(1);
diff --git a/test/azure/Elastic.Apm.Azure.Functions.Tests/AzureFunctionsInProcessTests.cs b/test/azure/Elastic.Apm.Azure.Functions.Tests/AzureFunctionsInProcessTests.cs
index 639ec31fc..2522faa98 100644
--- a/test/azure/Elastic.Apm.Azure.Functions.Tests/AzureFunctionsInProcessTests.cs
+++ b/test/azure/Elastic.Apm.Azure.Functions.Tests/AzureFunctionsInProcessTests.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information
using System.Threading.Tasks;
+using Elastic.Apm.Tests.Utilities.XUnit;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
@@ -17,8 +18,7 @@ public class AzureFunctionsInProcessTests : AzureFunctionsTestBase, IClassFixtur
public AzureFunctionsInProcessTests(ITestOutputHelper output, InProcessContext context)
: base(output, context) { }
-
- [Fact]
+ [FlakyCiTestFact(2501)]
public async Task Invoke_Http_Ok()
{
var transaction = await InvokeAndAssertFunction(SampleHttpTrigger);
@@ -28,7 +28,7 @@ public async Task Invoke_Http_Ok()
transaction.Context.Response.StatusCode.Should().Be(200);
}
- [Fact]
+ [FlakyCiTestFact(2501)]
public async Task Invoke_Http_InternalServerError()
{
var transaction = await InvokeAndAssertFunction(HttpTriggerWithInternalServerError);
@@ -38,7 +38,7 @@ public async Task Invoke_Http_InternalServerError()
transaction.Context.Response.StatusCode.Should().Be(500);
}
- [Fact]
+ [FlakyCiTestFact(2501)]
public async Task Invoke_Http_FunctionThrowsException()
{
var transaction = await InvokeAndAssertFunction(HttpTriggerWithException);
@@ -49,7 +49,7 @@ public async Task Invoke_Http_FunctionThrowsException()
transaction.Context.Response.StatusCode.Should().Be(500);
}
- [Fact]
+ [FlakyCiTestFact(2501)]
public async Task Invoke_Http_NotFound()
{
var transaction = await InvokeAndAssertFunction(HttpTriggerWithNotFound);
diff --git a/test/azure/applications/Elastic.Apm.AzureFunctionApp.Core/Elastic.Apm.AzureFunctionApp.Core.csproj b/test/azure/applications/Elastic.Apm.AzureFunctionApp.Core/Elastic.Apm.AzureFunctionApp.Core.csproj
index 7728c0570..5850f50c5 100644
--- a/test/azure/applications/Elastic.Apm.AzureFunctionApp.Core/Elastic.Apm.AzureFunctionApp.Core.csproj
+++ b/test/azure/applications/Elastic.Apm.AzureFunctionApp.Core/Elastic.Apm.AzureFunctionApp.Core.csproj
@@ -1,7 +1,7 @@
- net6.0;net8.0
+ net8.0enableenablefalse
diff --git a/test/azure/applications/Elastic.AzureFunctionApp.InProcess/Elastic.AzureFunctionApp.InProcess.csproj b/test/azure/applications/Elastic.AzureFunctionApp.InProcess/Elastic.AzureFunctionApp.InProcess.csproj
index 8bb50ce7e..54fda31ea 100644
--- a/test/azure/applications/Elastic.AzureFunctionApp.InProcess/Elastic.AzureFunctionApp.InProcess.csproj
+++ b/test/azure/applications/Elastic.AzureFunctionApp.InProcess/Elastic.AzureFunctionApp.InProcess.csproj
@@ -1,6 +1,6 @@
- net6.0
+ net8.0v4Libraryenable
diff --git a/test/azure/applications/Elastic.AzureFunctionApp.InProcess/local.settings.json b/test/azure/applications/Elastic.AzureFunctionApp.InProcess/local.settings.json
index 320edb1e3..fd2cd88b4 100644
--- a/test/azure/applications/Elastic.AzureFunctionApp.InProcess/local.settings.json
+++ b/test/azure/applications/Elastic.AzureFunctionApp.InProcess/local.settings.json
@@ -5,7 +5,8 @@
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_EXTENSION_VERSION": "4",
"WEBSITE_OWNER_NAME": "abcd1234-abcd-acdc-1234-112233445566+testfaas_group-CentralUSwebspace-Linux",
- "WEBSITE_SITE_NAME": "testfaas"
+ "WEBSITE_SITE_NAME": "testfaas",
+ "FUNCTIONS_INPROC_NET8_ENABLED": "1"
// Include this breaks on the latest version of func - Excluding it for now.
//"WEBSITE_INSTANCE_ID": "20367ea8-70b9-41b4-a552-b2a826b3aa0b"
},
diff --git a/test/integrations/Elastic.Apm.AspNetCore.Tests/AspNetCoreBasicTests.cs b/test/integrations/Elastic.Apm.AspNetCore.Tests/AspNetCoreBasicTests.cs
index 10f38113d..137eeb935 100644
--- a/test/integrations/Elastic.Apm.AspNetCore.Tests/AspNetCoreBasicTests.cs
+++ b/test/integrations/Elastic.Apm.AspNetCore.Tests/AspNetCoreBasicTests.cs
@@ -89,9 +89,7 @@ public async Task HomeSimplePageTransactionTest()
var aspNetCoreVersion = Assembly.Load("Microsoft.AspNetCore").GetName().Version.ToString();
agent.Service.Framework.Version.Should().Be(aspNetCoreVersion);
-#if NET6_0
- agent.Service.Runtime.Name.Should().Be(Runtime.DotNetName + " 6");
-#elif NET8_0
+#if NET8_0
agent.Service.Runtime.Name.Should().Be(Runtime.DotNetName + " 8");
#else
agent.Service.Runtime.Name.Should().Be(Runtime.DotNetCoreName);
diff --git a/test/integrations/applications/SampleAspNetCoreApp/SampleAspNetCoreApp.csproj b/test/integrations/applications/SampleAspNetCoreApp/SampleAspNetCoreApp.csproj
index 09e04e82c..758744247 100644
--- a/test/integrations/applications/SampleAspNetCoreApp/SampleAspNetCoreApp.csproj
+++ b/test/integrations/applications/SampleAspNetCoreApp/SampleAspNetCoreApp.csproj
@@ -1,7 +1,7 @@
- net6.0;net8.0
+ net8.0falseAnyCPU
@@ -16,14 +16,6 @@
-
-
-
-
-
-
-
-
diff --git a/test/integrations/applications/SampleConsoleNetCoreApp/SampleConsoleNetCoreApp.csproj b/test/integrations/applications/SampleConsoleNetCoreApp/SampleConsoleNetCoreApp.csproj
index 2000ec119..cf1be170e 100644
--- a/test/integrations/applications/SampleConsoleNetCoreApp/SampleConsoleNetCoreApp.csproj
+++ b/test/integrations/applications/SampleConsoleNetCoreApp/SampleConsoleNetCoreApp.csproj
@@ -2,7 +2,7 @@
Exe
- net6.0;net8.0
+ net8.0
diff --git a/test/integrations/applications/WebApiSample/WebApiSample.csproj b/test/integrations/applications/WebApiSample/WebApiSample.csproj
index 64c89df05..1c3b77682 100644
--- a/test/integrations/applications/WebApiSample/WebApiSample.csproj
+++ b/test/integrations/applications/WebApiSample/WebApiSample.csproj
@@ -1,7 +1,7 @@
- net6.0;net8.0
+ net8.0false
diff --git a/test/profiler/Elastic.Apm.Profiler.Managed.Tests/AdoNet/AdoNetTestData.cs b/test/profiler/Elastic.Apm.Profiler.Managed.Tests/AdoNet/AdoNetTestData.cs
index 01379b4ac..5da7a6574 100644
--- a/test/profiler/Elastic.Apm.Profiler.Managed.Tests/AdoNet/AdoNetTestData.cs
+++ b/test/profiler/Elastic.Apm.Profiler.Managed.Tests/AdoNet/AdoNetTestData.cs
@@ -20,7 +20,6 @@ public IEnumerator