Hi,
I'm trying to set up Elastic APM on a dotnet mvc app. Testing with a dotnet core console app but my intended setup is for a regular dotnet framework project in mvc.
I have Elasticsearch and Kibana set up.
I have my Elastic Agent running Fleet set up and self-signing ssl certs.
Fleet status is healthy. Diagnostics look clean.
However, when I go to run the sample apm-agent-dotnet console app I get
{CentralConfigurationFetcher} Exception was thrown while fetching configuration from APM Server and parsing it. ETag: `<null>'. URL: `https://<sb-devora-apm-server--url>:8220/config/v1/agents?service.name=SampleConsoleNetCoreApp&service.environment=Production'. Apm Server base URL: `https://<sb-devora-apm-server--url>:8220/'. WaitInterval: 5m. dbgIterationsCount: 9.
+-> Request:
Method: GET, RequestUri: 'https://<sb-devora-apm-server--url>:8220/config/v1/agents?service.name=SampleConsoleNetCoreApp&service.environment=Production', Version: 1.1, Content: <null>, Headers:
{
User-Agent: apm-agent-dotnet/1.18.0
User-Agent: (SampleConsoleNetCoreApp 1.0.0)
User-Agent: System.Net.Http/4.700.22.47602
User-Agent: .NET_Core/3.1.30
Request-Id: |47ae3bf2-4d058de53621017d.
}
+-> Response:
StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
X-Content-Type-Options: nosniff
Date: Thu, 03 Nov 2022 19:22:48 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 19
}
+-> Response body [length: 19]:
404 page not found
Also when I go to visit the url directly I can see the ssl cert in the browser but also receiving the 404 error.
Is this a config issue with the elastic server?
As far as I can tell my port is open on 8220. I'm not sure what a good next step to take would be. I see nothing on the receiving Elastic Agent / Fleet side so the payload is just not making it over. Meaning no errors to show on the Elastic Agent / Fleet side.
Another line in the debug output for my console app
} Failed sending event. Events intake API absolute URL: https://<sb-devora-apm-server--url>:8220/intake/v2/events. APM Server response: status code: NotFound, content:
404 page not found
did you use NuGet to deploy the APM .NET Agent to your application?
Can you also check your configuration for me, please?
At the very minimum you need to configure ServerUrl and SecretToken (see documentation).
{CentralConfigurationFetcher} Exception was thrown while fetching configuration from APM Server and parsing it. ETag: `<null>'. URL: `https://xx.xx.xx.xx:8220/config/v1/agents?service.name=SAMPLECONSOLENETCORE&service.environment=production'. Apm Server base URL: `https://10.0.2.23:8220/'. WaitInterval: 5m. dbgIterationsCount: 1.
+-> Request:
Method: GET, RequestUri: 'https://xx.xx.xx.xx:8220/config/v1/agents?service.name=SAMPLECONSOLENETCORE&service.environment=production', Version: 1.1, Content: <null>, Headers:
{
User-Agent: apm-agent-dotnet/1.18.0
User-Agent: (SAMPLECONSOLENETCORE 1.0.0)
User-Agent: System.Net.Http/4.700.22.47602
User-Agent: .NET_Core/3.1.30
Authorization: [REDACTED]
}
+-> Response:
StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
X-Content-Type-Options: nosniff
Date: Fri, 04 Nov 2022 15:07:38 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 19
}
+-> Response body [length: 19]:
404 page not found
Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationFetcher+FailedToFetchConfigException: HTTP status code is Not Found (404) which most likely means that APM Server is an old (pre 7.3) version which doesn't support the central configuration endpoint
at Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationResponseParser.InterpretResponseStatusCode(HttpResponseMessage httpResponse, WaitInfoS waitInfo) in C:\Users\devora\source\pocs\apm-agent-dotnet-main\apm-agent-dotnet-main\src\Elastic.Apm\BackendComm\CentralConfig\CentralConfigurationResponseParser.cs:line 135
at Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationResponseParser.ParseHttpResponse(HttpResponseMessage httpResponse, String httpResponseBody) in C:\Users\devora\source\pocs\apm-agent-dotnet-main\apm-agent-dotnet-main\src\Elastic.Apm\BackendComm\CentralConfig\CentralConfigurationResponseParser.cs:line 39
Should I be able to hit the request urls in a browser as a ssl verification check?
I'm using the self-signed certificate option. When I do visit within the browser I do receive the same 404 type error
$ curl https://xx.xx.xx.xx:8220 --insecure
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 19 100 19 0 0 236 0 --:--:-- --:--:-- --:--:-- 292404 page not found
Same 404 issue with curl.
Did I set up my Fleet Server + Elastic Agent incorrectly?
Fleet screen in Kibana shows healthy.
Elastic-Agent status shows healthy.
An update. I switched over to the setup for the legacy APM server and was successful on that approach. I can go with this for now but eventually it seems we will have to migrate over to the Fleet + Agent approach.
It looks like you are using an incorrect URL (at least an incorrect port number) for your APM server URL configuration.
APM server typically uses port 8200 (while here 8220 is used).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.