Skip to content

Commit

Permalink
Remove sampling_percentage until SDK issue fixed
Browse files Browse the repository at this point in the history
See #9172 (comment) and Azure/azure-sdk-for-go#13604.

Signed-off-by: Sune Keller <absukl@almbrand.dk>
  • Loading branch information
sirlatrom committed Nov 13, 2020
1 parent 3dbe558 commit 0451bbf
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ func resourceArmApiManagementApiDiagnostic() *schema.Resource {
ValidateFunc: validate.ApiManagementLoggerID,
},

"sampling_percentage": {
Type: schema.TypeFloat,
Optional: true,
Computed: true,
ValidateFunc: validation.FloatBetween(0.0, 100.0),
},

"always_log_errors": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -168,15 +161,6 @@ func resourceArmApiManagementApiDiagnosticCreateUpdate(d *schema.ResourceData, m
},
}

if samplingPercentage, ok := d.GetOk("sampling_percentage"); ok {
parameters.Sampling = &apimanagement.SamplingSettings{
SamplingType: apimanagement.Fixed,
Percentage: utils.Float(samplingPercentage.(float64)),
}
} else {
parameters.Sampling = nil
}

if alwaysLogErrors, ok := d.GetOk("always_log_errors"); ok && alwaysLogErrors.(bool) {
parameters.AlwaysLog = apimanagement.AllErrors
}
Expand Down Expand Up @@ -274,9 +258,6 @@ func resourceArmApiManagementApiDiagnosticRead(d *schema.ResourceData, meta inte
d.Set("api_management_name", diagnosticId.ServiceName)
if props := resp.DiagnosticContractProperties; props != nil {
d.Set("api_management_logger_id", props.LoggerID)
if props.Sampling != nil && props.Sampling.Percentage != nil {
d.Set("sampling_percentage", props.Sampling.Percentage)
}
d.Set("always_log_errors", props.AlwaysLog == apimanagement.AllErrors)
d.Set("verbosity", props.Verbosity)
d.Set("log_client_ip", props.LogClientIP)
Expand Down

0 comments on commit 0451bbf

Please sign in to comment.