Check when transaction was added to the mempool? I know how to check when a specific transaction was included in the block. But how do I check when my bitcoind node first saw it? I would like to estimate for how long the transaction stayed unconfirmed after it was broadcasted.
The getrawmempool interface provides this information in the time field, though it is potentially very slow to respond with a large number of transactions in the mempool. It does not record this time once the transaction is removed from the mempool for non-wallet transactions, so it either needs to be gathered from this interface or recorded on addition with the zmq socket. 

"result": {
    "89ee39117b4b55e54ace29c631eef80a875ae109a4fbd79ddd10b6f21329e88d": {
        "size": 225,
        "fee": 0.00000573,
        "modifiedfee": 0.00000573,
        "time": 1556802637,
        "height": 574268,
        "descendantcount": 2,
        "descendantsize": 451,
        "descendantfees": 3247,
        "ancestorcount": 1,
        "ancestorsize": 225,
        "ancestorfees": 573,
        "wtxid": "89ee39117b4b55e54ace29c631eef80a875ae109a4fbd79ddd10b6f21329e88d",
        "depends": [

        ]
    }
}