Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zmq issue #221

Open
ciumagcatalin opened this issue Oct 4, 2024 · 4 comments
Open

zmq issue #221

ciumagcatalin opened this issue Oct 4, 2024 · 4 comments

Comments

@ciumagcatalin
Copy link

Hello,

I am trying to setup the ZQM integration for dispatcher and I am getting this issue. I think the config piece is not right and there is not much information on how to set it:
Can somebody that did this before check this setup?

"port": 443,
"log_level": "debug",
"json_log_enable": true,
"namespace": "telemetry",
"reliable_ack": false,
"rate_limit": {
"enabled": false,
"message_limit": 100
},
"pubsub": {
"gcp_project_id": "tesla-telemetry-437316"
},
"zmq": {
"addr": "tcp://xxxxxx.compute-1.amazonaws.com:5555"
},

"records": {
"alerts": [
"logger",
"pubsub"
],
"errors": [
"logger",
"pubsub"
],
"V": [
"logger",
"pubsub",
"zmq"
]
},

pp-1 | 2024/10/04 15:30:20 maxprocs: Leaving GOMAXPROCS=1: CPU quota undefined
app-1 | {"activity":true,"context":"fleet-telemetry","level":"info","msg":"config_skipping_empty_metrics_provider","time":"2024-10-04T15:30:20Z"}
app-1 | {"activity":true,"context":"fleet-telemetry","level":"info","msg":"starting_server","time":"2024-10-04T15:30:20Z"}
app-1 | {"activity":true,"context":"fleet-telemetry","level":"info","msg":"pubsub_registerd","namespace":"telemetry","project":"tesla-telemetry-437316","time":"2024-10-04T15:30:20Z"}
app-1 | panic: no such device
app-1 |
app-1 | goroutine 1 [running]:
app-1 | main.main()
app-1 | /go/src/fleet-telemetry/cmd/main.go:46 +0x125

Catalin

@Bre77
Copy link

Bre77 commented Oct 4, 2024

Sorry I didn't get back to you on Discord, I couldn't remember how it had it configured but I've gone back through my commit history now.

You configure the Fleet Telemetry server as a ZMQ producer, which ZMQ clients connect to, so you shouldn't put an external domain, but rather an IP and port to bind to.

"zmq":"0.0.0.0:3000"

@ciumagcatalin
Copy link
Author

Sorry I didn't get back to you on Discord, I couldn't remember how it had it configured but I've gone back through my commit history now.

You configure the Fleet Telemetry server as a ZMQ producer, which ZMQ clients connect to, so you shouldn't put an external domain, but rather an IP and port to bind to.

"zmq":"0.0.0.0:3000"

Sorry I didn't get back to you on Discord, I couldn't remember how it had it configured but I've gone back through my commit history now.

You configure the Fleet Telemetry server as a ZMQ producer, which ZMQ clients connect to, so you shouldn't put an external domain, but rather an IP and port to bind to.

"zmq":"0.0.0.0:3000"

No worries. Thank you for the input here! More people might benefit from the guidance.
On the topic: I added as in the config: "zmq": {
"addr": "tcp://0.0.0.0:4444"
},
Error disappeared but the subscriber that is outside of the server does not receive the messages. Logs look clean on the telemetry, but I did not install ZMQ on it (Amazon Linux 2023 distribution). Two questions here:

  1. Does telemetry comes with zmq library components for itself to function or it needs to be installed? I assume it would log the errors if not.
  2. If telemetry becomes ZQM producer then I should be able to be subscriber on same instance as well. Do I get this right?

@Bre77
Copy link

Bre77 commented Oct 5, 2024

The way I used it was I had my NodeJS application connect to my fleet telemetry server using ZMQ. You dont need to install any other software to use ZMQ as its connections are directly client to server.

You need to configure your subscriber to connect to the IP of your fleet telemetry container/server on 4444 (your exposing that port right?)

@ciumagcatalin
Copy link
Author

Yes, I am exposing that port and I am able to do a publisher-subscriber test outside of the telemetry. However the telemetry seems not to post the messages. I did try to also subscribe directly from the telemetry server and nothing.
The telemetry docker log looks like this. Is there a particular log posted when the zmq dispatcher push works?

On my test I am subscribing to all topics:

import zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect("tcp://ip-172-31-81-115.ec2.internal:5555")
socket.setsockopt_string(zmq.SUBSCRIBE, '')

while True:
message = socket.recv_string()
print(f"Received message: {message}")

Telemetry logs:

app-1 | {"context":"fleet-telemetry","level":"debug","msg":"dispatching_message","payload":"FAAAAAAADgAYABQAEAAPAAgABAAOAAAAFAAAADgAAAAAAAAEEAAAABQAAAAAAAAAAAAAAAEAAABWAAAAAAAAAAAAAAAQACAAGAAcABQAEAAMAAQAEAAAAIW6mmWSAQAAFAAAACgAAAA4AAAAk3sDZ2AAAAARAAAAWFA3WUdDRUs5UEIwNzY3NTYAAAAOAAAAdmVoaWNsZV9kZXZpY2UAACsAAAAKDQggEgkKBzE5My40MTcKDAgIEggKBjYzLjI2MBIMCJP3jbgGEJeaidgDACAAAAB2ZWhpY2xlX2RldmljZS5YUDdZR0NFSzlQQjA3Njc1NgAAAAA=","socket_id":"72721039-f405-444a-9678-ffd6641b5ed3","time":"2024-10-07T06:11:32Z"}
app-1 | {"activity":true,"context":"fleet-telemetry","data":{"CreatedAt":"2024-10-07T06:11:31Z","RatedRange":"193.417","Soc":"63.260","Vin":"XP7YGCEK9PB076756"},"level":"info","metadata":{"receivedat":"1728281492000","timestamp":"0","txid":"","txtype":"V","version":"0","vin":"XP7YGCEK9PB076756"},"msg":"record_payload","time":"2024-10-07T06:11:32Z","vin":"XP7YGCEK9PB076756"}
app-1 | {"context":"fleet-telemetry","level":"debug","msg":"message_respond","record_type":"V","response_type":"ack","time":"2024-10-07T06:11:32Z","txid":""}
app-1 | {"context":"fleet-telemetry","error":"tls: failed to send closeNotify alert (but connection was closed anyway): write tcp 192.168.176.2:443-\u003e85.113.250.219:39773: write: broken pipe","level":"error","msg":"websocket_close_err","time":"2024-10-07T06:13:49Z"}
app-1 | {"V":"3886","activity":true,"context":"fleet-telemetry","duration_sec":1196,"level":"info","msg":"socket_disconnected","time":"2024-10-07T06:13:49Z","total":"3886"}
app-1 | {"activity":true,"context":"fleet-telemetry","duration_ms":1196697,"level":"info","method":"GET","msg":"request_end","remote_ip":"85.113.250.219:39773","time":"2024-10-07T06:13:49Z","urlPath":"/","uuid":"1cc743f5-3974-425b-bf17-eec935516cd2"}
app-1 | {"context":"fleet-telemetry","level":"debug","msg":"return_stop_chan","time":"2024-10-07T06:13:49Z"}
app-1 | {"context":"fleet-telemetry","level":"debug","msg":"writer_done","time":"2024-10-07T06:13:49Z"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants