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

✨ add custom metrics #812

Merged
merged 1 commit into from
Jul 3, 2023
Merged

Conversation

mariuskimmina
Copy link
Contributor

#213

Currently, this only adds one metrics mondoo_audit_config which shows the number of mondoAuditConfigs.

@mariuskimmina mariuskimmina marked this pull request as draft May 28, 2023 07:54
@mariuskimmina
Copy link
Contributor Author

Set as draft MR so we can discuss which other metrics should be exposed

@czunker
Copy link
Contributor

czunker commented Jun 16, 2023

Hi @mariuskimmina ,

thanks for your PR.

The idea behind the issue was to get to the next capability level for the operator:
image

As you can see here, we are currently at level 3. We do not have any metrics we currently need. The amount of configs is a nice first indicator.

We appreciate your contribution and think this is the right direction going forward. It would be nice if you could add tests for the metrics.

@mariuskimmina
Copy link
Contributor Author

thanks for the insight, I should be able to add tests sometime next week

@mariuskimmina mariuskimmina marked this pull request as ready for review June 27, 2023 05:58
@mariuskimmina
Copy link
Contributor Author

Added a (very minimal) test for this

@czunker
Copy link
Contributor

czunker commented Jun 29, 2023

@mariuskimmina Thanks for adding the tests.

Strangely, now the linter step fails, which seems unrelated to your PR:

Error: /usr/bin/tar: ../../../go/pkg/mod/go.uber.org/multierr@v1.9.0/error.go: Cannot open: File exists

And a lot more like these. I need to look into this.

@czunker
Copy link
Contributor

czunker commented Jun 29, 2023

There are some issues, e.g., golangci/golangci-lint-action#244 and golangci/golangci-lint-action#135 which mention this problem. Perhaps the solution is just disabling some conflicting caching...

@czunker
Copy link
Contributor

czunker commented Jun 29, 2023

Strange, this job shows the same errors but still passes: https://github.com/mondoohq/mondoo-operator/actions/runs/5390664672/jobs/9833822310

@czunker
Copy link
Contributor

czunker commented Jun 29, 2023

The actual cause was burried somewhere in the logs:

2023-06-29T09:10:32.7051321Z ##[group]run golangci-lint
2023-06-29T09:10:32.7052505Z Running [/home/runner/golangci-lint-1.49.0-linux-amd64/golangci-lint run --out-format=github-actions --timeout=15m0s] in [] ...
2023-06-29T09:10:43.9061007Z ##[error]File is not `gofumpt`-ed (gofumpt)
2023-06-29T09:10:43.9062486Z ##[error]File is not `gofumpt`-ed (gofumpt)
2023-06-29T09:10:43.9064201Z ##[error]File is not `gofumpt`-ed (gofumpt)
2023-06-29T09:10:43.9065180Z ##[error]field `scheme` is unused (unused)
2023-06-29T09:10:43.9066164Z ##[error]const `controllerName` is unused (unused)
2023-06-29T09:10:43.9066594Z 
2023-06-29T09:10:43.9067059Z ##[error]issues found
2023-06-29T09:10:43.9067629Z Ran golangci-lint in 11201ms

@mariuskimmina Please have a look at the linter issues.

Note to myself: We still need to fix the error message to make it easier to find real problems.

czunker added a commit that referenced this pull request Jun 30, 2023
The errors polutew the logs and make it hard to find real problems

For some background, see #812

Signed-off-by: Christian Zunker <christian@mondoo.com>
@mariuskimmina
Copy link
Contributor Author

Linter issues have been fixed @czunker

Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>
czunker added a commit that referenced this pull request Jul 3, 2023
The errors polute the logs and make it hard to find real problems

For some background, see #812

Signed-off-by: Christian Zunker <christian@mondoo.com>
@czunker czunker added the ok to test This will start our CI workflows for dependabot and fork PRs label Jul 3, 2023
@github-actions github-actions bot removed the ok to test This will start our CI workflows for dependabot and fork PRs label Jul 3, 2023
@mariuskimmina
Copy link
Contributor Author

The failing test seem to be due to issues pulling images: trying and failing to pull image

Copy link
Contributor

@czunker czunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution @mariuskimmina

@czunker czunker merged commit 7e2c082 into mondoohq:main Jul 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants