yannh / terraform-provider-statuspage

A Terraform provider for Statuspage.io
https://registry.terraform.io/providers/yannh/statuspage/latest
Mozilla Public License 2.0
47 stars 25 forks source link

Creating new Datadog metric is not working #50

Open kanadesunny opened 1 year ago

kanadesunny commented 1 year ago

Hi Yannh,

I am trying to create a new metric using datadog provider and using the below code but with the same query I can create the metric from status page UI. resource "statuspage_metric" "datadog_metric" { page_id = "" metrics_provider_id = "${statuspage_metrics_provider.datadog.id}" name = "" metric_identifier = "avg:aws.applicationelb.target_response_time.average{aws_account:bitbucket,targetgroup:targetgroup/bitbucket-tg-prod/xxxx}" suffix = "ms" transform = "average" y_axis_max = 100 y_axis_min = 0 y_axis_hidden = true display = false decimal_places = 0 tooltip_description = "Test" } Getting the following error: Error: failed creating resource, request returned 500, full response: &{Status:500 Internal Server Error StatusCode:500 Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Atl-Traceid:[a773583cc4ffea4b] Cache-Control:[no-cache] Content-Type:[application/json] Date:[Wed, 08 Mar 2023 14:03:44 GMT] Expect-Ct:[report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/status-page-web-api", max-age=86400] Nel:[{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}] Report-To:[{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}] Server:[AtlassianEdge] Strict-Transport-Security:[max-age=63072000; preload] Vary:[Origin, Accept-Encoding] X-Content-Type-Options:[nosniff] X-Runtime:[0.663737] X-Xss-Protection:[1; mode=block]] Body:0x140006c7740 ContentLength:-1 TransferEncoding:[] Close:false Uncompressed:true Trailer:map[] Request:0x140005e2500 TLS:0x140006d8160}

vquie commented 1 year ago

Same here. Did you find a solution yet?

yannh commented 1 year ago

If you could get a working curl to do this, that you could share, that would be immensely useful :pray: I ve been trying to debug this but my test account in Datadog does not have metrics, so a 5xx error makes it very hard to understand if it is the lack of metric triggering it, or sth else :/

vquie commented 1 year ago

To be honest I think it is an Atlassian issue. I opened an issue in their servicedesk. Even with the api docs at hand I received the same error message.

yannh commented 1 year ago

Don't forget to update this ticket if you figure it out :) Thanks! Ideally a working https://developer.statuspage.io/#operation/postPagesPageIdMetricsProvidersMetricsProviderIdMetrics for Datadog :pray:

vquie commented 1 year ago

Atlassian is able to reproduce this. They are working on a fix.

vquie commented 1 year ago

@yannh Changes have been deployed by the statuspage devs. Can anyone verify it is working now?

Update: I just tested again on my end. Same code that was not working before is working now.