Easy swap Graylog to Sentry when you have complexity infrastructure

Mikhail Panfilov
2 min readMar 31, 2020

Hey, medium! Graylog is a popular instrument for log processing, storing and analyzing. But Sentry is a more useful instrument, which gives to us more opportunities.

If you want to migrate log processing to Sentry you must change a lot of code, configs, and the same logic which describe your architecture. Also, you can not know, do you need Sentry or no? To make the final decision you need to make an experiment, with the simplest realization as possible.

Just all of you need it is a one instrument

The simplest solution will be up an adapter, which will accept messages instead of Graylog, convert and sent them to Sentry.

There is a GTSA tool for this.

GTSA (Gelf To Sentry Adapter) is the simple solution to proxy gelf messages (messages for Graylog) to Sentry

The simplest way to use this, just run the docker container.

docker pull mnwamnowich/gtsadocker run -p 8080:8080/udp --env SENTRY_DSN=dsn --name gtsa mnwamnowich/gtsa

Where dsn env is you sentry dsn.

Now the container will be accepted messages via UDP from your architecture and pass it to your Sentry.

Also, if you applications sent messages via TCP, you can pass 8081 port from the container:

docker run -p 8081:8081/tcp --env SENTRY_DSN=dsn --name gtsa mnwamnowich/gtsa

Also, you can install and up GTSA from cargo:

cargo install gtsa
gtsa

Performance

A lot of applications generate a thousand messages per sec. Is it possible for GTSA to accept it? Yes, GTSA is written on Rust, which gives you excellent performance, actor architecture allows completely recycle resources without freezing.

You can easy to speed up this tool with those environment variables:

READER_THREADS=1 // cpus for convert messages from graylog to sentry
UNPACKER_THREADS=1 // cpus for decoding gzip or zlib messages (udp only)
MAX_PARALLEL_CHUNKS=100000 // maximum parrallel udp messsages, which GTSA can process (udp only)

Conclusion

You can read more about GTSA in Readme, also you can check the code on the repository.

--

--