-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adds prometheus metrics #63
Conversation
- Changes the script to use a "local" version of memcoin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments, I only feel strongly about the makefile 😅 looks pretty neat overalls
README.md
Outdated
Build info can be added to the binary with the `ldflags`, at build time.. Infos | ||
are stored on variables in the root `mod.go`. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build info can be added to the binary with the `ldflags`, at build time.. Infos | |
are stored on variables in the root `mod.go`. For example: | |
Build info can be added to the binary with the `ldflags`, at build time. | |
Infos are stored on variables in the root `mod.go`. For example: |
start_test.sh
Outdated
versionFlag="github.com/dedis/d-voting.Version=`git describe --tags`" | ||
timeFlag="github.com/dedis/d-voting.BuildTime=`date +'%d/%m/%y_%H:%M'`" | ||
|
||
go build -ldflags="-X $versionFlag -X $timeFlag" ./cli/memcoin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be in a location that shouldn't be concerned with building.
I'd make this part of the Makefile.
metrics/controller/mod.go
Outdated
func (m controller) SetCommands(builder node.Builder) { | ||
|
||
cmd := builder.SetCommand("metrics") | ||
cmd.SetDescription("interact with the DKG service") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the description here correct? 🤔
go func() { | ||
errc <- srv.listen() | ||
}() | ||
|
||
for i := 0; i < defaultRetry && srv.getAddr() == nil; i++ { | ||
select { | ||
case err := <-errc: | ||
return xerrors.Errorf("failed to listen: %v", err) | ||
case <-time.After(waitRetry): | ||
} | ||
} | ||
|
||
srvAddr := srv.getAddr() | ||
if srvAddr == nil { | ||
return xerrors.Errorf("failed to start metric server") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this, the polling seems entirely avoidable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't solve our problem because we are using an external function to create and start the HTTP server. And we don't want the function to panic with a log.Fatal(server.Serve(ln))
.
- use a make file to build - fixes wrong command description
d3974fc
to
97efc99
Compare
```sh | ||
versionFlag="github.com/dedis/d-voting.Version=`git describe --tags`" | ||
timeFlag="github.com/dedis/d-voting.BuildTime=`date +'%d/%m/%y_%H:%M'`" | ||
|
||
go build -ldflags="-X $versionFlag -X $timeFlag" ./cli/memcoin | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make build
should be enough, now, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, that's explained the line bellow 😄 . I found it interesting to explain a bit the magic behind build-time variables.
Waiting on dedis/dela#209 before merging it. |
- Removes deprecated protobuf check
Pull Request Test Coverage Report for Build 1979417812
💛 - Coveralls |
Kudos, SonarCloud Quality Gate passed! |
Depends on dedis/dela#209
For now we mainly have Dela metrics. Additional metrics specific to the d-Voting system will be added later.