82
Troubleshooting RabbitMQ and services that use it

Troubleshooting RabbitMQ and Microservices That Use It

  • Upload
    pivotal

  • View
    245

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting RabbitMQand services that use it

Page 2: Troubleshooting RabbitMQ and Microservices That Use It

Who am I?• Staff Engineer, RabbitMQ @ Pivotal

Page 3: Troubleshooting RabbitMQ and Microservices That Use It

Who am I?• Staff Engineer, RabbitMQ @ Pivotal

• @michaelklishin, github.com/michaelklishin

Page 4: Troubleshooting RabbitMQ and Microservices That Use It
Page 5: Troubleshooting RabbitMQ and Microservices That Use It

The monolith problem

Page 6: Troubleshooting RabbitMQ and Microservices That Use It
Page 7: Troubleshooting RabbitMQ and Microservices That Use It
Page 8: Troubleshooting RabbitMQ and Microservices That Use It
Page 9: Troubleshooting RabbitMQ and Microservices That Use It
Page 10: Troubleshooting RabbitMQ and Microservices That Use It
Page 11: Troubleshooting RabbitMQ and Microservices That Use It
Page 12: Troubleshooting RabbitMQ and Microservices That Use It
Page 13: Troubleshooting RabbitMQ and Microservices That Use It
Page 14: Troubleshooting RabbitMQ and Microservices That Use It
Page 15: Troubleshooting RabbitMQ and Microservices That Use It
Page 16: Troubleshooting RabbitMQ and Microservices That Use It
Page 17: Troubleshooting RabbitMQ and Microservices That Use It
Page 18: Troubleshooting RabbitMQ and Microservices That Use It
Page 19: Troubleshooting RabbitMQ and Microservices That Use It
Page 20: Troubleshooting RabbitMQ and Microservices That Use It
Page 21: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers

Page 22: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• I/O exceptions (shutdown handlers)

Page 23: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• I/O exceptions (shutdown handlers)

• Publisher confirms

Page 24: Troubleshooting RabbitMQ and Microservices That Use It
Page 25: Troubleshooting RabbitMQ and Microservices That Use It

When in doubt, borrow ideas from TCP

Page 26: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• I/O exceptions (shutdown handlers)

• Publisher confirms

• Returned message handlers

Page 27: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• I/O exceptions (shutdown handlers)

• Publisher confirms

• Returned message handlers

• Invalid payload (e.g. fails to deserialize or decrypt)

Page 28: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• I/O exceptions (shutdown handlers)

• Publisher confirms

• Returned message handlers

• Invalid payload (e.g. fails to deserialize or decrypt)

• Identifying publisher instances

Page 29: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• identifying blocked (throttled) publishers

Page 30: Troubleshooting RabbitMQ and Microservices That Use It

Client-provided connection names in

RabbitMQ 3.6.3+

Page 31: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• identifying blocked (throttled) publishers

• retries

Page 32: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting publishers• spring-amqp can cover all of the above

Page 33: Troubleshooting RabbitMQ and Microservices That Use It
Page 34: Troubleshooting RabbitMQ and Microservices That Use It
Page 35: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers

Page 36: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• I/O exceptions

Page 37: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• I/O exceptions

• Inadequate delivery QoS

Page 38: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• I/O exceptions

• Inadequate delivery QoS

• Lack of confirmations; double-confirming

Page 39: Troubleshooting RabbitMQ and Microservices That Use It
Page 40: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• I/O exceptions

• Inadequate delivery QoS

• Lack of confirmations; double-confirming

Page 41: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• I/O exceptions

• Inadequate delivery QoS

• Lack of confirmations; double-confirming

• Redelivery metrics

Page 42: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• I/O exceptions

• Inadequate delivery QoS

• Lack of confirmations; double-confirming

• Redelivery metrics

• Identifying consumer instances

Page 43: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• Consumer utilization (reported by HTTP API)

Page 44: Troubleshooting RabbitMQ and Microservices That Use It

Troubleshooting consumers• spring-amqp can help with some of the above

Page 45: Troubleshooting RabbitMQ and Microservices That Use It
Page 46: Troubleshooting RabbitMQ and Microservices That Use It

— W. Edwards Deming

“In God we trust, all others must bring data…”

Page 47: Troubleshooting RabbitMQ and Microservices That Use It

— W. Edwards Deming

“In God we trust, all others must bring data…”

Page 48: Troubleshooting RabbitMQ and Microservices That Use It

— What do you do for a living?

Page 49: Troubleshooting RabbitMQ and Microservices That Use It

— What do you do for a living? — Tell people to read the logs.

Page 50: Troubleshooting RabbitMQ and Microservices That Use It

Sources of data useful for debugging

Page 51: Troubleshooting RabbitMQ and Microservices That Use It

Sources of data useful for debugging

• Metrics

Page 52: Troubleshooting RabbitMQ and Microservices That Use It

Sources of data useful for debugging

• Metrics

• Your logs

Page 53: Troubleshooting RabbitMQ and Microservices That Use It

Sources of data useful for debugging

• Metrics

• Your logs

• Someone else's logs

Page 54: Troubleshooting RabbitMQ and Microservices That Use It

Sources of data useful for debugging

• Metrics

• Your logs

• Someone else's logs

• Tracing data

Page 55: Troubleshooting RabbitMQ and Microservices That Use It

Sources of data useful for debugging

• Metrics

• Your logs

• Someone else's logs

• Tracing data

• Wireshark (tcpdump, libpcap)

Page 56: Troubleshooting RabbitMQ and Microservices That Use It
Page 57: Troubleshooting RabbitMQ and Microservices That Use It
Page 58: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

Page 59: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• Logs

Page 60: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• Logs

• rabbitmqctl status

Page 61: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• Logs

• rabbitmqctl status

• rabbitmqctl environment

Page 62: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• Logs

• rabbitmqctl status

• rabbitmqctl environment

• rabbitmq-top (ships with RabbitMQ as of 3.6.3)

Page 63: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• Logs

• rabbitmqctl status

• rabbitmqctl environment

• rabbitmq-top (ships with RabbitMQ as of 3.6.3)

• HTTP API (lots of metrics)

Page 64: Troubleshooting RabbitMQ and Microservices That Use It

http://{hostname}:15672/api

Page 65: Troubleshooting RabbitMQ and Microservices That Use It

curl -u guest:guest http://127.0.0.1:15672/api/overview | python -m json.tool curl -u guest:guest http://127.0.0.1:15672/api/nodes/{node} | python -m json.tool curl -u guest:guest http://127.0.0.1:15672/api/queues | python -m json.tool

Page 66: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• Logs

• rabbitmqctl status

• rabbitmqctl environment

• rabbitmq-top (ships with RabbitMQ as of 3.6.3)

• HTTP API (lots of metrics)

• Message tracing ("firehose")

Page 67: Troubleshooting RabbitMQ and Microservices That Use It

Collecting data from RabbitMQ

• HTTP API (lots of metrics)

• Message tracing ("firehose")

• Infrastructure metrics

Page 68: Troubleshooting RabbitMQ and Microservices That Use It
Page 69: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?

Page 70: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?• Collect logs system-wide

Page 71: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?• Collect logs system-wide

• Collect metrics system-wide

Page 72: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?• Collect logs system-wide

• Collect metrics system-wide

• Collect exceptions system-wide

Page 73: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?• Collect logs system-wide

• Collect metrics system-wide

• Collect exceptions system-wide

• Trace requests (e.g. with Zipkin)

Page 74: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?• Collect logs system-wide

• Collect metrics system-wide

• Collect exceptions system-wide

• Trace requests (e.g. with Zipkin)

• Analyze

Page 75: Troubleshooting RabbitMQ and Microservices That Use It
Page 76: Troubleshooting RabbitMQ and Microservices That Use It

Common theme?• Collect logs system-wide

• Collect metrics system-wide

• Collect exceptions system-wide

• Trace requests (e.g. with Zipkin)

• Analyze

• Sounds like something a structured platform can help with!

Page 77: Troubleshooting RabbitMQ and Microservices That Use It

Distributed system debugging is a problem far from being solved.

Page 78: Troubleshooting RabbitMQ and Microservices That Use It
Page 79: Troubleshooting RabbitMQ and Microservices That Use It

Thank you

Page 80: Troubleshooting RabbitMQ and Microservices That Use It

Thank you• @michaelklishin

Page 81: Troubleshooting RabbitMQ and Microservices That Use It

Thank you• @michaelklishin

• github.com/michaelklishin

Page 82: Troubleshooting RabbitMQ and Microservices That Use It

Thank you• @michaelklishin

• github.com/michaelklishin

[email protected]