Skip to content

Commit

Permalink
Update to OTel 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miniduikboot committed Nov 7, 2024
1 parent 72dfc13 commit b0e417b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 69 deletions.
32 changes: 13 additions & 19 deletions Boot.Metrics/Boot.Metrics.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<?xml version="1.0"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<VersionPrefix>9999</VersionPrefix>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
Expand All @@ -13,27 +12,22 @@
<CodeAnalysisRuleSet>../ProjectRules.ruleset</CodeAnalysisRuleSet>
<IsPackable>true</IsPackable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

<Description>Exposes OpenTelemetry/Prometheus metrics</Description>
<Authors>miniduikboot</Authors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Impostor.Api" Version="1.9.2" ExcludeAssets="runtime" />

<PackageReference Include="Impostor.Api" Version="1.9.2" ExcludeAssets="runtime"/>
<!-- OpenTelemetry -->
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.5" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.1" />

<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.9.0"/>
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.9.0-beta.2"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.7"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0"/>
<!-- Code style libraries -->
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.26.0.92422" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<AdditionalFiles Include="../stylecop.json" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" PrivateAssets="all"/>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all"/>
<AdditionalFiles Include="../stylecop.json"/>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Boot.Metrics/ClientMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void OnClientConnected(IClientConnectedEvent e)
_totalClientCounter.Add(1, GetClientTags(e.Client));
}

private TagList GetClientTags(IClient client)
private static TagList GetClientTags(IClient client)
{
return new TagList
{
Expand Down
2 changes: 1 addition & 1 deletion Boot.Metrics/GameMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void OnGameStarted(IGameStartedEvent e)
_totalGameCounter.Add(1, GetGameTags(e.Game, MetricsProfile.StartedGames));
}

private TagList GetGameTags(IGame game, MetricsProfile profile)
private static TagList GetGameTags(IGame game, MetricsProfile profile)
{
// Bucket playercount above 20 to reduce cardinality
var playerCount = game.PlayerCount;
Expand Down
89 changes: 41 additions & 48 deletions Boot.Metrics/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,77 +16,75 @@
},
"OpenTelemetry.Exporter.Console": {
"type": "Direct",
"requested": "[1.8.1, )",
"resolved": "1.8.1",
"contentHash": "XmMaxVoJjVYwEpV3XCvntSGbmRelhQv0gT1JSTRK5BRXgq7OunU18GJtJsgkQW0bRf1y4nevkxo5QDts62j41Q==",
"requested": "[1.9.0, )",
"resolved": "1.9.0",
"contentHash": "TbScDLSc6kcji+/wZYIf8/HBV2SnttzN7PNxr3TYczlmGlU4K2ugujp6seSktEO4OaAvKRd7Y3CG3SKNj0C+1Q==",
"dependencies": {
"OpenTelemetry": "1.8.1",
"System.Text.Encodings.Web": "4.7.2",
"System.Text.Json": "4.7.2"
"OpenTelemetry": "1.9.0"
}
},
"OpenTelemetry.Exporter.Prometheus.AspNetCore": {
"type": "Direct",
"requested": "[1.7.0-rc.1, )",
"resolved": "1.7.0-rc.1",
"contentHash": "tlA8oDOZoyFAkKA5StEPdzCyFf/6N/8y0Ymjae1dJYEfxPmNrcrtEHxuxtd0h5GwrIKnVpkb/hJMopHOErnSqQ==",
"requested": "[1.9.0-beta.2, )",
"resolved": "1.9.0-beta.2",
"contentHash": "JZXcHp2MkV/as8aLyJDapWkSNLhaQUWNnG1u2oOssq8Sg8217cX8D782sNJSzb7UfhzscR8pbzv6RZTsmPcHVw==",
"dependencies": {
"OpenTelemetry": "1.7.0-rc.1"
"OpenTelemetry": "[1.9.0, 2.0.0)"
}
},
"OpenTelemetry.Extensions.Hosting": {
"type": "Direct",
"requested": "[1.8.1, )",
"resolved": "1.8.1",
"contentHash": "vAiiKFPGDUkCUu+edSZf95n33AC7VdynDG+wF+KolTQL+8YphlvQ5wn06PDegD0CJVqk8imwqN+LCb/JjsGxKA==",
"requested": "[1.9.0, )",
"resolved": "1.9.0",
"contentHash": "QBQPrKDVCXxTBE+r8tgjmFNKKHi4sKyczmip2XGUcjy8kk3quUNhttnjiMqC4sU50Hemmn4i5752Co26pnKe3A==",
"dependencies": {
"Microsoft.Extensions.Hosting.Abstractions": "8.0.0",
"OpenTelemetry": "1.8.1"
"OpenTelemetry": "1.9.0"
}
},
"OpenTelemetry.Instrumentation.AspNetCore": {
"type": "Direct",
"requested": "[1.8.1, )",
"resolved": "1.8.1",
"contentHash": "dRb1LEXSH95LGEubk96kYyBmGuny9/qycH9KqL8FXcOv446Xi53EW56TVE4wTMv4HPfn+rL3B9pPQ5RX7zD4Yw==",
"requested": "[1.9.0, )",
"resolved": "1.9.0",
"contentHash": "x4HuWBw1rbWZUh5j8/GpXz3xa7JnrTuKne+ACmBqvcoO/rNGkG7HayRruwoQ7gf52xpMtRGr4gxlhLW8eU0EiQ==",
"dependencies": {
"OpenTelemetry.Api.ProviderBuilderExtensions": "1.8.0"
"OpenTelemetry.Api.ProviderBuilderExtensions": "[1.9.0, 2.0.0)"
}
},
"OpenTelemetry.Instrumentation.Http": {
"type": "Direct",
"requested": "[1.8.1, )",
"resolved": "1.8.1",
"contentHash": "l1KaO1U+v11X/kfZ8tcONc5l1qoP6nPk6yPrXBJNH0Wb6NEBTdEgI1dtJBbqOnjOrI2XS09le0ZGooh9ZVkZ3Q==",
"requested": "[1.9.0, )",
"resolved": "1.9.0",
"contentHash": "+ZXppf8Qxz3OdC803T8fB6i8iSscc8PsxMnM/JizSOYmkz+8vGiScEiaBBBFNZtMh2KpA0q+qxwnSwQUkbvzog==",
"dependencies": {
"Microsoft.Extensions.Configuration": "8.0.0",
"Microsoft.Extensions.Options": "8.0.0",
"OpenTelemetry.Api.ProviderBuilderExtensions": "1.8.0"
"OpenTelemetry.Api.ProviderBuilderExtensions": "[1.9.0, 2.0.0)"
}
},
"OpenTelemetry.Instrumentation.Process": {
"type": "Direct",
"requested": "[0.5.0-beta.5, )",
"resolved": "0.5.0-beta.5",
"contentHash": "jWGUzdqfdGkkUWzeuCzxf3Ict+XDt2mTtGTjnIsytl1QYtxQs9+OyZYPV2UmaK31syl89ugup09x7mWVjH7qIw==",
"requested": "[0.5.0-beta.7, )",
"resolved": "0.5.0-beta.7",
"contentHash": "v+g5CPU/sJhyc1FTOgTaQTwvrQXquSxdndF+E3fS8SXYPLVAa2INHa8jqCFKvYp1rO+yaVizRw1gCOaDJJzauA==",
"dependencies": {
"OpenTelemetry.Api": "[1.8.0, 2.0.0)"
"OpenTelemetry.Api": "[1.9.0, 2.0.0)"
}
},
"OpenTelemetry.Instrumentation.Runtime": {
"type": "Direct",
"requested": "[1.8.1, )",
"resolved": "1.8.1",
"contentHash": "eorE+GDtia+UNC5j1g5SqhnR7ghqiqsoCsEqnKYtKqj1jzhk90Di6e4fA8sSJLTQYYVqiZY/pLbnGTycnavBfg==",
"requested": "[1.9.0, )",
"resolved": "1.9.0",
"contentHash": "6raJb9Pvi1CaBB59SX86Mr9NQiQbiv9ialO+cQKFRGCq3Bl2WC8cTTcbfGtaRX0quqWnZC/dK7xrXuOuYcwANA==",
"dependencies": {
"OpenTelemetry.Api": "[1.8.1, 2.0.0)"
"OpenTelemetry.Api": "[1.9.0, 2.0.0)"
}
},
"SonarAnalyzer.CSharp": {
"type": "Direct",
"requested": "[9.26.0.92422, )",
"resolved": "9.26.0.92422",
"contentHash": "xfyzQhAZ5Qyxkl/KkLUfvLQR6eMCXJG1bngvJNFypZYkuGU0Inb4lWi6I6HCgUnVCJSoafLRJzyWC0HYinhR3A=="
"requested": "[9.32.0.97167, )",
"resolved": "9.32.0.97167",
"contentHash": "Yxk86RV+8ynJpUhku1Yw2hITFmnmXKkXJ73cIFSy85ol5SnWREQg9RuTyV8nI7V7+pyLKpCfRmD7P0widsgjkg=="
},
"StyleCop.Analyzers": {
"type": "Direct",
Expand Down Expand Up @@ -248,29 +246,29 @@
},
"OpenTelemetry": {
"type": "Transitive",
"resolved": "1.8.1",
"contentHash": "70pb4YyPJnoV3vZOxpusEzBqgY6NyLwyruhas5d3bUO10GnldRWGE8DF4UusbinxnTLOpSmNzsaOb5R1v+Mt0g==",
"resolved": "1.9.0",
"contentHash": "7scS6BUhwYeSXEDGhCxMSezmvyCoDU5kFQbmfyW9iVvVTcWhec+1KIN33/LOCdBXRkzt2y7+g03mkdAB0XZ9Fw==",
"dependencies": {
"Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0",
"Microsoft.Extensions.Logging.Configuration": "8.0.0",
"OpenTelemetry.Api.ProviderBuilderExtensions": "1.8.1"
"OpenTelemetry.Api.ProviderBuilderExtensions": "1.9.0"
}
},
"OpenTelemetry.Api": {
"type": "Transitive",
"resolved": "1.8.1",
"contentHash": "QCwCJp/ndXzlTBiTJjcpkpi4tntv1qSRJMXv0YNKcptE/FRMufiIA7IWTegS7C1/r3YQQwGiwdHARcZcS41JMw==",
"resolved": "1.9.0",
"contentHash": "Xz8ZvM1Lm0m7BbtGBnw2JlPo++YKyMp08zMK5p0mf+cIi5jeMt2+QsYu9X6YEAbjCxBQYwEak5Z8sY6Ig2WcwQ==",
"dependencies": {
"System.Diagnostics.DiagnosticSource": "8.0.0"
}
},
"OpenTelemetry.Api.ProviderBuilderExtensions": {
"type": "Transitive",
"resolved": "1.8.1",
"contentHash": "/M1vkPg2i2UpnHMlV8kFS4ct9O2cg3C+KVgPI/6G/tp99AzwGIvZZv0NswnjKBqis/Lr9Lv2eeF1yvG1KpBP/w==",
"resolved": "1.9.0",
"contentHash": "L0D4LBR5JFmwLun5MCWVGapsJLV0ANZ+XXu9NEI3JE/HRKkRuUO+J2MuHD5DBwiU//QMYYM4B22oev1hVLoHDQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"OpenTelemetry.Api": "1.8.1"
"OpenTelemetry.Api": "1.9.0"
}
},
"StyleCop.Analyzers.Unstable": {
Expand All @@ -285,13 +283,8 @@
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "4.7.2",
"contentHash": "iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA=="
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "4.7.2",
"contentHash": "TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg=="
"resolved": "4.5.0",
"contentHash": "Xg4G4Indi4dqP1iuAiMSwpiWS54ZghzR644OtsRCm/m/lBMG8dUBhLVN7hLm8NNrNTR+iGbshCPTwrvxZPlm4g=="
}
}
}
Expand Down

0 comments on commit b0e417b

Please sign in to comment.