Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .NET documentation #203391

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,21 +384,22 @@ export const createDotNetAgentInstructions = (apmServerUrl = '', secretToken = '
}),
textPre: i18n.translate('xpack.apm.tutorial.dotNetClient.configureApplication.textPre', {
defaultMessage:
'In case of ASP.NET Core with the `Elastic.Apm.NetCoreAll` package, call the `UseAllElasticApm` \
method in the `Configure` method within the `Startup.cs` file.',
}),
commands: `public class Startup
{curlyOpen}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{curlyOpen}
app.UseAllElasticApm(Configuration);
//…rest of the method
{curlyClose}
//…rest of the class
{curlyClose}`.split('\n'),
'In case of ASP.NET Core with the `Elastic.Apm.NetCoreAll` package, call the `AddAllElasticApm` \
extension method on the `IServiceCollection` available via the `WebApplicationBuilder` \
within the `Program.cs` file.',
}),
commands: `var builder = WebApplication.CreateBuilder(args);

builder.Services.AddAllElasticApm();

var app = builder.Build();

// Configure the HTTP request pipeline.

app.Run();`.split('\n'),
textPost: i18n.translate('xpack.apm.tutorial.dotNetClient.configureApplication.textPost', {
defaultMessage:
'Passing an `IConfiguration` instance is optional and by doing so, the agent will read config settings through this \
'The agent will implicitly read config settings from the applications \
`IConfiguration` instance (e.g. from the `appsettings.json` file).',
}),
},
Expand All @@ -409,8 +410,7 @@ export const createDotNetAgentInstructions = (apmServerUrl = '', secretToken = '
customComponentName: 'TutorialConfigAgent',
textPost: i18n.translate('xpack.apm.tutorial.dotNetClient.configureAgent.textPost', {
defaultMessage:
'In case you don’t pass an `IConfiguration` instance to the agent (e.g. in case of non ASP.NET Core applications) \
you can also configure the agent through environment variables. \n \
'You can also configure the agent through environment variables. \n \
See [the documentation]({documentationLink}) for advanced usage, including the [Profiler Auto instrumentation]({profilerLink}) quick start.',
values: {
documentationLink:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export const createDotNetAgentInstructions = (commonOptions: AgentInstructions):
agentStatus,
agentStatusLoading,
} = commonOptions;
const codeBlock = `public class Startup
{
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseAllElasticApm(Configuration);
//…rest of the method
}
//…rest of the class
}`;
const codeBlock = `var builder = WebApplication.CreateBuilder(args);

builder.Services.AddAllElasticApm();

var app = builder.Build();

// Configure the HTTP request pipeline.

app.Run();`;
return [
{
title: i18n.translate('xpack.apm.onboarding.dotNet.download.title', {
Expand Down Expand Up @@ -72,8 +72,8 @@ export const createDotNetAgentInstructions = (commonOptions: AgentInstructions):
<EuiMarkdownFormat>
{i18n.translate('xpack.apm.onboarding.dotNet.configureApplication.textPre', {
defaultMessage:
'In case of ASP.NET Core with the `Elastic.Apm.NetCoreAll` package, call the `UseAllElasticApm` \
method in the `Configure` method within the `Startup.cs` file.',
'In case of ASP.NET Core with the `Elastic.Apm.NetCoreAll` package, call the `AddAllElasticApm` \
extension method on the `IServiceCollection` within the `Program.cs` file.',
})}
</EuiMarkdownFormat>
<EuiSpacer />
Expand All @@ -84,7 +84,7 @@ export const createDotNetAgentInstructions = (commonOptions: AgentInstructions):
<EuiMarkdownFormat>
{i18n.translate('xpack.apm.onboarding.dotNet.configureApplication.textPost', {
defaultMessage:
'Passing an `IConfiguration` instance is optional and by doing so, the agent will read config settings through this \
'The agent will implicitly read config settings through the application’s \
`IConfiguration` instance (e.g. from the `appsettings.json` file).',
})}
</EuiMarkdownFormat>
Expand Down Expand Up @@ -119,8 +119,7 @@ export const createDotNetAgentInstructions = (commonOptions: AgentInstructions):
<EuiMarkdownFormat>
{i18n.translate('xpack.apm.onboarding.dotNet.configureAgent.textPost', {
defaultMessage:
'In case you don’t pass an `IConfiguration` instance to the agent (e.g. in case of non ASP.NET Core applications) \
you can also configure the agent through environment variables. \n \
'You can also configure the agent through environment variables. \n \
See [the documentation]({documentationLink}) for advanced usage, including the [Profiler Auto instrumentation]({profilerLink}) quick start.',
values: {
documentationLink: `${baseUrl}guide/en/apm/agent/dotnet/current/configuration.html`,
Expand Down