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

allow prometheus-exporter to export metrics on workload level #573

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

hebestreit
Copy link
Contributor

@hebestreit hebestreit commented Dec 18, 2024

Overview

With this change it's possible to set extra environment variables for the prometheus-exporter. This is desired to set ENABLE_WORKLOAD_METRICS=true. Additionally I've updated the image tag to the latest version.

Additional Information

The logic has been implemented in this PR:
kubescape/prometheus-exporter#24

Don't be confused by the version reduction associated with CI creating negative versions:
kubescape/prometheus-exporter#26

The Docker tag v0.2.0 has been created manually to avoid the above problem.
https://quay.io/repository/kubescape/prometheus-exporter?tab=tags

How to Test

Create a values.yaml with minimal config:

capabilities:
  prometheusExporter: enable
prometheusExporter:
  env:
    - name: ENABLE_WORKLOAD_METRICS
      value: "true"

Render the helm template and and check the occurrence:

helm template kubescape-operator kubescape-operator -f values.yaml | grep -5 "ENABLE_WORKLOAD_METRICS"
                  resource: limits.cpu
            - name: KS_LOGGER_LEVEL
              value: "info"
            - name: KS_LOGGER_NAME
              value: "zap"
            - name: ENABLE_WORKLOAD_METRICS
              value: "true"
          volumeMounts:
            - name: ks-cloud-config
              mountPath: /etc/config
              readOnly: true

@hebestreit hebestreit force-pushed the feature/prometheus-exporter-env branch 2 times, most recently from 87a9670 to 4a01db7 Compare December 19, 2024 13:24
@matthyx matthyx self-requested a review December 19, 2024 13:29
Copy link
Contributor

@matthyx matthyx left a comment

Choose a reason for hiding this comment

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

please also enable the new feature in snapshot_test.yaml ("all capabilities" scenario) and update unittests

@@ -772,6 +772,11 @@ prometheusExporter:
targetPort: 8080
protocol: TCP

env: []
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to have a variable enableWorkloadMetrics that would add ENABLE_WORKLOAD_METRICS in the deployment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me too. Please take a look and let me know if I've missed anything.

@hebestreit hebestreit force-pushed the feature/prometheus-exporter-env branch from 4a01db7 to 2ec9d41 Compare December 19, 2024 15:23
@hebestreit hebestreit requested a review from matthyx December 19, 2024 15:27
Copy link
Contributor

@matthyx matthyx left a comment

Choose a reason for hiding this comment

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

awesome, thanks @hebestreit !
I'm not sure we'll release before Christmas, but definitely in the beginning of 2025

@matthyx matthyx merged commit 31aa80f into kubescape:main Dec 19, 2024
4 checks passed
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.

2 participants