pulumi / pulumi-google-native

Apache License 2.0
71 stars 18 forks source link

v2.Metric does not consistently create or update appropriate log metric #778

Open quipcode opened 1 year ago

quipcode commented 1 year ago

What happened?

When initially creating a new Metric resource we observed the resource is named as projects/[YOUR-PROJECT-ID]/metrics/[METRIC_NAME]. Any subsequent updates to said resources creates a new resource with the expected name of METRIC_NAME

Steps to reproduce

Expected Behavior

Metric's resource should be created with user specified resource name

Actual Behavior

Provider creates Metric's resource pre-pending the following relative path projects/[YOUR-PROJECT-ID]/metrics to the user specified resource name

Output of pulumi about

No response

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

danielrbradley commented 1 year ago

Sorry for the inconvience @quipcode I've just dug into this and also encountered issues.

Using the following reproduction code:

const metric = new google.logging.v2.Metric("test", {
  filter: "resource.type=gae_app AND severity>=ERROR",
});

I actually ran into a slightly different issue.

Workaround

For now I'd recommend using the Google Cloud Classic provider:

const metric = new gcp.logging.Metric("test", {
  filter: "resource.type=gae_app AND severity>=ERROR",
  metricDescriptor: {
    metricKind: "DELTA",
    valueType: "INT64",
  },
});

I worked through the same workflow you described above and encountered no issues.

quipcode commented 1 year ago

Thank you will use the classic provider