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

[wip] Feat/go metrics #2

Closed
wants to merge 4 commits into from
Closed

[wip] Feat/go metrics #2

wants to merge 4 commits into from

Conversation

coryschwartz
Copy link

fix: testground/testground#909

Similarly to the old prometheus metrics, I have placed the metrics namedpaced under runenv.M()
The metrics are output once every second.

go-metrics has a Log() method which accepts a logger, however the output is human-readable rather than machine-readable. This is clearly not what we want.

The simple way to write logs to metrics.out in json format is simply to open a Writer and write to it. In order to get zap logging to work, I added a simple Writer which writes to the zap log.

I think we don't need or want both. I would, I think, ditch the zap logging and keep the metrics.log output, @raulk what do you think?

@coryschwartz
Copy link
Author

If you want to see what this plan does, you can use it with this plan:

testground/testground#917

The outputs collection includes a new file metrics.out which has json logging and there is also zap logging which lands in run.out. Either format works fine, in my opinion, although this will make a difference on how testground/testground#910 is implemented.

@coryschwartz
Copy link
Author

If the output we want is zap logging in the metrics.out file, we can add another logger

@coryschwartz coryschwartz requested a review from raulk April 27, 2020 15:30
@raulk
Copy link
Contributor

raulk commented Apr 29, 2020

See #3 for successor.

@raulk raulk closed this Apr 29, 2020
@raulk raulk deleted the feat/go-metrics branch April 29, 2020 21:55
@raulk
Copy link
Contributor

raulk commented Apr 29, 2020

BTW -- this was a good start. I used the API that you laid out, and built on it to add all the backing InfluxDB interactions.

@Robmat05 Robmat05 added the done Completed/Fixed label Apr 30, 2020
@Robmat05 Robmat05 added this to the Testground v0.5 milestone Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Completed/Fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namespace go-metrics under runenv.M() for aggregate metrics
3 participants