Document updated on Sep 15, 2019
Exporting metrics, logs and events to Google Stackdriver
Google Stackdriver aggregates metrics, logs, and events from infrastructure, giving developers and operators a rich set of observable signals that speed root-cause analysis and reduce mean time to resolution (MTTR).
The Opencensus exporter allows you export data to Google Stackdriver. Enabling it only requires you to add the stackdriver
exporter in the opencensus module.
The following configuration snippet sends the data:
"github_com/devopsfaith/krakend-opencensus": {
"exporters": {
"stackdriver": {
"project_id": "my-krakend-project",
"metrics_prefix": "krakend",
"default_labels": {
"env": "production"
}
}
}
}
project_id
: The identifier of your Google Cloud project.metrics_prefix
: A prefix that you can add to all your metrics for better organization.default_labels
: Enter here any label that will be assigned by default to the reported metric so you can filter later on Stack Driver. In the example we set a labelenv
with the valueproduction
.
See also the additional settings of the Opencensus module that can be declared.