Giter Site home page Giter Site logo

codex-team / hawk.collector Goto Github PK

View Code? Open in Web Editor NEW
1.0 7.0 0.0 10.27 MB

High-performance messages collector for the Hawk project

License: GNU General Public License v3.0

Dockerfile 1.42% Makefile 2.72% Go 95.86%
hawk collector fasthttp websockets high-performance

hawk.collector's People

Contributors

dependabot[bot] avatar f0m41h4u7 avatar ilyamore88 avatar kabachook avatar n0str avatar nespecc avatar nikmel2803 avatar talyguryn avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hawk.collector's Issues

Configuration file

Load all parameters from config.json

  • RabbitMQ connection URL with credentials
  • connection retry limit
  • exchange and rabbitMQ settings (persistence, autoDelete, ack etc.)
  • listen host and port
  • exchange name
  • default path

Add config generation wizard if not found.

Deploy scripts

Build scripts to setup

  • RabbitMQ
  • Nginx with load balancing
  • Golang server

Collector must close gracefully when rabbitmq is not available

Now it just panics

2021/04/17 13:35:37 Failed to connect to RabbitMQ (amqp://guest:guest@rabbitmq:5672/): dial tcp: lookup rabbitmq: no such host
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x13523bb]

Write test plan

Add testings docs
Add integration testing guide
Add samples and typical commands

Error during hawk.Catch with disabled catcher in ENV

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x737c96]

goroutine 135 [running]:
github.com/codex-team/hawk%2ego.(*Catcher).Catch(0x0, 0xabd040, 0xe61d20, 0xc000132cb0, 0x19)
	/go/pkg/mod/github.com/codex-team/[email protected]/catch.go:89 +0xe6
github.com/codex-team/hawk.collector/pkg/hawk.Catch(0xabd040, 0xe61d20)
	/build/pkg/hawk/main.go:48 +0x4e
github.com/codex-team/hawk.collector/pkg/server.(*Server).handler.func1(0xc00010fc70, 0xc000183200)
	/build/pkg/server/server.go:88 +0x131
panic(0x960d00, 0xe61d20)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/codex-team/hawk%2ego.(*Catcher).Catch(0x0, 0xabc920, 0xc00004fc10, 0xc000369b68, 0x40c7a8)
	/go/pkg/mod/github.com/codex-team/[email protected]/catch.go:89 +0xe6
github.com/codex-team/hawk.collector/pkg/hawk.Catch(0xabc920, 0xc00004fc10)
	/build/pkg/hawk/main.go:48 +0x4e
github.com/codex-team/hawk.collector/pkg/server/errorshandler.(*Handler).HandleWebsocket(0xc000081728, 0xc000183200)
	/build/pkg/server/errorshandler/handler_websocket.go:46 +0xa6
github.com/codex-team/hawk.collector/pkg/server.(*Server).handler(0xc000081680, 0xc000183200)
	/build/pkg/server/server.go:97 +0x1f1
github.com/valyala/fasthttp.(*Server).serveConn(0xc0000fa200, 0xacbd40, 0xc00000e1b0, 0x0, 0x0)
	/go/pkg/mod/github.com/valyala/[email protected]/server.go:1926 +0x878
github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc0001275e0, 0xc000227820)
	/go/pkg/mod/github.com/valyala/[email protected]/workerpool.go:212 +0xc0
github.com/valyala/fasthttp.(*workerPool).getCh.func1(0xc0001275e0, 0xc000227820, 0x91c1a0, 0xc000227820)
	/go/pkg/mod/github.com/valyala/[email protected]/workerpool.go:184 +0x35
created by github.com/valyala/fasthttp.(*workerPool).getCh
	/go/pkg/mod/github.com/valyala/[email protected]/workerpool.go:183 +0x10a

Add ACK subscription to the protocol

The idea is to provide token for user subscription.
He can use this token to connect to the pub-sub server (centrifugo) and get information about processings statuses or other statistics

Empty payload causes 500

Input
{ "token": "eyJhbGci<...>iJN0dg", "catcherType": "errors/python" }

Result
{ "error": true, "message": "Server error", "status": 500 }

RabbitMQ reconnect

Check reconnect during work feature.
Add proper logging events for connection issues.

Parallel research

Compare if there can be a significant difference in performance when use multiprocessing and different number of connections.

Statistics

Provide variants of runtime monitoring

  • Number of connections per user
  • Messages rate per user

Govendor

Check if it is possible to remove vendor files and add govendor fetch to the deploy scripts and docker

JWT support

Parse JWT and check validity of digital signature

EasyJSON research and deploy

Compare JSON marshalling and unmarshalling speed during highload for EasyJSON and standard JSON in golang.

If easyJSON is better – generate helpers

Release-commits structure

Commits sent during release must follow the structure (or be omitted):
– hash
– title
– author
– date

Websockets

Support error messages delivery through websockets

Travis CI

Add travis and write integration tests

JSON config beautifulize

Config must be human-readable:

{
  "broker_url": "amqp://guest:guest@localhost:5672/",
  "exchange_name": "errors",
  "server_host": "localhost",
  "server_port": 3000,
  "retry_number": 5,
  "retry_interval": 3
}

The use of standard MarshalIndent feature would be appropriate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.