---
title: "POST /api/v1/config/gcp-metrics-integrations"
method: POST
path: "/api/v1/config/gcp-metrics-integrations"
tags: ["GcpMetricsIntegration"]
---

# POST /api/v1/config/gcp-metrics-integrations

`POST /api/v1/config/gcp-metrics-integrations`

## Request body

- Configv1CreateGcpMetricsIntegrationRequest
  - `dry_run` boolean — If `true`, validates the specified configuration without creating the GcpMetricsIntegration. If the specified configuration is valid, the endpoint returns a partial response without the GcpMetricsIntegration. If the specified configuration is invalid, the endpoint returns an error.
  - `gcp_metrics_integration` Configv1GcpMetricsIntegration
    - `created_at` string, date-time — Timestamp of when the GcpMetricsIntegration was created. Cannot be set by clients.
    - `metric_groups` GcpMetricsIntegrationMetricGroup[] — An array of metric groups to be ingested for this integration.
      - `filters` Configv1GcpMetricsIntegrationFilter[] — Rollup rules to apply server-side aggregations to metrics in this group.
        - `context` 'RESOURCE_LABELS' | 'METRIC_LABELS' | 'METADATA_SYSTEM_LABELS' | 'METADATA_USER_LABELS' — LabelContext represents the scope of a label in GCP (used for filters and aggregations). - RESOURCE_LABELS: Scopes labels to resources. - METRIC_LABELS: Scopes labels to metrics. - METADATA_SYSTEM_LABELS: Scopes labels to system metadata. - METADATA_USER_LABELS: Scopes labels to user metadata.
        - `name` string — Label name to filter on.
        - `value_glob` string — Value pattern using glob syntax, such as `"prod-*"` or `"us-east-?"`. If a glob pattern isn't specified, an exact match is applied.
      - `prefixes` string[] — A list of Google Cloud metric prefixes to ingest. Filters to apply to metrics in this group.
      - `project_id` string — The Google Cloud project ID that can access the metric data.
      - `rollup_rules` Configv1GcpMetricsIntegrationRollupRule[]
        - `aggregation` 'MEAN' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' — Specifies the cross-series aggregation method.
        - `label_policy` GcpMetricsIntegrationRollupRuleLabelPolicy — Specifies which labels to preserve during aggregation.
          - `keep` GcpMetricsIntegrationRollupRuleLabel[] — Labels to keep during aggregation.
            - `context` 'RESOURCE_LABELS' | 'METRIC_LABELS' | 'METADATA_SYSTEM_LABELS' | 'METADATA_USER_LABELS' — LabelContext represents the scope of a label in GCP (used for filters and aggregations). - RESOURCE_LABELS: Scopes labels to resources. - METRIC_LABELS: Scopes labels to metrics. - METADATA_SYSTEM_LABELS: Scopes labels to system metadata. - METADATA_USER_LABELS: Scopes labels to user metadata.
            - `name` string — Name of the label.
        - `metric_name` string — Metric name to apply the aggregation to, such as `"cloudsql.googleapis.com/database/uptime"`.
    - `name` string, required — The name of the GcpMetricsIntegration. You can modify this value after the GcpMetricsIntegration is created.
    - `service_account` Configv1GcpMetricsIntegrationServiceAccount
      - `client_email` string — The email address of the Google Cloud service account to impersonate for authentication.
    - `slug` string — The unique identifier of the GcpMetricsIntegration. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the GcpMetricsIntegration is created.
    - `updated_at` string, date-time — Timestamp of when the GcpMetricsIntegration was last updated. Cannot be set by clients.

## Response `200`

A successful response containing the created GcpMetricsIntegration.

- Configv1CreateGcpMetricsIntegrationResponse
  - `gcp_metrics_integration` Configv1GcpMetricsIntegration
    - `created_at` string, date-time — Timestamp of when the GcpMetricsIntegration was created. Cannot be set by clients.
    - `metric_groups` GcpMetricsIntegrationMetricGroup[] — An array of metric groups to be ingested for this integration.
      - `filters` Configv1GcpMetricsIntegrationFilter[] — Rollup rules to apply server-side aggregations to metrics in this group.
        - `context` 'RESOURCE_LABELS' | 'METRIC_LABELS' | 'METADATA_SYSTEM_LABELS' | 'METADATA_USER_LABELS' — LabelContext represents the scope of a label in GCP (used for filters and aggregations). - RESOURCE_LABELS: Scopes labels to resources. - METRIC_LABELS: Scopes labels to metrics. - METADATA_SYSTEM_LABELS: Scopes labels to system metadata. - METADATA_USER_LABELS: Scopes labels to user metadata.
        - `name` string — Label name to filter on.
        - `value_glob` string — Value pattern using glob syntax, such as `"prod-*"` or `"us-east-?"`. If a glob pattern isn't specified, an exact match is applied.
      - `prefixes` string[] — A list of Google Cloud metric prefixes to ingest. Filters to apply to metrics in this group.
      - `project_id` string — The Google Cloud project ID that can access the metric data.
      - `rollup_rules` Configv1GcpMetricsIntegrationRollupRule[]
        - `aggregation` 'MEAN' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' — Specifies the cross-series aggregation method.
        - `label_policy` GcpMetricsIntegrationRollupRuleLabelPolicy — Specifies which labels to preserve during aggregation.
          - `keep` GcpMetricsIntegrationRollupRuleLabel[] — Labels to keep during aggregation.
            - `context` 'RESOURCE_LABELS' | 'METRIC_LABELS' | 'METADATA_SYSTEM_LABELS' | 'METADATA_USER_LABELS' — LabelContext represents the scope of a label in GCP (used for filters and aggregations). - RESOURCE_LABELS: Scopes labels to resources. - METRIC_LABELS: Scopes labels to metrics. - METADATA_SYSTEM_LABELS: Scopes labels to system metadata. - METADATA_USER_LABELS: Scopes labels to user metadata.
            - `name` string — Name of the label.
        - `metric_name` string — Metric name to apply the aggregation to, such as `"cloudsql.googleapis.com/database/uptime"`.
    - `name` string, required — The name of the GcpMetricsIntegration. You can modify this value after the GcpMetricsIntegration is created.
    - `service_account` Configv1GcpMetricsIntegrationServiceAccount
      - `client_email` string — The email address of the Google Cloud service account to impersonate for authentication.
    - `slug` string — The unique identifier of the GcpMetricsIntegration. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the GcpMetricsIntegration is created.
    - `updated_at` string, date-time — Timestamp of when the GcpMetricsIntegration was last updated. Cannot be set by clients.

## Other responses

- `400` — Cannot create the GcpMetricsIntegration because the request is invalid.
- `409` — Cannot create the GcpMetricsIntegration because there is a conflict with an existing GcpMetricsIntegration.
- `500` — An unexpected error response.
- `default` — An undefined error response.

---

[API](https://skmtc.dev/chronosphere/apis/data-v1-api.md) · [All operations](https://skmtc.dev/chronosphere/apis/data-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chronosphere/data-v1-api/revisions/ee91fd539ced/schema)
