Closed martinei closed 2 years ago
@martinei is this an officially supported feature? I cannot find details about the API in the current API documentation: https://instana.github.io/openapi/
Ups. I think it is still in beta/preview.
Application Alert Configs are part of the openapi spec now. But It is still in Beta
https://instana.github.io/openapi/#tag/Application-Alert-Configuration
We are very interested in this feature
Want to support this feature with milestone 1.1.0. I'm currently working on 1.0.0 which will migrate the provider to the new SDK. I want to support imports in this release to follow terraform best practices. Afterwards I will work on this feature.
@martinei I had a look into your implementation.However it seems that there major changes on the API. I will revisit this feature request once the feature is stable.
Thanks for the update! I haven't touched this for some time an the API was not yet public when I initially wrote this. So I may well have stopped working.
@martinei could you provide an example of any working configuration with instana_application_alert_config? I'm trying to get a valid configuration with all required values from your code, but I always get -> Body: {"code":400,"message":"Unable to process JSON"}
Thanks!
This is roughly what we use. Please note that the code does not support all options. It will probably need changes to match your use case.
resource instana_application_alert_config testalert {
application_id = // Id of the application to which the alert shall be added
description = "Latency to high"
alert_name = "Latency to high"
tag_filter {
name = "endpoint.name"
operator = "EQUALS"
string_value = "some endpoint name"
entity = "NOT_APPLICABLE"
}
tag_filter {
name = "service.name"
operator = "EQUALS"
string_value = "some service name"
entity = "NOT_APPLICABLE"
}
rule_alert_type = "slowness"
rule_metric_name = "latency"
rule_aggregation = "P95"
threshold_value = 200
threshold_type = "staticThreshold"
threshold_operator = ">="
integration_ids = [
// a Channel Id
]
}
Thanks @martinei, it's working!
I am in the need to support Application Alert Configs. I have created a branch that currently does just enough for me: https://github.com/martinei/terraform-provider-instana/tree/application_config_alerts
I am aware this is not "good enough" to be merged, but maybe it is still useful for someone or can serve as a starting point.