-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Implement #73 integration tests for .NET This adds .NET auto attachment tests * make sure we get the logs for dotnet-test-app not java-test-app * ensure app logs at trace level * enable stdout logging * ensure we use /elastic/apm/ as mount path * update agent_has_started grep for agent presence * :grep => grep, trying out fleet but its VI bindings are still crap :) * more info from agent_has_started.sh * simpler grep
- Loading branch information
Showing
10 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ main | |
|
||
.webhook | ||
.vscode | ||
.idea | ||
bin | ||
|
||
html_docs | ||
html_docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin | ||
obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# https://hub.docker.com/_/microsoft-dotnet | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
WORKDIR /source | ||
|
||
# copy csproj and restore as distinct layers | ||
COPY *.csproj . | ||
RUN dotnet restore | ||
|
||
# copy everything else and build app | ||
COPY . . | ||
RUN dotnet publish -c release -o /app --no-restore | ||
|
||
# final stage/image | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 | ||
WORKDIR /app | ||
COPY --from=build /app ./ | ||
ENV ELASTIC_APM_PROFILER_LOG_TARGETS=stdout;file | ||
ENV ELASTIC_APM_PROFILER_LOG=trace | ||
ENTRYPOINT ["dotnet", "dotnetapp.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var builder = WebApplication.CreateBuilder(args); | ||
_ = builder.Logging.SetMinimumLevel(LogLevel.Trace); | ||
var app = builder.Build(); | ||
|
||
app.MapGet("/", () => "Hello World!"); | ||
|
||
app.Run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
#initial 10 second delay for restricted CPUs making agent slow starting | ||
sleep 10 | ||
START_MESSAGE=`kubectl logs dotnet-test-app | grep 'Elastic APM .NET Agent, version'` | ||
if [ "x$START_MESSAGE" = "x" ] | ||
then | ||
echo "APM Agent appears to have not been started" | ||
exit 1 | ||
else | ||
echo "Found APM agent in the kubctl logs" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dotnet-test-app | ||
annotations: | ||
co.elastic.apm/attach: dotnet | ||
labels: | ||
app: dotnet-test-app | ||
spec: | ||
containers: | ||
- image: localhost:5001/registry/dotnet-test-app | ||
imagePullPolicy: Always | ||
name: dotnet-test-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters