jsonds icon indicating copy to clipboard operation
jsonds copied to clipboard

How to build / start?

Open MarkoBursic opened this issue 5 years ago • 9 comments

I have installed golang, but executing jsonds:

xxxxxxx:~/go/src/github.com/smcquay/jsonds$ jsonds jsonds: command not found

Gives this error. So, how should I start your program(s)?

MarkoBursic avatar Dec 02 '19 09:12 MarkoBursic

Try ./jsonds in that same directory.

harshathulasi avatar Dec 05 '19 08:12 harshathulasi

There is no such file. Somehow it needs to be build by Go, before you can use it. But there is no makefile or any tutorial how to build it.

MarkoBursic avatar Dec 05 '19 15:12 MarkoBursic

You are right. I think its in $GOPATH/bin:

~/go$ cd src/
~/go/src$ ls
github.com  golang.org
~/go/src$ cd github.com/
~/go/src/github.com$ ls
labstack  mattn  smcquay  streadway  valyala
~/go/src/github.com$ cd smcquay/
~/go/src/github.com/smcquay$ ls
jsonds
~/go/src/github.com/smcquay$ cd jsonds/
~/go/src/github.com/smcquay/jsonds$ ls
cors.go  json.go  LICENSE  main.go  README.md  server.go
~/go/src/github.com/smcquay/jsonds$ cd ../../../../bin
~/go/bin$ ls
jsonds
~/go/bin$ ./jsonds 
^C
~/go/bin$ 

Try that.

harshathulasi avatar Dec 05 '19 16:12 harshathulasi

Although on a separate note, building/running from the source code is not working for me either. I'm a golang noob. Any advice on what I am doing wrong?

~/go/src/github.com/smcquay/jsonds$ go run main.go 
# command-line-arguments
./main.go:17:7: undefined: newServer
./main.go:26:23: undefined: cors
./main.go:27:34: undefined: cors
~/go/src/github.com/smcquay/jsonds$ 

harshathulasi avatar Dec 05 '19 16:12 harshathulasi

You are correct the jsonds is in the bin folder, still I don't know how it came there. I have the same results as user @ozn0417 . I would like to insert your code in a Go application, it has to send 3 float values to Grafana, single stat panel for monitoring actual values. Your code seems excellent candidate, since it is very small. Unfortunately I am a noob in Go and your code is not documented. Although it is alive on port:8000 and gives OK response on /search. It would be a big help if you could make an application that sends random numbers to grafana to better understand.

MarkoBursic avatar Dec 05 '19 17:12 MarkoBursic

I agree as well. Could use better documentation. @MarkoBursic , Im trying to figure out using a json data source as well for grafana. I'll let you know if I find a good alternative. With regards to how the jsonds came in bin dirctory, I think it gets installed when you do the "go get ...". I think golang is much more complicated than I thought it would be. Lot of crazy way to manage packages/dependencies/codestructure.

harshathulasi avatar Dec 05 '19 18:12 harshathulasi

@ozn0417 Yes, I have found documentation about go get, it does download and then invoke go install, so that's why binaries were produced. Feel free to post a way on how to make a server for grafana simple json. I already have influxdb as database for log, but it's a pain to show actual data on single stat panel. This is what I am looking for: data from database (trend, table - already done) and UI panel for actual data.

MarkoBursic avatar Dec 05 '19 22:12 MarkoBursic

I have installed golang, but executing jsonds:

The README suggests a different approach. Did you try that?

smcquay avatar Dec 06 '19 00:12 smcquay

I see the search working and annotations too but you haven't implemented the /query. But pretty well made and I think can be easily integrated. I'll forked one copy and will update it. @MarkoBursic , I used this to get a better sense on how grafana interacts with the json data source: https://gitlab.com/oz123/grafana-python-datasource Hope it helps.

harshathulasi avatar Dec 15 '19 01:12 harshathulasi