Skip to main content

JSON log formatter and Sentry client

Project description

Utilities for working with [Sentry](https://github.com/getsentry/sentry). We got into trouble using the in-app Sentry client [raven-python](https://github.com/getsentry/raven-python) client with high volumes so we decided to take the HTTP posting to Sentry out of the app itself. Snitch helps here.

log2json

is a stdlib log formatter that will output log record in Sentry’s JSON format. You can use any handler, but we use it with a file handler so the app can always quickly dump the log record and does not have to wait for an HTTP post.

snitch

monitors a logfile for new lines (like tail but skips all existing content) and sends each new line in a HTTP POST request to the Sentry API. Snitch reloads the log file every half minute or so. On one hand, this is a workaround to deal with log rotation, on the other hand, this deals with high log volumes by just dropping everything and resynching with the present. I mean, when it reopens the file it effectively skips everything that was already logged to the file but not yet processed because it continues at the end of the file after a reopen. This is what we want. Also, snitch does a time.sleep(.1) between all POSTS as a rate-limiter.

alternatives

I haven’t looked into using UDP instead of TCP for sending the messages. This may solve problems on the sending host, but still has the potential of flooding Sentry.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

snitch-0.3.tar.gz (5.2 kB view details)

Uploaded Source

snitch-0.2.tar.gz (5.1 kB view details)

Uploaded Source

snitch-0.1.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file snitch-0.3.tar.gz.

File metadata

  • Download URL: snitch-0.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for snitch-0.3.tar.gz
Algorithm Hash digest
SHA256 c630cc6345010cf7102c53e440ed3613663b1a915a3652785357593dad67c69b
MD5 c0960ce69b9131c3ebc809de945a6d32
BLAKE2b-256 47321725d20ac2fde43bc19d3c17b31ec5a27105634e07188c728a32c730684d

See more details on using hashes here.

File details

Details for the file snitch-0.2.tar.gz.

File metadata

  • Download URL: snitch-0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for snitch-0.2.tar.gz
Algorithm Hash digest
SHA256 aed1063f5c863d4ba9be6fb6f2e05be527d4db5f741c8a41a19d1e53310f1480
MD5 1a06af6eb6f1d75cb6db929f6acf0c92
BLAKE2b-256 99c92234d747584a9ea6f62132a5ca076f9458df8a5070bd663a0544b8f420a9

See more details on using hashes here.

File details

Details for the file snitch-0.1.tar.gz.

File metadata

  • Download URL: snitch-0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for snitch-0.1.tar.gz
Algorithm Hash digest
SHA256 7eae7715b3fff07a04147efd9dcbf73300795895729c626c2fd2265aa17e89b0
MD5 2c5374409cc7b20a78c45a07f22c006c
BLAKE2b-256 6495ea6fbb8f1aa66cf4e23c16c37fbef94cbb3dd7439b02f398004da788ba29

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page