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

refactor!: Metrics service configuration changed #452

Merged
merged 26 commits into from
Jan 19, 2023
Merged

Conversation

dadrus
Copy link
Owner

@dadrus dadrus commented Jan 18, 2023

Related issue(s)

None

Checklist

  • I agree to follow this project's Code of Conduct.
  • I have read, and I am following this repository's Contributing Guidelines.
  • I have read the Security Policy.
  • I have referenced an issue describing the bug/feature request.
  • I have added tests that prove the correctness of my implementation.
  • I have updated the documentation.

Description

This PR makes the metrics service configuration more sound and also more secure.

Old configuration:

metrics:
  prometheus:
    host: "" # listens to all interfaces by default
    port: 10250
    metrics_path: /metrics

New configuration:

metrics: # no indirection, as above. all properties are on the top level
  enabled: true # can now be disabled. Defaults to `true`
  host: 127.0.0.1 # listens on loopback interface only
  port: 10250
  metrics_path: /metrics

The Helm chart has been updated as well and takes into account, that listening on loopback interface only will not allow metrics exposure. So the chart sets this value to 0.0.0.0. As in the past it does not configure a kubernetes service for this port. The chart has also been extended to support enabling and disabling of this service.

@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #452 (05b96b1) into main (8c891bf) will decrease coverage by 0.06%.
The diff coverage is 76.66%.

@@            Coverage Diff             @@
##             main     #452      +/-   ##
==========================================
- Coverage   87.91%   87.85%   -0.06%     
==========================================
  Files         202      200       -2     
  Lines        8077     8088      +11     
==========================================
+ Hits         7101     7106       +5     
- Misses        804      809       +5     
- Partials      172      173       +1     
Impacted Files Coverage Δ
internal/config/metrics.go 0.00% <0.00%> (ø)
internal/handler/metrics/module.go 50.00% <56.66%> (+31.25%) ⬆️
internal/handler/decision/app.go 79.59% <100.00%> (+1.33%) ⬆️
internal/handler/management/app.go 75.60% <100.00%> (+1.92%) ⬆️
internal/handler/profiling/module.go 24.00% <100.00%> (+6.60%) ⬆️
internal/handler/proxy/app.go 80.00% <100.00%> (+1.27%) ⬆️
internal/prometheus/module.go 100.00% <100.00%> (ø)
internal/fiber/middleware/prometheus/defaults.go 0.00% <0.00%> (-100.00%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dadrus dadrus merged commit 1b3a36e into main Jan 19, 2023
@dadrus dadrus deleted the refactor/metrics_config branch January 19, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant