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

Metrics unavailable in Prometheus without explicit Port declarations #4158

Open
Jeansen opened this issue Jun 28, 2024 · 2 comments
Open

Metrics unavailable in Prometheus without explicit Port declarations #4158

Jeansen opened this issue Jun 28, 2024 · 2 comments
Assignees
Labels

Comments

@Jeansen
Copy link

Jeansen commented Jun 28, 2024

Tracee has metrics enabled by default, but relevant ports are not explicitly exposed so Prometheus could collect them. Only after I added

  ports:
    - name: metrics
      containerPort: 3366
      protocol: TCP

to the container stance in Tracee Daemonset, which now looks more like this then:

containers:
  - name: tracee
    image: docker.io/aquasec/tracee:0.20.0
    command:
      - /tracee/tracee
    args:
      - '--config'
      - /tracee/config.yaml
    ports:
      - name: metrics
        containerPort: 3366
        protocol: TCP
...

Prometheus was able to see the metrics with the following PodMonitor:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: monitoring-tracee
  namespace: default
  labels:
    name: monitoring-tracee
    release: prometheus-grafana
spec:
  namespaceSelector:
    matchNames:
    - tracee
  podMetricsEndpoints:
  - interval: 5s
    port: metrics
  selector:
    matchLabels:
      app.kubernetes.io/name: tracee
@rscampos rscampos self-assigned this Jun 28, 2024
@rscampos
Copy link
Contributor

rscampos commented Jun 28, 2024

Hey @Jeansen, thank you for report this issue and to give some detail, I'll handle it :)

@Jeansen
Copy link
Author

Jeansen commented Jun 28, 2024

@rscampos Great. Thanks a lot. BTW, is it intentional that there are only metrics for ebpf? For instance, there are no more metrics for loaded signatures. Just mentioning it ;-)

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

No branches or pull requests

2 participants