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

Added Azure Log Analytics scaler documentation #244

Closed
wants to merge 46 commits into from
Closed

Added Azure Log Analytics scaler documentation #244

wants to merge 46 commits into from

Conversation

spoplavskiy
Copy link
Contributor

@spoplavskiy spoplavskiy commented Sep 4, 2020

Signed-off-by: Sergiy Poplavskyi spopla@microsoft.com

Relates to kedacore/keda#1061

Copy link
Member

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

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

Added a bunch of first comments but high-level looks fine, thanks!

content/docs/2.0/scalers/azure-log-analytics.md Outdated Show resolved Hide resolved
clientID: "04b4ca0a-82b1-4c0a-bbbb-7946442e805b"
clientSecret: "vU6UtUXls6RNXxv~l6NRi1V8J1fnk5Q-ce"
workspaceID: "81963c40-af2e-47cd-8e72-3002e08aa2af"
query: "let AppName = \"web\";\r\nlet ClusterName = \"demo-cluster\";\r\nlet AvgDuration = ago(10m);\r\nlet ThresholdCoefficient = 0.8;\r\nPerf\r\n| where InstanceName contains AppName\r\n| where InstanceName contains ClusterName\r\n| where CounterName == \"cpuUsageNanoCores\"\r\n| where TimeGenerated > AvgDuration\r\n| extend AppName = substring(InstanceName, indexof((InstanceName), \"/\", 0, -1, 10) + 1)\r\n| summarize MetricValue=round(avg(CounterValue)) by CounterName, AppName\r\n| join (Perf \r\n | where InstanceName contains AppName\r\n | where InstanceName contains ClusterName\r\n | where CounterName == \"cpuLimitNanoCores\"\r\n | where TimeGenerated > AvgDuration\r\n | extend AppName = substring(InstanceName, indexof((InstanceName), \"/\", 0, -1, 10) + 1)\r\n | summarize arg_max(TimeGenerated, *) by AppName, CounterName\r\n | project Limit = CounterValue, TimeGenerated, CounterPath, AppName)\r\n on AppName\r\n| project MetricValue, Threshold = Limit * ThresholdCoefficient"
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering - Do we use in-line queries, use config map or mount them on the scaled workload?

Copy link
Member

Choose a reason for hiding this comment

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

Thoughts @zroubalik @ahmelsayed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tomkerkhove , I used Prometheus Scaler as reference: https://keda.sh/docs/1.5/scalers/prometheus/

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense but in this case, they are a bit longer. It's ok for me but just want to verify with the others.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can define a multi-line string in yaml using

      ...
      query: |
        let AppName = "web";
        let ClusterName = "demo-cluster";
        let AvgDuration = ago(10m);
        let ThresholdCoefficient = 0.8;
        Perf
        | where InstanceName contains AppName
        | where InstanceName contains ClusterName
        | where CounterName == "cpuUsageNanoCores"
        | where TimeGenerated > AvgDuration
        | extend AppName = substring(InstanceName, indexof((InstanceName), "/", 0, -1, 10) + 1)
        | summarize MetricValue=round(avg(CounterValue)) by CounterName, AppName
        | join (Perf 
                | where InstanceName contains AppName
                | where InstanceName contains ClusterName
                | where CounterName == "cpuLimitNanoCores"
                | where TimeGenerated > AvgDuration
                | extend AppName = substring(InstanceName, indexof((InstanceName), "/", 0, -1, 10) + 1)
                | summarize arg_max(TimeGenerated, *) by AppName, CounterName
                | project Limit = CounterValue, TimeGenerated, CounterPath, AppName)
                on AppName
        | project MetricValue, Threshold = Limit * ThresholdCoefficient

which might make it look a bit more readable.

Copy link
Member

Choose a reason for hiding this comment

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

Love the suggestion!

content/docs/2.0/scalers/azure-log-analytics.md Outdated Show resolved Hide resolved
content/docs/2.0/scalers/azure-log-analytics.md Outdated Show resolved Hide resolved
content/docs/2.0/scalers/azure-log-analytics.md Outdated Show resolved Hide resolved
content/docs/2.0/scalers/azure-log-analytics.md Outdated Show resolved Hide resolved
Copy link
Member

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

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

LGTM, but allowing others to comment as well.

content/docs/2.0/scalers/azure-log-analytics.md Outdated Show resolved Hide resolved
clientID: "04b4ca0a-82b1-4c0a-bbbb-7946442e805b"
clientSecret: "vU6UtUXls6RNXxv~l6NRi1V8J1fnk5Q-ce"
workspaceID: "81963c40-af2e-47cd-8e72-3002e08aa2af"
query: "let AppName = \"web\";\r\nlet ClusterName = \"demo-cluster\";\r\nlet AvgDuration = ago(10m);\r\nlet ThresholdCoefficient = 0.8;\r\nPerf\r\n| where InstanceName contains AppName\r\n| where InstanceName contains ClusterName\r\n| where CounterName == \"cpuUsageNanoCores\"\r\n| where TimeGenerated > AvgDuration\r\n| extend AppName = substring(InstanceName, indexof((InstanceName), \"/\", 0, -1, 10) + 1)\r\n| summarize MetricValue=round(avg(CounterValue)) by CounterName, AppName\r\n| join (Perf \r\n | where InstanceName contains AppName\r\n | where InstanceName contains ClusterName\r\n | where CounterName == \"cpuLimitNanoCores\"\r\n | where TimeGenerated > AvgDuration\r\n | extend AppName = substring(InstanceName, indexof((InstanceName), \"/\", 0, -1, 10) + 1)\r\n | summarize arg_max(TimeGenerated, *) by AppName, CounterName\r\n | project Limit = CounterValue, TimeGenerated, CounterPath, AppName)\r\n on AppName\r\n| project MetricValue, Threshold = Limit * ThresholdCoefficient"
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense but in this case, they are a bit longer. It's ok for me but just want to verify with the others.

@tomkerkhove
Copy link
Member

LGTM, but want your input on some topics @zroubalik @ahmelsayed .

@tomkerkhove
Copy link
Member

tomkerkhove commented Sep 7, 2020

@spoplavskiy feel free to add a note to https://github.com/kedacore/keda-docs/blob/master/content/blog/keda-2.0-beta.md.draft#L15 with your new scaler please? Thanks!

@spoplavskiy
Copy link
Contributor Author

@spoplavskiy feel free to add a note to https://github.com/kedacore/keda-docs/blob/master/content/blog/keda-2.0-beta.md.draft#L15 with your new scaler please? Thanks!

@tomkerkhove , thanks for pointing. Added in last commit.

@zroubalik
Copy link
Member

@spoplavskiy one last thing, DCO please :)

@tomkerkhove
Copy link
Member

TsuyoshiUshio and others added 15 commits September 10, 2020 11:47
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
* Provide 404 Not Found page

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Provide better 404 page

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Missing /

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Danny Seymour <dseymour@taos.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
@spoplavskiy
Copy link
Contributor Author

spoplavskiy commented Sep 10, 2020

And this great suggestion: https://github.com/kedacore/keda-docs/pull/244/files#r486117830

@tomkerkhove, Changed query to multiline in last commit

@spoplavskiy
Copy link
Contributor Author

@tomkerkhove, @zroubalik It looks like command, suggested by DCO tool to sign-off all my commits produced unexpected result :) It it now hard to revert and find in git log all my commits, as many of them was just applying inline suggections.

What if we finish reviewing this PR, and I will close this and open a new one by forking last version and applying my changes in single signed commit? Is that OK?

spoplavskiy and others added 22 commits September 10, 2020 12:50
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
…237)"

This reverts commit 67cb894.

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
…screenshot

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
@tomkerkhove
Copy link
Member

That's certainly ok for me @spoplavskiy, sorry for only noticing now!

@spoplavskiy
Copy link
Contributor Author

That's certainly ok for me @spoplavskiy, sorry for only noticing now!

@tomkerkhove , I have created a new PR: #250

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.

6 participants