-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
added: display last db update whenever trivy server is started #542
added: display last db update whenever trivy server is started #542
Conversation
I think #346 is talking about Prometheus metrics, not log messages. |
Ohh, I might have gotten confused. I have a few basic doubts with the issue which I have mentioned in the thread of the issue, please clarify them |
OK. Let's wait for @computeralex92's answer. |
Hi @knqyf263, @computeralex92! I added prometheus metrics endpoint support and if you go to # HELP trivy Gauge Metrics associated with trivy - Last DB Update, Last DB Update Attempt ... The timestamps, here, are being stored as Unix Timestamps (float64) because that's what the prometheus Gauge expects. I hope this seems good and if it does then, we can go on and implement the remaining three metrics suggested by @computeralex92. |
Looks great; I looking forward to use this metrics ;-) |
hi @simar7 , can u please review my PR |
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.
Left some comments. At the moment this is also not unit-tested. You could take a look at a few examples here: https://github.com/aquasecurity/trivy/blob/17b84f6c0902172938f8f83420dc432fa87f467e/pkg/rpc/server/listen_test.go
|
@simar7 , I am done with rest of all the issues you mentioned above, so, as soon as the above quoted doubt gets clarified, I'll push all the new changes to this PR 😄 |
Codecov Report
@@ Coverage Diff @@
## main #542 +/- ##
==========================================
- Coverage 68.50% 61.98% -6.52%
==========================================
Files 57 65 +8
Lines 2210 2594 +384
==========================================
+ Hits 1514 1608 +94
- Misses 564 846 +282
- Partials 132 140 +8
Continue to review full report at Codecov.
|
@yashvardhan-kukreja can you try to rebase this on the latest master and resolve the git conflicts? |
@yashvardhan-kukreja I'm still seeing a diff that shouldn't be there in the Dockerfile. See below: Can you also try to run |
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.
lgtm, thanks for the contribution! @knqyf263 would you like to review before we merge?
@simar7 Yes, I'll take a look, but do you know why codecov is failing? |
I tried looking but I'm not sure. The failure doesn't make sense. Maybe it's a bug: https://docs.codecov.io/docs/unexpected-coverage-changes#think-its-codecovs-fault We shouldn't wait for that in this PR though. We can take a look it in a separate discussion. |
@yashvardhan-kukreja Basically, we merge PR with squash commits on GitHub, so you don't have to do that. But we probably should do that this time in order to resolve the error from codecov. |
Went off the grid for a while, hence, the changes took a bit of time. sorry for that pause. |
hi @yashvardhan-kukreja – @knqyf263 is out this week. I'll take a look at your new changes in the meantime. |
@simar7 , no worries. And thanks for reviewing this meanwhile :) |
0c282a2
to
ecca1ff
Compare
c74cbd5
to
d47148b
Compare
ping @knqyf263 |
@yashvardhan-kukreja, could you review the conflicting files? |
d47148b
to
0d7f4c2
Compare
I have rebased this PR with the latest state main. Sorry that it took some time. Was a little swamped and the conflicts were pretty major with respect to the new state of main branch :P |
Also, I have added unit tests around the "extended config" structs as well for the sake of testing the Prometheus MetricsRegistry Setup as well |
I'm sorry for the late reply. I'm busy on a new feature scanning config files now. After wrapping up it, I'll review it. |
Is anyone working on this? |
Instead, we've added |
#346
Results before the change
trivy server --listen localhost:8080
2020-06-23T10:28:45.072+0530 INFO Listening localhost:8080...
Results after the change
trivy server --listen localhost:8080
2020-06-23T10:28:45.072+0530 INFO Last DB Update at: 2020-06-23 00:18:04.500501189 +0000 UTC
2020-06-23T10:28:45.072+0530 INFO Listening localhost:8080...