Skip to content
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

Enable support for non-public clouds in Application Insights scaler. #2818

Merged
merged 4 commits into from
Mar 25, 2022

Conversation

v-shenoy
Copy link
Contributor

@v-shenoy v-shenoy commented Mar 25, 2022

Signed-off-by: Vighnesh Shenoy vshenoy@microsoft.com

Added support for three new fields in the trigger metadata for the application insights scaler, cloud, appInsightsResourceURL, activeDirectoryEndpoint. The cloud parameter can be azureChinaCloud, azureUSGovernmentCloud, azurePublicCloud, or private (default is azurePublicCloud).

Sample ScaledObject definition -

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: app-insights
  labels: {}
spec:
  scaleTargetRef:
    name: app-insights
  minReplicaCount: 0
  maxReplicaCount: 2
  pollingInterval: 10
  cooldownPeriod: 30
  triggers:
  - type: azure-app-insights
    metadata:
      metricAggregationTimespan: "0:1"
      metricAggregationType: count
      metricId: "customMetrics/testMetric"
      targetValue: "100"
      applicationInsightsId: <app-id>
      tenantId: <tenantId>
      activeDirectoryClientId: <ad-client-id>
      activeDirectoryClientPasswordFromEnv: <env-varialble-for-client-password>
      cloud: "private"
      appInsightsResourceURL: <resource-url>
      activeDirectoryEndpoint: <ad-endpoint>
---

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Tests have been added
  • A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Changelog has been updated and is aligned with our changelog requirements

Relates to #2735

Signed-off-by: Vighnesh Shenoy <vshenoy@microsoft.com>
@v-shenoy v-shenoy requested a review from a team as a code owner March 25, 2022 08:44
@v-shenoy
Copy link
Contributor Author

v-shenoy commented Mar 25, 2022

pre-commit run fails locally for me when using //nolint:bodyclose in DataDog scaler, and fails in the GitHub actions without it.

Edit: seems that I have the wrong version of the linter, will fix and update PR.

@v-shenoy
Copy link
Contributor Author

hi @v-shenoy Could you rebase main into your branch? There is a fix for the static checks

I think the problem was just with my local golangci-lint which was on version 1.42.0, while it was updated to 1.45.0. I will just revert the DataDog changes and send the PR in some time.

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Only small nits inline

pkg/scalers/datadog_scaler.go Outdated Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Outdated Show resolved Hide resolved
pkg/scalers/azure/azure_app_insights.go Outdated Show resolved Hide resolved
Signed-off-by: Vighnesh Shenoy <vshenoy@microsoft.com>
Signed-off-by: Vighnesh Shenoy <vshenoy@microsoft.com>
@JatinSanghvi JatinSanghvi self-requested a review March 25, 2022 11:00
@JorTurFer
Copy link
Member

JorTurFer commented Mar 25, 2022

/run-e2e azure-app-insights*
Update: You can check the progres here

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
❤️ ❤️ ❤️ ❤️ ❤️

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a very small nit wrt imports. Thanks for the contribution!

pkg/scalers/azure_app_insights_scaler.go Outdated Show resolved Hide resolved
Signed-off-by: Vighnesh Shenoy <vshenoy@microsoft.com>
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JorTurFer JorTurFer merged commit 14c6043 into kedacore:main Mar 25, 2022
@v-shenoy v-shenoy deleted the non-public-clouds-app-insights branch March 25, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants