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

Problem with fetching Azure custom metric through Azure Monitor scaler #1965

Closed
dymitrs opened this issue Jul 17, 2021 Discussed in #1946 · 7 comments · Fixed by #2506
Closed

Problem with fetching Azure custom metric through Azure Monitor scaler #1965

dymitrs opened this issue Jul 17, 2021 Discussed in #1946 · 7 comments · Fixed by #2506
Assignees
Labels
bug Something isn't working

Comments

@dymitrs
Copy link

dymitrs commented Jul 17, 2021

Discussed in #1946

Originally posted by dymitrs July 10, 2021
Hi all,
It seems that the Monitor scaler does not work with some custom metrics from Application Insights.
According to docs and the PR, Custom Metrics are supported after those changes #1883.

  triggers:
  - type: azure-monitor
    metadata:
      resourceURI: Microsoft.Insights/Components/app-insights
      subscriptionId: <...>
      tenantId: <...>
      resourceGroupName: <...>
      metricName: customMetrics/<metric name>
      metricNamespace: azure.applicationinsights
      metricAggregationInterval: "0:3:0"
      metricAggregationType: Count
      targetValue: "{{ .Values.scale_settings.target_value }}"

The autoscaler works fine for "default" metrics but for my custom one I'm getting this error and it fails - log from Keda operator pod:

ERROR   azure_monitor_scaler    error getting azure monitor metric      {"error": "error getting azure monitor metric customMetrics/<metric name>: got metric result for Microsoft.Insights/customMet
rics/<metric name> and aggregate type COUNT without timeseries"}
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).isScaledObjectActive
        /workspace/pkg/scaling/scale_handler.go:216
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers

Expected behavior:
Metrics are read from Azure.

Actual behavior:
Error getting metric.

Steps to reproduce:

  1. Setup Monitor scaler.
  2. Fetch custom metrics from Application Insights.

KEDA Version:
2.3.0

@tomkerkhove
Copy link
Member

Let's take a look but for what it's worth, Azure Monitor custom metrics do not always have parity with Application Insights which can require different API usage.

@stale
Copy link

stale bot commented Oct 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Oct 13, 2021
@tomkerkhove tomkerkhove added bug Something isn't working stale All issues that are marked as stale due to inactivity and removed stale All issues that are marked as stale due to inactivity labels Oct 14, 2021
@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Oct 14, 2021
@ifutant
Copy link

ifutant commented Nov 17, 2021

Any update on the status of this?

@stale
Copy link

stale bot commented Jan 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Jan 16, 2022
@tomkerkhove
Copy link
Member

Checking if this is still a problem yo are facing @dymitrs @ifutant ?

@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Jan 17, 2022
@markrzasa
Copy link
Contributor

I believe this is still a problem. It does appear that Application Insights uses a different API than Azure monitor. Here's the doc:

https://dev.applicationinsights.io/reference

I created a PR to add an Application Insights scaler:
#2506
kedacore/keda-docs#638

However, this scaler may not be necessary as the Azure Log Analytics scaler can be used to read Application Insights metrics using the AppMetrics table.

@tomkerkhove
Copy link
Member

Yes that is correct, I have misread the original report - Sorry :)

However, this scaler may not be necessary as the Azure Log Analytics scaler can be used to read Application Insights metrics using the AppMetrics table.

This is true, for the workspace-based Application Insights instances. The classic ones are still supported for 2-3 years so think a dedicated scaler might be better indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants