-
Notifications
You must be signed in to change notification settings - Fork 24
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
Query values converted to strings #27
Comments
The provider casts filter.value to a string, before assigning it: https://github.com/kvrhdn/terraform-provider-honeycombio/blob/main/honeycombio/data_source_query.go#L173 But in go-honeycombio filter value is a So, we'll have to figure out whether it's possible to have a dynamic type in Terraform. |
Does it make sense to add mutually exclusive Feels kind of gross, but probably the most straightforward option. |
Yeah, I'd like to avoid having to do that 😕 but it might be the easiest way... |
From a quick look around it doesn't look like there's a way to specify that a field is a string or numeric. My other thought was we could maybe have the go client convert it based on the operator. The best option would probably be on the honeycomb side (we always send a string, honeycomb converts to an appropriate value for the field), but I think explicit value/numeric fields might be the best option for now. But yeah, if you find a better option in the terraform type system that works too. |
After playing a bit with the UI, it seems that the UI interprets the filter value based upon the type of the column. There are four types (string, integer, float, boolean) which can be set in the dataset settings. For example, the result of entering
While this feels intuitive, it is impossible to recreate in the Terraform provider:
The type system of Terraform is also a limiting factor: filter.value is declared as Solutions:
filter {
column = "app.tenant"
op = "="
value = "SpecialTenant" // no value_type since string is the default
}
filter {
column = "duration_ms"
op = ">"
value = 1000
value_type = "int"
filter {
column = "app.tenant"
op = "="
value_string = "SpecialTenant"
}
filter {
column = "duration_ms"
op = ">"
value_int = 1000 |
Created a new topic on the Hashicorp forum to ask about fields with dynamic types |
Definitely agree on #1 being the best option, not a fan of #2 due to ambiguity. I think I like 4 slightly more due to it being more explicit/harder to miss, but don't have strong objections to 3. I would say go for 3 or 4 for now, put in a request for API support for 1 and plan on a major release/breaking change once API support in place? |
Creating a board using this
honeycombio_query
:ends up yielding this query:
(Note that the duration is quoted)
This results in no data being shown, while data is returned if the value is converted to a numeric value.
The text was updated successfully, but these errors were encountered: