ssi-anik / elastic-apm-php

elastic/apm-agent-php wrapper to push PHP application transactions to APM Server
https://bit.ly/300vUkX
MIT License
16 stars 9 forks source link

Send Real IP User to APM Server #2

Closed fontebasso closed 3 years ago

fontebasso commented 3 years ago

Houston, I have a problem!

After many hours believing that my stack had some configuration error, I can't imagine who is not getting the user real IP, my last analysis indicates that the agent or package it is not looking for the correct IP.

My stack is all Kubernetes with 2 clusters on AWS:

[My User] ---https://my-app.com---> [K8s 1 - Run APM PHP Agent] ---https://apm-server.com:8200---> [K8s 2 - Run APM] ---http://es.cluster.local:9200---> [K8s 2 - Run Elasticsearch]

This package has the possibility to define the user IP (field client.ip) in APM?

ssi-anik commented 3 years ago

what apm version you're using? I'll check by myself. using with Laravel?

fontebasso commented 3 years ago
ssi-anik commented 3 years ago

I have checked locally, I found host.ip in the transaction object. I guess it's been captured by the APM server. And, the package doesn't capture the user's IP. but if you need to pass the user's IP then attach it in a span and set the user's IP. You'll get that in the elastic's object.