Skip to content

Commit

Permalink
some telemetry stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
brycecoon committed Mar 15, 2024
2 parents 783d746 + 66b01ab commit 49ed346
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
75 changes: 73 additions & 2 deletions .github/workflows/aaronrunner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,79 @@ jobs:
run: |
rm -rf ./ticketsrus-aaron-bryce-carlos
- name: "clone"
run: git clone https://${{secrets.AARON_SECRET_GITHUB}}@github.com/SnowSE/ticketsrus-aaron-bryce-carlos.git
run: git clone https://${{secrets.AARON_MAR_SECRET}}@github.com/SnowSE/ticketsrus-aaron-bryce-carlos.git
- name: "linting is so simple once their is an .editorconfig"
run: |
cd ./ticketsrus-aaron-bryce-carlos
dotnet format --verify-no-changes
- name: "Integration tests"
# when running this command on the command line, add -it remove --user stuff
# sad I didn't get it to all run in docker
#run: docker run --rm -v "$(pwd):/app" -w /app/TestTicket -e DOTNET_CLI_HOME="/tmp/dotnet" --user $(id -u):$(id -g) mcr.microsoft.com/dotnet/sdk:8.0 dotnet test
run: |
cd ./ticketsrus-aaron-bryce-carlos/TestTicket
dotnet test
- name: "unit tests"
run: |
cd ./ticketsrus-aaron-bryce-carlos/UnitTest
dotnet test
# - name: "build with warnings"
# run: |
# cd ./ticketsrus-aaron-bryce-carlos
# dotnet build -warnaserror
- name: "run build"
run: |
cd ./ticketsrus-aaron-bryce-carlos/AaronDocker
docker compose up --build -d
docker compose up --build -d
# - name: "Teams Notification"
# uses: skitionek/notify-microsoft-teams@master
# if: failure()
# with:
# webhook_url: ${{ secrets.AARONWEBHOOK }}
# needs: ${{ toJson(needs) }}
# job: ${{ toJson(job) }}
# steps: ${{ toJson(steps) }}
- name: "Failure Notification"
uses: skitionek/notify-microsoft-teams@master
if: failure()
with:
webhook_url: ${{ secrets.AARONWEBHOOK}}
raw: >-
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"correlationId": "0b72cc8a2cea509ba06b41892066784d7f602834",
"themeColor": "#345",
"title": "Aaron had a bad workflow, much shame",
"summary": "[SnowSE/ticketsrus-aaron-bryce-carlos](https://github.com/SnowSE/ticketsrus-aaron-bryce-carlos)",
"sections": [
{
"activityTitle": "",
"activitySubtitle": "failure",
"activityImage": "https://cdn4.iconfinder.com/data/icons/web-design-and-development-88/64/web_application_error_crash_error-512.png"
}
],
"potentialAction": [
{
"@type": "OpenUri",
"name": "Repository",
"targets": [
{
"os": "default",
"uri": "https://github.com/SnowSE/ticketsrus-aaron-bryce-carlos"
}
]
},
{
"@type": "OpenUri",
"name": "Compare",
"targets": [
{
"os": "default",
"uri": "https://github.com/SnowSE/ticketsrus-aaron-bryce-carlos/"
}
]
}
],
"text": ""
}
25 changes: 25 additions & 0 deletions BlazorTickets/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Diagnostics.HealthChecks;
<<<<<<< HEAD

Check failure on line 9 in BlazorTickets/Program.cs

View workflow job for this annotation

GitHub Actions / test

Merge conflict marker encountered
using Microsoft.Extensions.Logging;
using OpenTelemetry;
using OpenTelemetry.Logs;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
=======

Check failure on line 16 in BlazorTickets/Program.cs

View workflow job for this annotation

GitHub Actions / test

Merge conflict marker encountered
//using OpenTelemetry.Logs;
//using OpenTelemetry.Metrics;
//using OpenTelemetry.Resources;
//using OpenTelemetry.Trace;
>>>>>>> 66b01ab1230c00046ec42d5b2d49ae1a2c7ce667

Check failure on line 21 in BlazorTickets/Program.cs

View workflow job for this annotation

GitHub Actions / test

Merge conflict marker encountered
using TicketLibrary.Services;

var builder = WebApplication.CreateBuilder(args);
Expand All @@ -20,6 +27,7 @@
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();

//int aaronsBadWarn = 7;

builder.Services.AddScoped<ITicketService, WebTicketService>();
builder.Services.AddScoped<IEventService, WebEventService>();
Expand All @@ -32,6 +40,7 @@
builder.Services.AddHealthChecks();
builder.Services.AddLogging();

<<<<<<< HEAD

Check failure on line 43 in BlazorTickets/Program.cs

View workflow job for this annotation

GitHub Actions / test

Merge conflict marker encountered
const string serviceName = "bryceservice";
var serviceVersion = "1.0.0";

Expand All @@ -46,6 +55,22 @@
o.Endpoint = new Uri("http://otel-collector:4317")
);
});
=======

Check failure on line 58 in BlazorTickets/Program.cs

View workflow job for this annotation

GitHub Actions / test

Merge conflict marker encountered
//const string serviceName = "bryceservice";

//builder.Logging.AddOpenTelemetry(options =>
//{
// options
// .SetResourceBuilder(
// ResourceBuilder.CreateDefault()
// .AddService(serviceName))
// .AddOtlpExporter(opt =>
// {
// opt.Endpoint = new Uri("http://otel-collector:4317/");
// })
// .AddConsoleExporter();
//});
>>>>>>> 66b01ab1230c00046ec42d5b2d49ae1a2c7ce667

Check failure on line 73 in BlazorTickets/Program.cs

View workflow job for this annotation

GitHub Actions / test

Merge conflict marker encountered

builder.Services.AddOpenTelemetry()
.ConfigureResource(r => r.AddService(serviceName))
Expand Down
2 changes: 1 addition & 1 deletion TestTicket/TicketTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TicketTests(TicketFactory factory) : IClassFixture<TicketFactory>
[Fact]
public void CanHavePassingTest()
{
Assert.Equal(2, 1);
Assert.Equal(1, 1);
}


Expand Down

0 comments on commit 49ed346

Please sign in to comment.