Integration with Grafana Cloud
Grafana Cloud (opens in a new tab) is a popular fully managed observability service. This guide demonstrates how to set up Cube Cloud to export logs to Grafana Cloud.
Configuration
First, enable monitoring integrations in Cube Cloud.
Exporting logs
To export logs to Grafana Cloud, go to your account and get credentials for Loki, the logging service in Grafana Cloud:
Then, configure the loki
(opens in a new tab) sink in your vector.toml
configuration file.
Example configuration:
[sinks.loki]
type = "loki"
inputs = [
"cubejs-server",
"refresh-scheduler",
"ext-db",
"warmup-job",
"cubestore"
]
endpoint = "https://logs-prod-012.grafana.net"
[sinks.loki.auth]
strategy = "basic"
user = "$CUBE_CLOUD_MONITORING_GRAFANA_CLOUD_USER"
password = "$CUBE_CLOUD_MONITORING_GRAFANA_CLOUD_PASSWORD"
[sinks.loki.encoding]
codec = "json"
[sinks.loki.cubestore]
levels = [
"trace",
"info",
"debug",
"error"
]
[sinks.loki.labels]
app = "cube-cloud"
env = "production"
Commit the configuration for Vector, it should take effect in a minute. Then, navigate to Logs in Grafana Cloud and watch the logs coming.
Exporting metrics
To export metrics to Grafana Cloud, go to your account and get credentials for Prometheus, the metrics service in Grafana Cloud:
Then, configure the prometheus_remote_write
(opens in a new tab) sink in
your vector.toml
configuration file.
Example configuration:
[sinks.prometheus]
type = "prometheus_remote_write"
inputs = [
"metrics"
]
endpoint = "https://prometheus-prod-24-prod-eu-west-2.grafana.net/api/prom/push"
[sinks.prometheus.auth]
strategy = "basic"
user = "1033221"
password = "eyJrIjoiYTg1OTQ2OGY4Yzg3MTQxODc5OTA4NDUxMGM4NTA2ZDQ3ZjliYWZjOCIsIm4iOiJwcnciLCJpZCI6ODc1NzE5fQ=="
Commit the configuration for Vector, it should take effect in a minute. Then, navigate to Explore in Grafana Cloud, select metrics from the drop down:
Then, you can create visualizations and add them to a dashboard: