MySQL Filter

    The following documentation runs through the setup of Envoy described above.

    Ensure that you have a recent versions of and docker-compose installed.

    A simple way to achieve this is via the Docker Desktop.

    Step 2: Clone the Envoy repo

    SSH

    HTTPS

    1. git clone https://github.com/envoyproxy/envoy.git

    Terminal 1

    Step 4: Issue commands using mysql

    Terminal 1

    1. $ docker run --rm -it --network envoymesh mysql:5.5 mysql -h envoy -P 1999 -u root
    2. ... snip ...
    3. mysql> CREATE DATABASE test;
    4. Query OK, 1 row affected (0.00 sec)
    5. mysql> USE test;
    6. Database changed
    7. Query OK, 0 rows affected (0.01 sec)
    8. mysql> SELECT COUNT(*) FROM test;
    9. | COUNT(*) |
    10. +----------+
    11. | 0 |
    12. +----------+
    13. 1 row in set (0.01 sec)
    14. mysql> INSERT INTO test VALUES ('hello, world!');
    15. Query OK, 1 row affected (0.00 sec)
    16. mysql> SELECT COUNT(*) FROM test;
    17. +----------+
    18. | COUNT(*) |
    19. | 1 |
    20. +----------+
    21. mysql> exit
    22. Bye

    Check egress stats were updated.

    Terminal 1

    Step 6: Check TCP stats

    Terminal 1

    1. $ curl -s http://localhost:8001/stats?filter=mysql_tcp
    2. tcp.mysql_tcp.downstream_cx_no_route: 0
    3. tcp.mysql_tcp.downstream_cx_rx_bytes_buffered: 0
    4. tcp.mysql_tcp.downstream_cx_rx_bytes_total: 347
    5. tcp.mysql_tcp.downstream_cx_total: 1
    6. tcp.mysql_tcp.downstream_cx_tx_bytes_buffered: 0
    7. tcp.mysql_tcp.downstream_cx_tx_bytes_total: 702
    8. tcp.mysql_tcp.downstream_flow_control_paused_reading_total: 0
    9. tcp.mysql_tcp.downstream_flow_control_resumed_reading_total: 0
    10. tcp.mysql_tcp.idle_timeout: 0
    11. tcp.mysql_tcp.upstream_flush_total: 0