mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user