Cloud Service Integration

Sometimes, you might already have Prometheus & Grafana instances. They might be built by other tools, or come from cloud providers. Follow the below guide to integrate with existing systems.

If you already have external prometheus service and you want to connect it to Grafana (established by vela addon), you can create a GrafanaDatasource to register it through KubeVela application.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: register-prometheus
  5. spec:
  6. components:
  7. - type: grafana-datasource
  8. name: my-prometheus
  9. properties:
  10. access: proxy
  11. basicAuth: false
  12. isDefault: false
  13. name: MyPrometheus
  14. readOnly: true
  15. withCredentials: true
  16. jsonData:
  17. httpHeaderName1: Authorization
  18. tlsSkipVerify: true
  19. secureJsonFields:
  20. httpHeaderValue1: <token of your prometheus access>
  21. type: prometheus
  22. url: <my-prometheus url>

For example, if you are using the Prometheus service on Alibaba Cloud (ARMS), you can go to the Prometheus setting page and find the access url & access token.

arms-prometheus

You need to ensure your grafana access is already available. You can run kubectl get grafana default and see if it exists.

If you already have existing Grafana, similar to Prometheus integration, you can create a Grafana access through KubeVela application.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: register-grafana
  5. spec:
  6. components:
  7. - type: grafana-access
  8. name: my-grafana
  9. properties:
  10. name: my-grafana
  11. endpoint: <my-grafana url>
  12. token: <access token>

To get your grafana access, you can go into your Grafana instance and configure API keys.

grafana-apikeys

Then copy the token into your grafana registration configuration.

grafana-added-apikeys

After the application is successfully dispatched, you can check the registration by running the following command.

  1. kubectl get grafana
  1. NAME ENDPOINT CREDENTIAL_TYPE
  2. default http://grafana.o11y-system:3000 BasicAuth
  3. my-grafana https://grafana-rngwzwnsuvl4s9p66m.grafana.aliyuncs.com:80/ BearerToken

Now you can manage your dashboard and datasource on your grafana instance through the native Kubernetes API as well.

  1. # show all the dashboard you have
  2. kubectl get grafanadashboard -l grafana=my-grafana
  1. # show all the datasource you have
  2. kubectl get grafanadatasource -l grafana=my-grafana

For more details, you can refer to vela-prism.

It is also possible to make integrations through KubeVela’s configuration management system, no matter you are using CLI or VelaUX.

There are a wide range of community tools or eco-systems that users can leverage for building their observability system, such as prometheus-operator or DataDog. By far, KubeVela does not have existing best practices for those integration. We may integrate with those popular projects through KubeVela addons in the future. We are also welcome to community contributions for broader explorations and more connections.

Last updated on Feb 9, 2023 by dependabot[bot]