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

Enhance Prometheus Metrics to include Challanege Categories & Juice Shop Version #1379

Merged
merged 4 commits into from
Apr 27, 2020

Conversation

J12934
Copy link
Member

@J12934 J12934 commented Apr 27, 2020

Version Metric

Adds an additional metric juiceshop_version_info which the current running version number (from package.json). This metric has the same structure as the already existing nodejs_version_info metric.

juiceshop_version_info{version="10.2.1",mayor="10",minor="2",patch="1",app="juiceshop"} 1

Challenge Categories

Breaking down metrics juiceshop_challenges_solved & juiceshop_challenges_total by both their difficulties and categories. This lets dashboards add some more context to the users progress.

Before:

juiceshop_challenges_solved{difficulty="1",app="juiceshop"} 0
... 4 skipped lines
juiceshop_challenges_solved{difficulty="6",app="juiceshop"} 0

juiceshop_challenges_total{difficulty="1",app="juiceshop"} 11
... 4 skipped lines
juiceshop_challenges_total{difficulty="6",app="juiceshop"} 11

After:

juiceshop_challenges_solved{difficulty="3",category="XSS",app="juiceshop"} 0
... 48 skipped lines
juiceshop_challenges_solved{difficulty="5",category="Security Misconfiguration",app="juiceshop"} 0

juiceshop_challenges_total{difficulty="3",category="XSS",app="juiceshop"} 2
... 48 skipped lines
juiceshop_challenges_total{difficulty="5",category="Security Misconfiguration",app="juiceshop"} 1

bkimminich and others added 3 commits April 27, 2020 16:14
[ci skip]

Signed-off-by: Jannik Hollenbach <13718901+J12934@users.noreply.github.com>
Signed-off-by: Jannik Hollenbach <13718901+J12934@users.noreply.github.com>
Structure identical to the `nodejs_version_info`metric

Signed-off-by: Jannik Hollenbach <13718901+J12934@users.noreply.github.com>
@J12934 J12934 changed the base branch from master to develop April 27, 2020 14:15
Signed-off-by: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com>
@codeclimate
Copy link

codeclimate bot commented Apr 27, 2020

Code Climate has analyzed commit 389a79f and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 85.3% (0.0% change).

View more on Code Climate.

@bkimminich bkimminich merged commit 986681b into develop Apr 27, 2020
@bkimminich
Copy link
Member

Ah damn, merged to soon. The related integration test fails currently.

@J12934
Copy link
Member Author

J12934 commented Apr 27, 2020

Wait really? I checked and updated these locally and they passed.
Will look into it.

Apparently already fixed, sorry 😐

@bkimminich
Copy link
Member

I fixed it, the -SNAPSHOT on the dev branch failed the regex in the test.

@bkimminich bkimminich deleted the enhanced-metrics branch July 5, 2020 09:56
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants