-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_application_insights
- support for sampling_percentage
#4925
Changes from 2 commits
1ce7372
ad16f22
4d50c83
8c1fbae
857ef41
46dcd92
ebd76a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,11 @@ func resourceArmApplicationInsights() *schema.Resource { | |
}, true), | ||
}, | ||
|
||
"sampling_percentage": { | ||
Type: schema.TypeFloat, | ||
Optional: true, | ||
}, | ||
|
||
"tags": tags.Schema(), | ||
|
||
"app_id": { | ||
|
@@ -111,6 +116,10 @@ func resourceArmApplicationInsightsCreateUpdate(d *schema.ResourceData, meta int | |
ApplicationType: insights.ApplicationType(applicationType), | ||
} | ||
|
||
if v, ok := d.GetOk("sampling_percentage"); ok { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this is a float it'll have a default value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good to know, making 100% the default sounds good to me |
||
applicationInsightsComponentProperties.SamplingPercentage = utils.Float(v.(float64)) | ||
} | ||
|
||
insightProperties := insights.ApplicationInsightsComponent{ | ||
Name: &name, | ||
Location: &location, | ||
|
@@ -176,6 +185,10 @@ func resourceArmApplicationInsightsRead(d *schema.ResourceData, meta interface{} | |
d.Set("application_type", string(props.ApplicationType)) | ||
d.Set("app_id", props.AppID) | ||
d.Set("instrumentation_key", props.InstrumentationKey) | ||
|
||
if v := props.SamplingPercentage; v != nil { | ||
d.Set("sampling_percentage", v) | ||
} | ||
aqche marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
return tags.FlattenAndSet(d, resp.Tags) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a percentage could we validate it is between 0 and 100?