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.8.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

Revisions​

Keeps two labels that earlier revisions dropped. project_id is the project that owns the monitored resource, as opposed to gcp_project_id, which is the project the integration collects from; the two differ whenever a metrics scope spans several projects. location is the resource's own location label, which may be a region, a multi-region, or global, and is not the cloud_region label derived from the resource zone. Adding a label changes the identity of a time series, so review dashboards and alerts that match on the current label set before upgrading. PubSubTopic can now be selected in UserLabelsResources: Pub/Sub topics are read from every project in the scoping project's metrics scope, which needs pubsub.topics.list in every project of the scope, the scoping project included. The IncludeUserLabels option is removed, as it was not adding any labels effectively. Remove IncludeUserLabels and IncludeSystemLabels from parameters before upgrading.

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.
ProjectIdStringNoThe ID of the GCP project from which metrics should be collected.
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