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

add UDP telemetry support #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

weijiage
Copy link

Add UDP support, feed the telemetry data onto InfluxDB.
Issue: Add UDP telemetry support #6

Please start JTIMON as shown below.
$ ./jtimon-linux-amd64 --config udp.json --udp --print

where udp.json is following
{ "udp": { "host": "your-junos-ip-or-hostname", "port": UDP-Port-Number }, "influx": { "server": "127.0.0.1", "port": 8086, "dbname": "mydb", "user": "influx", "password": "influxdb", "recreate": true } }

@weijiage weijiage requested a review from nileshsimaria April 20, 2023 19:25
@@ -23,6 +23,7 @@ var (
prom = flag.Bool("prometheus", false, "Stats for prometheus monitoring system")
promHost = flag.String("prometheus-host", "127.0.0.1", "IP to bind Prometheus service to")
promPort = flag.Int32("prometheus-port", 8090, "Prometheus port")
udp = flag.Bool("udp", false, "Stats for udp monitoring system")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why CLI option given that there is already udp in .json file ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for advice. Please find the changes in commit remove udp CLI option.

type UDPConfig struct {
Port int `json:"port"`
Host string `json:"host"`
Protos []string `json:"protos"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makefile target to compile protos are missing ?

Copy link
Author

@weijiage weijiage Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the user may not provide specific proto files in the JTIMON config, and it may be time consuming to compile all the protos, therefore I just uploaded all the .pb.go files along with the proto files under /schema.
I'd love to add make proto in the Makefile as needed.

Just to clarify, the Makefile target is expected to compile all the protos?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,

@nileshsimaria
Copy link
Collaborator

unit tests are missing.

@nileshsimaria
Copy link
Collaborator

The existing tests are broken.
$ make
GOOS=linux GOARCH=amd64 go build -mod vendor --ldflags="-X main.jtimonVersion=-c3c3d99449e5c415f65bb56671eb15d6dd5088ea-udp_telemetry_support -X main.buildTime=2023-04-20T20:29:42-0700" -o jtimon-linux-amd64 .
udp.go:29:2: cannot find package "github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema" in:
/Users/nsimaria/work/src/github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema
udp.go:30:2: cannot find package "github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema/telemetry_top" in:
/Users/nsimaria/work/src/github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema/telemetry_top
make: *** [linux] Error 1

@weijiage
Copy link
Author

The existing tests are broken. $ make GOOS=linux GOARCH=amd64 go build -mod vendor --ldflags="-X main.jtimonVersion=-c3c3d99449e5c415f65bb56671eb15d6dd5088ea-udp_telemetry_support -X main.buildTime=2023-04-20T20:29:42-0700" -o jtimon-linux-amd64 . udp.go:29:2: cannot find package "github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema" in: /Users/nsimaria/work/src/github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema udp.go:30:2: cannot find package "github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema/telemetry_top" in: /Users/nsimaria/work/src/github.com/Juniper/jtimon/vendor/github.com/Juniper/jtimon/schema/telemetry_top make: *** [linux] Error 1

Please run go mod tidy and go mod vendor before make. I'm afraid that there's lots of changes in go.mod.

@nileshsimaria
Copy link
Collaborator

You cant expect users to run go mod tidy, etc. You need to commit the dependencies.

@rogerwiklund
Copy link

Any news on this?

@maksimse
Copy link

We have MX104 that we want to collect telemetry from. It only supports UDP. But Jtimon doesn't support it. Any ideas how to capture udp and translate into prometheus metric?

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

Successfully merging this pull request may close these issues.

4 participants