Skip to main content

snifter

Listen to and inspect AWS SNS topic data!

Because SNS data is ephemeral, we need to make a place to receive and store the data if we want to inspect it. While you can subscribe your email address, it’s not very handy to do so (SMS is obviously not better). A clean (if slightly over-complex) method for doing this is to create a temporary SQS queue, then subscribe the queue to the SNS topic you want to inspect, and then watch that queue.

Snifter does all that in a single command. The queue is build and torn down for you, and it will endlessly listen to that queue, including dropping into an interactive debug session that will let you inspect the payload in detail.

Provide a profile and a topic, the queue will be torn down when it catches Ctrl+c

Basic Usage

$ snifter --profile=dev-power --topic=tim-manager-events
Listening...
Listening...
^CListening...
Deleted queue with URL https://us-west-2.queue.amazonaws.com/024726604032/sns-listener_tim-manager-events_88fc71e98a.

Debug Usage

Providing the –debug flag will cause you to drop into a debugger when something is popped from the queue, PDB behavior applies. The payload of the SNS message (‘Message’) is assigned a namespace (‘m’). This means that you get tab completion on the dynamic keys in your message payload.

https://user-images.githubusercontent.com/419355/161634911-f0103e13-5c14-4628-84bc-5a001323de7a.gif

Help

$ snifter --help
usage: snifter [-h] [-p PROFILE] [-d] [-t TOPIC]

Listen to an SNS topic

optional arguments:
  -h, --help            show this help message and exit
  -p PROFILE, --profile PROFILE
                        AWS profile name
  -d, --debug           Drop into debugger to inspect message
  -t TOPIC, --topic TOPIC
                        SNS topic name

Login

https://user-images.githubusercontent.com/419355/161607497-637e13e6-32a2-4d70-8336-9153691d4d61.gif

Listening

https://user-images.githubusercontent.com/419355/161607493-9fd60169-0aab-4637-b709-593cf315e6eb.gif

Inspecting (with debug on)

$ snifter --profile=dev-power --topic=tim-manager-events --debug
Listening...
Listening...
Attempting decode of body
Dropping into debugger for inspection
Local message namespace is 'm'
PDB commands: 'c' to continue, 'exit()' to exit
[2] > /home/ahonnecke/src/snifter/src/snifter/main.py(161)listen()
-> message.delete()
(Pdb++) list
156                         print("PDB commands: 'c' to continue, 'exit()' to exit")
157                         breakpoint()
158                     else:
159                         print(f"Recieved message, {show}")
160
161  ->                 message.delete()
162
163                 print("Listening...")
164                 sleep(1)
165
166
(Pdb++) print(m.curve_angle)
None
(Pdb++) print(m.failed_rsu_ids)
['590d0953-444d-4f0a-842d-3ad425394baf', '8bfacac8-9c8f-41e6-b9a3-09641913da8a', 'd4d7cc04-b98a-4ad8-b9b6-801966c84f68', 'e7e259da-926c-4c0e-93cd-a8507bda76b3']

Metadata

Release files for snifter 0.0.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snifter 0.0.19
File Size Uploaded Provenance
snifter-0.0.19.tar.gz 22.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for snifter 0.0.19
File Interpreter ABI Platform
snifter-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / snifter-0.0.19.tar.gz

Download URL snifter-0.0.19.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9a663fb98bacbdcc5f0b532f39c5e2ff3dcbda3000b648cfb08abcb7522c225c
BLAKE2b-256 checksum
How to use checksums
3883255bc8ed8a02e88b9d9ff12b9b82f1200a75d36d0a27a64394c8f6a47b2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.7

Release files / snifter-0.0.19-py3-none-any.whl

Download URL snifter-0.0.19-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b21e5814850a3205b7bb8f02ebe4ba12b1bc9fc427c9202d4fffe51ad282f556
BLAKE2b-256 checksum
How to use checksums
f9e8fe8eef202adb595d2d9c2d5683f05fff7132719f0dc9b0dae0e6c0b12f78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.7

Security for snifter 0.0.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page