pulumi-datadog icon indicating copy to clipboard operation
pulumi-datadog copied to clipboard

Imported monitors replace `%` in their message with `%!x(MISSING)`

Open blampe opened this issue 3 years ago • 0 comments

Expected behavior

Generated code for an imported monitor should include exactly the same message as the existing resource.

Current behavior

A monitor with % anywhere in its message will produce generated code containing %!x(MISSING) in place of %.

Steps to reproduce

Tested on pulumi-datadog 3.1.0.

  1. Manually create a monitor. In the message, include % anywhere. For example: "5% of requests failed".
  2. Import the monitor using pulumi import datadog:index/monitor:Monitor test 12345
  3. Observe the message in the generated code does not match the existing message verbatim. In this example, it produces "5%!o(MISSING)f requests failed"

Context (Environment)

This breaks messages with percent-encoded URLs to runbooks, for example. It also makes commonplace percentiles (99%) unreadable. It's relatively straightforward to fix, but it's a big annoyance when trying to import a large number of existing monitors. Being able to copy-paste the generated code would be ideal!

Affected feature

Unsure.

blampe avatar May 19 '21 00:05 blampe