Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datadog is not one of the available choices #163

Closed
mathieux51 opened this issue Apr 30, 2024 · 9 comments
Closed

datadog is not one of the available choices #163

mathieux51 opened this issue Apr 30, 2024 · 9 comments

Comments

@mathieux51
Copy link

mathieux51 commented Apr 30, 2024

Terraform Version

t -version
OpenTofu v1.6.2
on darwin_arm64
+ provider registry.opentofu.org/hashicorp/aws v5.46.0
+ provider registry.opentofu.org/sleuth-io/sleuth v0.4.7

Affected Resource(s)

  • sleuth_metric_impact_source

Terraform Configuration Files

resource "sleuth_metric_impact_source" "ingress" {
  project_slug     = "my-project"
  environment_slug = "production"
  name             = "my-service"
  provider_type    = "datadog"
  query            = "sum:nginx_ingress.controller.requests{service:my-service}"
  less_is_better   = false
}

Error Output

Error: Errors creating impact source:  [{Field:auth Messages:[Select a valid choice. datadog is not one of the available choices.]}]

Expected Behavior

According to the documentation, resource should be created

Actual Behavior

Fails

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform init
  2. terraform apply -auto-approve
@mathieux51 mathieux51 changed the title DATADOG is not one of the available choices datadog is not one of the available choices Apr 30, 2024
@mathieux51
Copy link
Author

Not sure who to ping, seems like @JureMalovrh and @zigomir were the last contributors

@recodedecode
Copy link

I am having the same issue with newrelic as the provider_type using sleuth-io/sleuth version 0.3.0. I believe it might be an error with the API response and not this package as looking at the Go code it doesn't appear there is any validation against an actual enum. The GraphQL ImpactProvider (see query here) does list both newrelic and datadog as valid options.

@mathieux51
Copy link
Author

mathieux51 commented May 2, 2024

@recodedecode The README clearly states there is no support for newrelic whereas datadog is in the Terraform provider documentation as an example for sleuth_metric_impact_source.
I didn't go as far as looking at the Go code 😅.
The GraphQL link you shared doesn't for me 😭.

@recodedecode
Copy link

Ok, so I missed that fair call out. However, it's in the docs it's in the GraphQL API (hit the play button) as an apparently valid impact provider and having used this provider for other sources I just tried to tie this one in too.

@JureMalovrh
Copy link
Contributor

Hi @mathieux51, thanks for reporting this.

The issue here is that you didn't provide the integration_slug docs. Hence if you have added any description or comment to DD integration you have created, you will need to pass that info as well.

@JureMalovrh
Copy link
Contributor

@mathieux51 were you able to solve the issue?

@recodedecode
Copy link

I was able to get this working with your direction @JureMalovrh but it wasn't obvious as I could not initially find where the appropriate integration_slug value was. I did eventually find it by looking at data returned from the GraphQL API over the Sleuth website network requests for our organisation.

With this I was actually able to create a New Relic impact source. So while it says in the docs on this repo that you can't use New Relic with this provider, it was in-fact possible. I believe this is the case because the provider is simply calling the Sleuth API and performing no checks on the enum internally within the provider.

Hope this helps the next person.

@JureMalovrh
Copy link
Contributor

Yeah, we have a ticket open for exposing integration slugs via UI to enable easier copying and usage. I will close the ticket now and bump the priority of the internal ticket.

@zigomir
Copy link
Contributor

zigomir commented Jan 9, 2025

Closing since Datadog has landed with #94

@zigomir zigomir closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants