This Library provides an API to register hosting related functionailty to an application.
The below code needs to be added to the Program.cs
. This will register the application metadata accessor.
static class Program
{
public static void Main()
{
CreateHostBuilder().Build().Run();
}
private static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseApplicationMetadata();
}
The ApplicationName
should be configured from the appsettings.json
. By default it will use the Assembly's Entrypoint name
The below code needs to be added to the Startup.cs
to register an information endpoint.
public void ConfigureServices(IServiceCollection services)
{
services.ConfigureInfoManagement(_configuration);
}
public void Configure(IApplicationBuilder app)
{
app.UseInfoManagement();
}
The below table outlines the valid Configurations.
Configuration Name | Type | Optional | Default Value |
---|---|---|---|
Url | String | No | /actuator/info |
Checksum | InfoManagementChecksumOptions | Yes |
{
"InfoManagement": {
"Url": "/info"
}
}