Skip to content

Commit

Permalink
enhance azure data explorer scaler metric name with trigger.metadata.…
Browse files Browse the repository at this point in the history
…metricName
  • Loading branch information
Ying Liu committed Aug 24, 2022
1 parent df0af8d commit 4a0e2ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/scalers/azure_data_explorer_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ func parseAzureDataExplorerMetadata(config *ScalerConfig, logger logr.Logger) (*
}

// Generate metricName.
metadata.MetricName = GenerateMetricNameWithIndex(config.ScalerIndex, kedautil.NormalizeString(fmt.Sprintf("%s-%s", adxName, metadata.DatabaseName)))
metadataName, _ := getParameterFromConfig(config, "metricName", false)
if err != nil {
// metadataName is not defined
metadata.MetricName = GenerateMetricNameWithIndex(config.ScalerIndex, kedautil.NormalizeString(fmt.Sprintf("%s-%s", adxName, metadata.DatabaseName)))
} else {
metadata.MetricName = GenerateMetricNameWithIndex(config.ScalerIndex, kedautil.NormalizeString(fmt.Sprintf("%s-%s-%s", adxName, metadata.DatabaseName, metadataName)))
}

activeDirectoryEndpoint, err := azure.ParseActiveDirectoryEndpoint(config.TriggerMetadata)
if err != nil {
Expand Down

0 comments on commit 4a0e2ee

Please sign in to comment.