I notice there is a context.user.ip field according to APM-Server doc. Is there any reason the Python agent not automatically fill in this field? I want to do a user IP pie chart visualization and I found the Python agent didn't collect this information.
elasticapm.set_user_context() don't have a IP field either.
context.user.ip is set by the APM Server, but only for RUM (browser) transactions. For other transactions, context.system.ip is recorded, but that's the IP of the system on which the agent is running.
Thank you.
I see context.request.socket.remote_address is not in Kibana index patterns by default. Do I have to use Elasticsearch Mapping API to make this field aggregatable in order to make a user IP pie chart?
Sorry for the late reply. Yes, you'll need to modify the mapping to index it, giving it an ip type. There is an experimental configuration in the server to simplify doing this, but we found a bug that prevents it from being used in this case: https://github.com/elastic/apm-server/issues/1959.
If you update the apm-6.6 template, then new daily indices will be created with this mapping. If you want to be able to chart existing data, you will need to reindex.
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.