Skip to content

Commit

Permalink
Merge branch 'main' into feature/reenable-iis-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored Dec 13, 2023
2 parents 0474be2 + ebd4be9 commit 2217d64
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} "build/output/ElasticApmAgent_*.zip" "build/output/elastic_apm_profiler_*.zip"
gh release upload ${{ github.ref_name }} "build/output/ElasticApmAgent_${{ steps.bootstrap.outputs.agent-version }}.zip" "build/output/elastic_apm_profiler_${{ steps.bootstrap.outputs.agent-version }}-linux-x64.zip"
- if: ${{ success() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true #continue for now until we see it working in action
run: |
gh release upload ${{ github.ref_name }} "build/output/elastic_apm_profiler_*.zip"
gh release upload ${{ github.ref_name }} "build/output/elastic_apm_profiler_${{ steps.bootstrap.outputs.agent-version }}-win-x64.zip"
post-release:
needs: [ 'release-windows']
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-windows-iis-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
report:
runs-on: ubuntu-latest
name: IIS Test Summary
# disable IIS on CI for now.
# Run locally and started failing randomly on github actions
# Could be because of plethora of reasons including no disk space
# Requires longer investigation
if: ${{ false }}
steps:
- uses: elastic/apm-pipeline-library/.github/actions/test-report@current
with:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ endif::[]
[[release-notes-1.x]]
=== .NET Agent version 1.x
[[release-notes-1.25.2]]
==== 1.25.2
This release fixes a bug in `Elastic.Apm.AspNetCore` when using ` UseElasticApm()` not correctly setting status codes.
The bug was not present in the more commonly used `Elastic.Apm.NetCoreAll` since it uses a `DiagnosticListener` approach.
With this release we ensure both packages use the exact same `DiagnosticListener` mechanism to instrument ASP.NET Core.
===== Bug fixes
{pull}2213[#2213] Remove ApmMiddleWare, only use DiagnosticSource listener for ASP.NET Core.
{pull}2239[#2239] Move StartupHooks over to netstandard2.0.
[[release-notes-1.25.1]]
==== 1.25.1
Expand Down
6 changes: 3 additions & 3 deletions build/scripts/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ module Build =
agentDir.Create()

// copy startup hook to root of agent directory
!! (Paths.BuildOutput "ElasticApmAgentStartupHook/netcoreapp2.2")
!! (Paths.BuildOutput "ElasticApmAgentStartupHook/netstandard2.0")
|> Seq.filter Path.isDirectory
|> Seq.map DirectoryInfo
|> Seq.iter (copyDllsAndPdbs agentDir)
Expand All @@ -231,14 +231,14 @@ module Build =
|> Seq.iter (copyDllsAndPdbs (agentDir.CreateSubdirectory(sprintf "%i.0.0" getCurrentApmDiagnosticSourceVersion.Major)))

// assemblies compiled against older version of System.Diagnostics.DiagnosticSource
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netcoreapp2.2" oldDiagnosticSourceVersion.Major))
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major))
++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major))
|> Seq.filter Path.isDirectory
|> Seq.map DirectoryInfo
|> Seq.iter (copyDllsAndPdbs (agentDir.CreateSubdirectory(sprintf "%i.0.0" oldDiagnosticSourceVersion.Major)))

// assemblies compiled against 6.0 version of System.Diagnostics.DiagnosticSource
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netcoreapp2.2" oldDiagnosticSourceVersion.Major)) //using old version here, because it the netcoreapp2.2 app can't build with diagnosticsource6
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major)) //using old version here, because it the netcoreapp2.2 app can't build with diagnosticsource6
++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net6.0" diagnosticSourceVersion6.Major))
|> Seq.filter Path.isDirectory
|> Seq.map DirectoryInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- TODO make this netstandard 2.0 and ref System.Runtime.Loader -->
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Elastic.Apm\Elastic.Apm.csproj" />
<ProjectReference Include="..\..\integrations\Elastic.Apm.AspNetCore\Elastic.Apm.AspNetCore.csproj" />
<ProjectReference Include="..\..\instrumentations\Elastic.Apm.Elasticsearch\Elastic.Apm.Elasticsearch.csproj" />
<ProjectReference Include="..\..\instrumentations\Elastic.Apm.EntityFrameworkCore\Elastic.Apm.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\instrumentations\Elastic.Apm.GrpcClient\Elastic.Apm.GrpcClient.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Elastic.Apm\Elastic.Apm.csproj"/>
<ProjectReference Include="..\..\integrations\Elastic.Apm.AspNetCore\Elastic.Apm.AspNetCore.csproj"/>
<ProjectReference Include="..\..\instrumentations\Elastic.Apm.Elasticsearch\Elastic.Apm.Elasticsearch.csproj"/>
<ProjectReference Include="..\..\instrumentations\Elastic.Apm.EntityFrameworkCore\Elastic.Apm.EntityFrameworkCore.csproj"/>
<ProjectReference Include="..\..\instrumentations\Elastic.Apm.GrpcClient\Elastic.Apm.GrpcClient.csproj"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0"/>
</ItemGroup>

<ItemGroup>
<Compile Include="..\ElasticApmAgentStartupHook\StartupHookLogger.cs">
<Link>StartupHookLogger.cs</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Include="..\ElasticApmAgentStartupHook\StartupHookLogger.cs">
<Link>StartupHookLogger.cs</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- TODO make this netstandard 2.0 and ref System.Runtime.Loader -->
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>ElasticApmAgentStartupHook</AssemblyName>
<IsPackable>false</IsPackable>
<RootNamespace>ElasticApmStartupHook</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
</Project>
24 changes: 12 additions & 12 deletions src/startuphook/ElasticApmAgentStartupHook/StartupHookLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public static StartupHookLogger Create()

public void WriteLine(string message)
{
if (_enabled)
if (!_enabled)
return;

try
{
var log = $"[{DateTime.Now:u}] {message}";
Console.Out.WriteLine(log);
Console.Out.Flush();
File.AppendAllLines(_logPath, new[] { log });
}
catch
{
try
{
var log = $"[{DateTime.Now:u}] {message}";
Console.Out.WriteLine(log);
Console.Out.Flush();
File.AppendAllLines(_logPath, new[] { log });
}
catch
{
// if we can't log a log message, there's not much that can be done, so ignore
}
// if we can't log a log message, there's not much that can be done, so ignore
}
}
}
Expand Down

0 comments on commit 2217d64

Please sign in to comment.