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

Promehetus and loki integration #52

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open

Conversation

arturo-seijas
Copy link
Collaborator

@arturo-seijas arturo-seijas commented Dec 3, 2024

Applicable spec:

Overview

Integration with prometheus and loki charms

Rationale

Juju Events Changes

Module Changes

Library Changes

Checklist

weiiwang01
weiiwang01 previously approved these changes Dec 3, 2024
source-commit: 7ab31b3f73b0ce344bd7e4d0deb1d544ae1b7d1c
organize:
main.py: prometheus_exporter.py
prime:

Choose a reason for hiding this comment

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

I think there are other files we want to remove from the repo no ?
Isn't it easier to reverse the logic and only copy what we need ?

src/charm.py Outdated
Comment on lines 196 to 197
"WAZUH_API_USERNAME": "wazuh",
"WAZUH_API_PASSWORD": self.state.api_credentials["wazuh"],

Choose a reason for hiding this comment

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

I'd rather use a dedicated user for this, with read-only permissions, since we're using an external prometheus exporter, that would limit a bit the risk

src/observability.py Show resolved Hide resolved
@@ -179,6 +185,18 @@ def _pebble_layer(self) -> pebble.LayerDict:
),
"startup": "enabled",
},
# "prometheus-exporter": {

Choose a reason for hiding this comment

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

Hi, is there any reason why this code is commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm testing something right now

src/observability.py Outdated Show resolved Hide resolved
source-commit: 7ab31b3f73b0ce344bd7e4d0deb1d544ae1b7d1c
organize:
main.py: prometheus_exporter.py
prime:

Choose a reason for hiding this comment

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

Maybe we can define what we want to keep in stage instead of prime, that way we can also avoid any conflicts

Thanhphan1147
Thanhphan1147 previously approved these changes Dec 3, 2024
Copy link

@Thanhphan1147 Thanhphan1147 left a comment

Choose a reason for hiding this comment

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

LGTM, a few minor comments

Copy link

github-actions bot commented Dec 4, 2024

Test coverage for 5a5a7a6

Name                            Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------
src/certificates_observer.py       59      0      0      0   100%
src/charm.py                      103     27     28      7    68%   64-71, 109, 143-157, 167, 169, 171, 173, 234-242
src/observability.py               13      0      0      0   100%
src/opensearch_observer.py         12      0      0      0   100%
src/state.py                      128     17     14      2    87%   100-101, 146-147, 174-175, 195-196, 199, 218, 220-222, 347-352
src/traefik_route_observer.py      39      0      6      0   100%
src/wazuh.py                      171     63     22      2    64%   102, 198-199, 212-218, 263->exit, 285-308, 319-331, 383-399, 416-439, 447-448, 465-499
---------------------------------------------------------------------------
TOTAL                             525    107     70     11    78%

Static code analysis report

Run started:2024-12-04 12:06:13.530134

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 2562
  Total lines skipped (#nosec): 15
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants