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

chore: Update tracing & metrics #431

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/howtos/telemetry/20-tracing-qs.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,7 @@ as there is a new service `kubewarden-policy-server` listed in the UI:
![Jaeger dashboard](/img/jaeger-ui-home.png "The dashboard of Jaeger")

The Jaeger collector is properly receiving the traces generated by our PolicyServer.

To access the Jaeger UI, you can create an ingress or use
`kubectl -n jaeger port-forward service/my-open-telemetry-query 16686`
then go to [localhost:16686](localhost:16686).
34 changes: 33 additions & 1 deletion docs/howtos/telemetry/30-metrics-qs.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,36 @@ that allows us to define Prometheus' Targets intuitively.
There are many ways to install and set up Prometheus. For ease of deployment, we will use the
Prometheus community Helm chart.

Let's install the Prometheus stack Helm Chart:
Let's create a `kube-prometheus-stack-values.yaml` file with the
following contents:

```yaml
---
prometheus:
Copy link
Contributor

@fabriziosestito fabriziosestito Jul 25, 2024

Choose a reason for hiding this comment

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

isn't this redundant with the two ServiceMonitor resources created below? why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, dropped them in 95ad718.

additionalServiceMonitors:
- name: kubewarden
selector:
matchLabels:
app: kubewarden-policy-server-default
namespaceSelector:
matchNames:
- kubewarden
endpoints:
- port: metrics
interval: 10s
- name: kubewarden-controller
selector:
matchLabels:
app.kubernetes.io/name: kubewarden-controller
namespaceSelector:
matchNames:
- kubewarden
endpoints:
- port: metrics
interval: 10s
```

Now, let's install the Prometheus stack Helm Chart:

:::note
At time of writing the latest chart version is `51.5.3`
Expand All @@ -58,6 +87,7 @@ This way, the Prometheus Operator can inspect which Kubernetes Endpoints are tie
Let's create the two ServiceMonitors named `kubewarden-controller` and `kubewarden-policy-server` using the following manifests:

```yaml
kubectl apply -f - <<EOF
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down Expand Up @@ -89,6 +119,7 @@ spec:
selector:
matchLabels:
app: kubewarden-policy-server-default
EOF
```

## Install Kubewarden
Expand Down Expand Up @@ -221,3 +252,4 @@ variable to match the name of the desired policy.
You should be able to see the dashboard similar to this:

![Dashboard](/img/grafana_dashboard.png)

Loading