Skip to main content

GCP metrics

Overview​

Google Cloud Platform provides built-in monitoring and observability tools that allow users to collect and analyze metrics and traces from their GCP resources. Send Google Cloud metrics and traces seamlessly to Coralogix. Search, analyze, and visualize your data, gaining insights into application behavior, identifying errors, and troubleshooting problems.

For more information about this integration, click here.

How to use with Terraform​

To deploy this integration using Terraform, you can use the coralogix_integration resource provided by the Coralogix Terraform provider. Below is an example configuration:

resource "coralogix_integration" "gcp-metrics-collector" {
integration_key = "gcp-metrics-collector"
version = "1.9.0"

parameters = {
IntegrationName = "<IntegrationName>"
MetricPrefixes = [ "compute.googleapis.com", "cloudsql.googleapis.com" ]
ServiceAccountKey = "<ServiceAccountKey>"
}
}

Replace the placeholder values with your actual configuration parameters. Refer to the parameter table below for required fields and their descriptions.

Upgrading to a newer revision​

When you change version, remove from parameters every parameter that the target revision no longer lists, otherwise terraform apply fails with Testing the integration has failed and 400 Bad Request. terraform plan does not detect this, because only version changes.

Upgrading toRemove from parameters
1.7.0IncludeSystemLabels
1.8.0IncludeSystemLabels, IncludeUserLabels
1.9.0IncludeSystemLabels, IncludeUserLabels

Revisions​

Adds the opt-in EnableRouterName option. When enabled, Cloud Router (gce_router) and Cloud NAT (nat_gateway) metrics, which carry only the router's id, get a router_name label. It requires the compute.routers.list permission, included in roles/compute.viewer. Also adds the optional MetricTypes and ProjectNumber parameters.

NameTypeRequiredDescription
IntegrationNameStringYes
MetricPrefixesListYesTo limit unnecessary API calls that fetch no data but count towards the quota limit, specify only the GCP prefixes of the metrics that actually exist and you want to pull into Coralogix.
ApplicationLabelsListNoSelect labels whose values will be used as the Application Name. If more than one label can be matched, the first match in the list will be used.
ApplicationNameStringNoThe default name of the application that the integration will be used with. This is used as a fallback when no labels match.
BillingProjectIdStringNoA caller-specified project for quota and billing purposes. The caller must have serviceusage.services.use permission on the project.
EnableCloudRegionBooleanNoAdd a cloud.region label, derived from the resource zone, to all collected metrics across every namespace.
EnableInstanceNameBooleanNoRequires roles/compute.viewer permission. Add an instance_name label to metric on a gce_instance.
EnableRouterNameBooleanNoRequires roles/compute.viewer permission. Add a router_name label to metrics on a Cloud Router (gce_router) or Cloud NAT gateway (nat_gateway).
MetricTypesListNoFull metric types to collect, for example cloudsql.googleapis.com/database/cpu/utilization. When set, all metrics of exactly these types are collected; otherwise, all metrics under the selected MetricPrefixes.
ProjectIdStringNoThe ID of the GCP project from which metrics should be collected.
ProjectNumberStringNoThe number of the GCP project that holds the Coralogix workload identity pool. Only needed when the integration uses workload identity federation (WIF).
ServiceAccountKeyStringNo
ServiceAccountTargetPrincipalStringNoEmail of the created Service Account.
SubsystemLabelsListNoSelect labels whose values will be used as the Subsystem Name. If more than one label can be matched, the first match in the list will be used.
SubsystemNameStringNoThe default name of the subsystem that the integration will be used with. This is used as a fallback when no labels match.
UseRawUserLabelsBooleanNoEmit user-defined labels with their original GCP names instead of prefixing them with user (user. or user_, depending on the metric format). If a raw user-defined label conflicts with an existing metric, resource, system, application, or subsystem label, the existing label is kept and the user-defined label is not emitted.
UserLabelsResourcesListNoChoose which GCP resources should have user-defined labels included in their metrics. Ensure your account has the necessary permissions. Typically, the list permission is required for each selected resource.
Last updated on