Add official monitoring plugin (#3160)

* Add Monitoring plugin

* Prepare pipeline

* Fix Rider stupidity

* Fix Windows build

* Remove translation files

* Apply feedback

* Add steam id as additional tag to metrics

* Apply feedback

* Add runtime metrics

* Fix my brain not braining

* Use extension methods to add instrumentation and Add monitoring for outbound HTTP traffic

* Upgrade OpenTelemetry.Extensions.Hosting to prerelease due to runtime exception

* Remove config and add file that was supposed to be committed yesterday to fix the runtime exception

* Revert changes to publish.yml

* Remove localization

* Apply feedback

* Apply feedback

* Fix version number

* Revert use of property in Kestrel (even tho it's an outside caller to the source class)
This commit is contained in:
Sebastian Göls
2024-03-25 22:58:03 +01:00
committed by GitHub
parent 0c4e4e709f
commit f9f6e207d4
10 changed files with 350 additions and 0 deletions

View File

@@ -230,6 +230,16 @@ internal static class ArchiKestrel {
// Finally register proper API endpoints once we're done with routing
app.UseEndpoints(static endpoints => endpoints.MapControllers());
if (PluginsCore.ActivePlugins.Count > 0) {
foreach (IWebServiceProvider plugin in PluginsCore.ActivePlugins.OfType<IWebServiceProvider>()) {
try {
plugin.OnConfiguringEndpoints(app);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
}
}
}
// Add support for swagger, responsible for automatic API documentation generation, this should be on the end, once we're done with API
app.UseSwagger();
@@ -379,6 +389,14 @@ internal static class ArchiKestrel {
mvc.AddApplicationPart(assembly);
}
}
foreach (IWebServiceProvider plugin in PluginsCore.ActivePlugins.OfType<IWebServiceProvider>()) {
try {
plugin.OnConfiguringServices(services);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
}
}
}
mvc.AddControllersAsServices();