Sysdig enables Grafana users to query metrics from Sysdig and visualize them in Grafana dashboards. In order to integrate Sysdig with Grafana, user needs to configure a data source.
We are using the Sysdig Prometheus API to set up the datasource to use with Grafana.
Before Grafana can pull out Sysdig metrics, Grafana must authenticate itself to Sysdig that can be done by setting up an HTTP authentication using the Sysdig API Token
Lets spin up a Grafana container as follows:
docker run --rm -p 3000:3000 --name grafana grafana/grafana
docker ps -a
To sign into Grafana for the first time:
- Open your web browser and go to http://localhost:3000/.
- The default HTTP port that Grafana listens to is
3000
unless you have configured a different port.
- On the sign-in page, enter
admin
for both username and password.
- Click Sign in.
- If successful, you will see a prompt to change the password.
- Click OK on the prompt and change your password.
Let’s provision a classic cluster in the IBM Cloud console
Ref: https://cloud.ibm.com/docs/containers?topic=containers-cluster-create-classic&interface=ui
Now let’s provision an instance of sysdig in Sydney region
Ref: https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started#getting-started-step2
Note: Ensure that the IBM Cloud Monitoring instance is enabled to receive platform metrics
Click on open dashboard link of the IBM Cloud Monitoring
On IBM Cloud Monitoring instance console page; select Integrations> 3rd Party >Grafana Plugin
It shows :https://github.com/draios/grafana-sysdig-datasource
However, refer Configure Sysdig with Grafana and execute the below command:
docker run --rm -p 3000:3000 --name grafana grafana/grafana
- Run Grafana http://localhost:3000 [v 9.4.3] and login to it as administrator and create a new datasource
- Click Data Sources
2. Launch the http://localhost:3000/datasources
3. Click Add new data source
4. Select Prometheus
5. Enter its name as Sysdig-Prometheus
6. Enter the HTTP url as https://<Monitor URL for Your Region>/prometheus
For IBM Cloud configuration, refer Endpoints :
<IBM Endpoint>/Prometheus
ex: https://au-syd.monitoring.cloud.ibm.com/prometheus
7. Collect API Token that is available through Settings > User Profile > Sysdig Monitor API.
8. Update the Custom HTTP Headers field:
Header: Enter the word, Authorization
Value: Enter the word, Bearer , followed by a space and <Your Sysdig API Token>
example:Bearer b942c4fd-c04d-4284–81c7–81cfacd95bd2
Click Save and Test
Lets connect via CLI to Kubernetes:
ibmcloud login
ibmcloud ks cluster config
ibmcloud ks cluster config
kubectl config current-context
On the Kubernetes cluster overview console page
Click Connect under Monitoring>Connect to an existing IBM Cloud Monitoring instance>Filter region by Sydney and select the existing instance in Sydney
Launch the https://cloud.ibm.com/observe/monitoring
Click on the instance>Monitoring Sources>Kubernetes tab
Execute the command as shown.
curl -sL https://ibm.biz/install-sysdig-k8s-agent | bash -s -- -a ACCESS_KEY -c COLLECTOR_ENDPOINT -t TAG_DATA -ac 'sysdig_capture_enabled: false'
curl -sL https://ibm.biz/install-sysdig-k8s-agent | bash -s -- -a 52662048-8384-4c1e-a062-2663aba361e2 -c ingest.au-syd.monitoring.cloud.ibm.com -ac 'sysdig_capture_enabled: false'
kubectl get pods -n ibm-observe
Launch the Sysdig instance console page and view mterics
On Grafana console page; click explore
Chose a metric, and then select “Run query”.
Congratulations!! Grafana users can successfully query metrics from Sysdig.
#Highlights#Highlights-home