Skip to content

fix(gcp-resources): Add project_id as PK of gcp_logging_metrics#6544

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/gcp_logging_metrics_pks
Jan 9, 2023
Merged

fix(gcp-resources): Add project_id as PK of gcp_logging_metrics#6544
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/gcp_logging_metrics_pks

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

Metric names are unique within a project, so we need the project_id as a PK.
From the docs:

	// This field is the `[METRIC_ID]` part of a metric resource name in the
	// format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
	// resource name of a metric is
	// `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
	// `"nginx/requests"`.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`

The funny thing is that for most resources name is the full string (including project id), but we still set project_id as a PK

@cq-bot cq-bot added the gcp label Jan 9, 2023
@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jan 9, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2023

This PR has the following changes to source plugin(s) tables:

  • Table gcp_logging_metrics: primary key constraint added to column project_id

kodiakhq bot pushed a commit that referenced this pull request Jan 9, 2023
)



#### Summary

Similar to #6544, sink names are unique within a project:

```go
        // Required. The client-assigned sink identifier, unique within the project.
	//
	// For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
	// to 100 characters and can include only the following characters: upper and
	// lower-case alphanumeric characters, underscores, hyphens, and periods.
	// First character has to be alphanumeric.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
```

<!--
@kodiakhq kodiakhq bot merged commit 599b935 into cloudquery:main Jan 9, 2023
erezrokah pushed a commit that referenced this pull request Jan 10, 2023
🤖 I have created a release *beep* *boop*
---


##
[6.1.1](plugins-source-gcp-v6.1.0...plugins-source-gcp-v6.1.1)
(2023-01-10)


### Bug Fixes

* **gcp-resources:** Add `organization_id` and `name` as PK of
`gcp_resourcemanager_folders`
([#6547](#6547))
([3c0e702](3c0e702))
* **gcp-resources:** Add `project_id` and `id` as PKs of
`gcp_bigquery_datasets`
([#6532](#6532))
([fd00133](fd00133))
* **gcp-resources:** Add `project_id` and `id` as PKs of
`gcp_bigquery_tables`
([#6533](#6533))
([523c84f](523c84f))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_domains_registrations`
([#6537](#6537))
([47c87b4](47c87b4))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_functions_functions`
([#6538](#6538))
([8552503](8552503))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_iam_deny_policies`
([#6539](#6539))
([d230ede](d230ede))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_iam_service_account_keys`, remove `service_account_unique_id` from
PKs ([#6541](#6541))
([00ca437](00ca437))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_kms_crypto_keys`
([#6542](#6542))
([3d4d03c](3d4d03c))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_kms_keyrings`
([#6543](#6543))
([fbde9e4](fbde9e4))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_run_locations`
([#6548](#6548))
([88c1993](88c1993))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_run_services`
([#6549](#6549))
([237e28d](237e28d))
* **gcp-resources:** Add `project_id` as PK of `gcp_logging_metrics`
([#6544](#6544))
([599b935](599b935))
* **gcp-resources:** Add `project_id` as PK of `gcp_logging_sinks`
([#6545](#6545))
([d183b51](d183b51))
* **gcp-resources:** Add `version` to PKs of
`gcp_cloudiot_device_configs`
([#6551](#6551))
([12252c3](12252c3))
* **gcp-resources:** Change `gcp_appengine_firewall_ingress_rules` PK to
`_cq_id` ([#6531](#6531))
([5d87911](5d87911))
* **gcp-resources:** Remove `bucket_name` as PK of
`gcp_storage_bucket_policies`
([#6550](#6550))
([fb6a2de](fb6a2de))
* **gcp-resources:** Remove `metadata` from `gcp_aiplatform_models`
([#6529](#6529))
([e068e19](e068e19))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants