I have a asp.net core web app (mvc) project that writes logs to elasticsearch and read logs from elasticsearch when certain things happen in the application.
Is there a way you could correlate logs that occur within the same browser transaction? (i.e. opening up a browser, user clicks button on each page redirecting them to another page until they reach the end of the page where they are finished then they close the browser) I saw something about APM but is there alternative to group these logs together as a single transaction if this makes any sense.
UPDATE:
I followed exactly the instructions from apm installation tutorial guide for Windows. When I got to step 3 which was to start the APM server it said to run the cmd Start-Service apm-server
but nothing happened. So when I attempted to start the server with the cmd ./apm-server -e
instead, it did some stuff that did not look like the format it should be displaying in powershell as admin.
I then checked the apm server status and it showed as it was correctly set up. I did not do step 2 because I am running it localhost.
Moving on to the last step which is the APM Agents. I went under the tab .NET and followed the instructions... installing Elastic.APM.NetCoreAll nuget package and did the following...
Startup.cs
file I added the app.UseElasticApm(Configuration, new HttpDiagnosticsSubscriber(), new EfCoreDiagnosticsSubscriber());
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseElasticApm(Configuration,
new HttpDiagnosticsSubscriber(), // Enable tracing of outgoing HTTP requests
new EfCoreDiagnosticsSubscriber()); // Enable tracing of database calls through EF Core
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
in my appsettings.json
file:
{
"ApplicationName": "customer-simulation-es-app",
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"System": "Warning"
}
}
},
"ElasticConfiguration": {
"Uri": "http://localhost:9200"
},
"ElasticApm": {
"ServerUrl": "http://localhost:8200",
"ServiceName": "CustomerApp",
"Environment": "production",
"CloudProvider": "none",
"LogLevel": "Trace"
},
"AllowedHosts": "*"
}
This is what I see on the .exe file application when program starts running:
I run the program and perform some operations on the browser. I then go to check the agent status and it says no data has been received from agents yet. But I did it exactly how they wanted it.
Am I missing something that is not in the guide?