Skip to content

Commit

Permalink
Merge pull request #85 from kate-goldenring/prometheus-support
Browse files Browse the repository at this point in the history
feat: support exporting data to a Grafana dashboard
  • Loading branch information
kate-goldenring authored Jul 25, 2024
2 parents f6cf404 + 9920116 commit 9d2c8cc
Show file tree
Hide file tree
Showing 11 changed files with 1,751 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
export TEST_END_UTC=$(date '+%s%3N')
export VARIABLE_KEYS=node_instance_type,node_os,node_arch,host,test_id
export VARIABLE_VALS=$NODE_INSTANCE_TYPE,$NODE_OS,$NODE_ARCH,$NODE_HOST,$TEST_ID
. ./dashboard/datadog-dashboard-url.sh
. ./dashboard/datadog/datadog-dashboard-url.sh
echo '### Datadog Dashboard URL:' >> $GITHUB_STEP_SUMMARY
echo "${DATADOG_DASHBOARD_URL}" >> $GITHUB_STEP_SUMMARY
Expand Down
42 changes: 0 additions & 42 deletions dashboard/Datadog.md

This file was deleted.

1 change: 0 additions & 1 deletion dashboard/datadog-spinkube-performance-dashboard.json

This file was deleted.

43 changes: 43 additions & 0 deletions dashboard/datadog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Exporting to Datadog

## Installing the Datadog Agent on a K8s Cluster

Install the Datadog cluster agent on your cluster [using Helm](https://docs.datadoghq.com/containers/kubernetes/installation/?tab=helm), which will collect all of these [metrics](https://docs.datadoghq.com/containers/kubernetes/data_collected/).

Configure your Datadog API key and install the Helm chart as follows:

```sh
# Configure the API key for your Datadog account
export DATADOG_API_KEY="<YOUR DD API KEY>"

# Add and update the Datadog repository
helm repo add datadog https://helm.datadoghq.com
helm repo update

# Install the datadog chart
#
# Note: the datadog.kubelet config avoids 'unable to reliably determine the host name.' when running on AKS.
# Another option is to set 'kubelet.tlsVerif=false'
# Ref https://docs.datadoghq.com/containers/kubernetes/distributions/?tab=helm#aks-kubelet-certificate
# Note: also possible to supply a secret for the API key
# https://github.com/DataDog/helm-charts/tree/main/charts/datadog#create-and-provide-a-secret-that-contains-your-datadog-api-and-app-keys
#
helm upgrade --install datadog \
--namespace datadog \
--create-namespace \
--set datadog.kubelet.host.valueFrom.fieldRef.fieldPath=spec.nodeName \
--set datadog.kubelet.hostCAPath=/etc/kubernetes/certs/kubeletserver.crt \
--set datadog.apiKey="${DATADOG_API_KEY}" datadog/datadog
```

## Run Tests with Datadog Output

This ensures K6 is executed with the correct flags to export to Datadog using the statsd protocol.

```sh
OUTPUT=datadog make run-tests
```

## Importing the Custom Datadog Dashboard

Import the [datadog-spinkube-performance-dashboard.json](./datadog-spinkube-performance-dashboard.json) file into Datadog to immediately start visualizing data from a recent test run.
File renamed without changes.

Large diffs are not rendered by default.

Loading

0 comments on commit 9d2c8cc

Please sign in to comment.