codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 0 forks source link

Record user.ip in API Sentry transactions #1663

Open spalmurray-codecov opened 2 weeks ago

spalmurray-codecov commented 2 weeks ago

We were looking into whether it's possible to count unique IPs over a specific transaction type, but it seems we're not attaching the IP in a way that allows this. Sending the client's IP to Sentry as user.ip will allow us to do this kind of aggregation.

It seems we do have this information in the form of the X-Envoy-External-Address header, but we can't make user of arbitrary headers like this in Sentry queries.

Example transaction with this header:

https://codecov.sentry.io/performance/api:733ec7974dc84e0d89227e4c838810c5/?interval=4h&legacy=1&node=txn-733ec7974dc84e0d89227e4c838810c5&project=5215654&statsPeriod=14d&timestamp=1713514520&widgets=%5B%7B%22type%22%3A1%2C%22id%22%3A0%2C%22mri%22%3A%22c%3Acustom%2Fvalidate_v2%40none%22%2C%22op%22%3A%22sum%22%2C%22query%22%3A%22%22%2C%22sort%22%3A%7B%22order%22%3A%22asc%22%7D%2C%22displayType%22%3A%22line%22%2C%22isHidden%22%3Afalse%2C%22overlays%22%3A%5B%22samples%22%5D%7D%5D