Receiving 404 with Django hitting https://{host}:{port}/intake/v2/events

I signed up for Elasticsearch (hosted) a week ago. I have installed the latest python clients and am using a supported Django version (2.2). I cannot for the life of me get an error to propagate to the dashboard. What's going on?

(env) james@Jamess-MacBook-Pro src % python manage.py elasticapm test --environment develop
Could not register elasticapm.metrics.sets.cpu.CPUMetricSet metricset: psutil not found. Install it to get system and process metrics
Could not register elasticapm.metrics.sets.cpu.CPUMetricSet metricset: psutil not found. Install it to get system and process metrics
Trying to send a test error to APM Server using these settings:

SERVICE_NAME:   default
SECRET_TOKEN:   XXXXXXXXXXXXXXXXXX
SERVER:         https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX.us-central1.gcp.cloud.es.io:9243

Success! We tracked the error successfully! 
You should see it in the APM app in Kibana momentarily. 
Look for "TestException: Hi there!" in the Errors tab of the default app
Failed to submit message: 'HTTP 404: {"statusCode":404,"error":"Not Found","message":"Not Found"}'
Traceback (most recent call last):
  File "/Users/james/Repos/DivDot/api/env/lib/python3.8/site-packages/elasticapm/transport/base.py", line 227, in _flush
    self.send(data)
  File "/Users/james/Repos/DivDot/api/env/lib/python3.8/site-packages/elasticapm/transport/http.py", line 106, in send
    raise TransportException(message, data, print_trace=print_trace)
elasticapm.transport.base.TransportException: HTTP 404: {"statusCode":404,"error":"Not Found","message":"Not Found"}

I have been unable to find in the documentation any sign of how or why this error is coming about. I found one related issue on github, but it was closed after the original poster updated to the latest version (which I am currently using).

Any help is greatly appreciated.

Perhaps the name I created "default", is incorrect? I created it arbitrarily. Should also post the output of check too.

(env) james@Jamess-MacBook-Pro src % python manage.py elasticapm check --environment develop
Could not register elasticapm.metrics.sets.cpu.CPUMetricSet metricset: psutil not found. Install it to get system and process metrics
Could not register elasticapm.metrics.sets.cpu.CPUMetricSet metricset: psutil not found. Install it to get system and process metrics
Service name is set, good job!

SERVER_URL https://XXXXXXXXXXXXXXXXXXXX.us-central1.gcp.cloud.es.io:9243 looks fine

DEBUG mode is disabled! Looking good!

Tracing middleware is configured! Awesome!

Looks like everything should be ready!

Hi @jamesdivdot

Thanks for checking out Elastic Cloud and our APM app! Judging from the 9243 port in your SERVER_URL, it looks like you use the Elasticsearch URL, not the APM Server URL. If you have an APM Server in your cloud deployment, you should see something like this:

Click on "Copy endpoint" next to "APM" to get the APM Server URL.

That being said, it looks like you are hitting an actual bug in the Django check command. We seem to print a success message even if the request fails. I'll see if I can get a fix for that in for our next release which we plan for the beginning of next week.

Cheers

@beniwohli Thank you! That was it.

I think I was misguided in the example, because the endpoint I was using to log into Kibana looked very similar as the one in the example (sans the .apm.).

Perhaps a clarification could be put in the docs for future developers?

Thanks again,

James.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.