# Elasticapm\_integeration.py, did not see the place where we can point APM server and port no

**URL:** <https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302>\
**Category:** APM\
**Tags:** python\
**Created:** [November 18, 2019, 11:47am UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302 "2019-11-18T11:47:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 18, 2019, 11:47am UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/1 "2019-11-18T11:47:10Z")

</div>

Hi ,  
Good evening,  
from the previous post, want to update  
`https://discuss.elastic.co/t/apm-to-make-it-work-with-python/199165/2`

and following the blog  
`https://www.elastic.co/blog/creating-custom-framework-integrations-with-the-elastic-apm-python-agent#`

I am using the code at  
`https://github.com/beniwohli/pyramid-elasticapm-demo/tree/master/app`

I run the task.py file and it executes, and trying to understand how " [elasticapm\_integeration.py" works, I am running the 'task.py" and observing the behavior

After searching I didnot find any location or parameters which shows where the apm server and port can be pointed to

I am using the master version of **pyramid-elasticapm-demo**

Thanks  
Joseph John

---

<div class="post-metadata">

**Author:** ![beniwohli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/beniwohli/32/21256_2.png) [@beniwohli](https://discuss.elastic.co/u/beniwohli)\
**Post date:** [November 18, 2019, 12:24pm UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/2 "2019-11-18T12:24:00Z")

</div>

Hi @Joseph_John

You can supply the server URL (and any other configuration) when instantiating the ElasticAPM client:

```
elasticapm.Client(server_url="http://example.com:8200")

```

Alternatively, you can use environment variables, e.g. `ELASTIC_APM_SERVER_URL`.

All configuration options and their names are listed in our [documentation](https://www.elastic.co/guide/en/apm/agent/python/current/configuration.html).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 19, 2019, 11:50am UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/3 "2019-11-19T11:50:34Z")

</div>

He Beni,  
thanks for the reply and advice, I added the server links

> [@beniwohli](#):
>
> elasticapm.Client(server\_url="[http://example.com:8200](http://example.com:8200)")

in my case aom-server is in my host and I gave the "[http://localhost:8200](http://localhost:8200)" , telnet to port 8200 shows the port opened and from kibana apm-server status check shows running

When I run the  
`$VENV/bin/python3 tasks.py`

I am getting the following messages

> intake/v2/events  
> ERROR:elasticapm.transport:Failed to submit message: 'HTTP 404: 404 - File or directory not found. Traceback (most recent call last):

Also this message

**ERROR:elasticapm.transport:dropping flushed data due to transport failure back-off**

> ^CTraceback (most recent call last):  
> File "tasks.py", line 111, in   
> server.serve\_forever()  
> File "/usr/lib/python3.7/socketserver.py", line 232, in serve\_forever  
> ready = selector.select(poll\_interval)  
> File "/usr/lib/python3.7/selectors.py", line 415, in select  
> fd\_event\_list = self.\_selector.poll(timeout)

Guidance and advice requested  
thanks  
Joseph John

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 20, 2019, 11:49am UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/4 "2019-11-20T11:49:28Z")

</div>

Hi All,  
I have small update  
When I have my apm-server running on the same machine as where I run the  
`$VENV/bin/python3 tasks.py`  
with  
`self.client = elasticapm.Client(service_name="My Application")`  
it works and I am getting results in the apm  
Only When I adding server\_url I am getting issues with the connectivity and the above thread eror comes

Thinking how to give the server url properly,  
thanks

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 25, 2019, 11:11am UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/5 "2019-11-25T11:11:44Z")

</div>

Hi All,  
like to update, I have not done any progress  
the  
` self.client = elasticapm.Client(framework_name="Pyramid",server_url='http://192.168.10.114:8200',service_name="JosephLaptop")`

the above setup do not give the agent status on the APM server , but when I do

> self.client = elasticapm.Client(framework\_name="Pyramid",service\_name="JosephLaptop")

It shows apm agent status OK in the local machine installed apm

I am figuring where I could go wrong, my skill in python is of a beginner level, I and requesting on how to trouble shoot on finding the reason, how to get the logs of the Pyramid task program

status of apm-server Ok , curl gives result

> curl [http://192.168.10.114:8200/](http://192.168.10.114:8200/)

{  
"build\_date": "2019-10-28T18:52:50Z",  
"build\_sha": "1726aa000d8e1558879c9e9700966d1a2ce6d4d2",  
"version": "7.4.2"  
}

Guidance requested  
thanks  
Joseph John

---

<div class="post-metadata">

**Author:** ![beniwohli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/beniwohli/32/21256_2.png) [@beniwohli](https://discuss.elastic.co/u/beniwohli)\
**Post date:** [November 25, 2019, 2:45pm UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/6 "2019-11-25T14:45:07Z")

</div>

Hey @Joseph_John

first of all, sorry for missing your previous replies ☹

It's weird that you can access the APM Server via curl, but the agent isn't able to reach it. Maybe it would help to set the log level of your Pyramid app temporarily to `DEBUG`. That should be possible by changing the `level` of `logger_root` in your `development.ini` to `DEBUG` (see last few paragraphs here: [https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html#logging-configuration](https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html#logging-configuration)). Then look at the logs to see if anything more interesting is logged.

It would also be interesting to see the APM Server logs. You might have to start it with the `-e` flag to see logs on your console ([https://www.elastic.co/guide/en/apm/server/current/command-line-options.html#global-flags](https://www.elastic.co/guide/en/apm/server/current/command-line-options.html#global-flags))

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 26, 2019, 2:31am UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/7 "2019-11-26T02:31:01Z")

</div>

Hi Beniwohli,  
Thanks  
I tried with -e option  
I can see the elastic search connection established  
`INFO	pipeline/output.go:105	Connection to backoff(elasticsearch(http://192.168.10.69:9200)) established`

and once I start the pyramid application, I get the **"forbidden request: endpoint is disabled"**  
as given below

```
ERROR	[request]	middleware/log_middleware.go:74	forbidden request	{"request_id": "4e065ca3-d8ec-4b0d-86e2-2adae1e9f2c4", "method": "POST", "URL": "/config/v1/agents", "content_length": 37, "remote_address": "192.168.10.69", "user-agent": "elasticapm-python/3.0.0", "response_code": 403, "error": "forbidden request: endpoint is disabled"}

```

Thanks  
Joseph John

---

<div class="post-metadata">

**Author:** ![basepi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/basepi/32/53056_2.png) [@basepi](https://discuss.elastic.co/u/basepi)\
**Post date:** [December 2, 2019, 5:09pm UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/8 "2019-12-02T17:09:03Z")

</div>

That looks to me like the error you get if you don't have RUM enabled on the APM server. (It's disabled by default)

You'll want to set `apm-server.rum.enabled: true` in your `apm-server.yml` config file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 23, 2019, 1:09pm UTC](https://discuss.elastic.co/t/elasticapm-integeration-py-did-not-see-the-place-where-we-can-point-apm-server-and-port-no/208302/9 "2019-12-23T13:09:08Z")

</div>

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