Git Product home page Git Product logo

aks1226's Introduction

aks1226

let data = materialize( InsightsMetrics | where Name == "kube_deployment_status_replicas_ready" | extend Tags = parse_json(Tags) | extend ClusterId = Tags["container.azm.ms/clusterId"] {clusterIdWhereClause} | where Tags.deployment in ({deploymentName}) | extend Deployment = tostring(Tags.deployment) | extend k8sNamespace = tostring(Tags.k8sNamespace) | extend Ready = Val/Tags.spec_replicas * 100, Updated = Val/Tags.status_replicas_updated * 100, Available = Val/Tags.status_replicas_available * 100 | project k8sNamespace, Deployment, Ready, Updated, Available, TimeGenerated, Tags ); let data2 = data | extend Age = (now() - todatetime(Tags["creationTime"]))/1m | summarize arg_max(TimeGenerated, *) by k8sNamespace, Deployment | project k8sNamespace, Deployment, Age, Ready, Updated, Available; let ReadyData = data | make-series ReadyTrend = avg(Ready) default = 0 on TimeGenerated from {timeRange:start} to {timeRange:end} step {timeRange:grain} by k8sNamespace, Deployment; let UpdatedData = data | make-series UpdatedTrend = avg(Updated) default = 0 on TimeGenerated from {timeRange:start} to {timeRange:end} step {timeRange:grain} by k8sNamespace, Deployment; let AvailableData = data | make-series AvailableTrend = avg(Available) default = 0 on TimeGenerated from {timeRange:start} to {timeRange:end} step {timeRange:grain} by k8sNamespace, Deployment; data2 | join kind = inner(ReadyData) on k8sNamespace, Deployment | join kind = inner(UpdatedData) on k8sNamespace, Deployment | join kind = inner(AvailableData) on k8sNamespace, Deployment | extend ReadyCase = case(Ready == 100, "Healthy", "Warning"), UpdatedCase = case(Updated == 100, "Healthy", "Warning"), AvailableCase = case(Available == 100, "Healthy", "Warning") | extend Overall = case(ReadyCase == "Healthy" and UpdatedCase == "Healthy" and AvailableCase == "Healthy", "Healthy", "Warning") | extend OverallFilterStatus = case('{OverallFilter}' contains "Healthy", "Healthy", '{OverallFilter}' contains "Warning", "Warning", "Healthy, Warning") | where OverallFilterStatus has Overall | project Deployment, Namespace = k8sNamespace, Age, Ready, ReadyTrend, Updated, UpdatedTrend, Available,AvailableTrend | sort by Ready asc

ContainerLog |join kind=leftouter ( KubePodInventory | distinct Computer, ClusterId, ServiceName, ControllerName, ContainerID, ContainerName, Name, Namespace, ClusterName | where Namespace contains ({namespace}) | project-rename PodName=Name | join kind=inner (InsightsMetrics | where Name == "kube_deployment_status_replicas_ready" | extend Tags = parse_json(Tags) | extend ClusterId = Tags["container.azm.ms/clusterId"] {clusterIdWhereClause} | where Tags.deployment in ({deploymentName}) | extend Deployment = tostring(Tags.deployment) | extend k8sNamespace = tostring(Tags.k8sNamespace) ))//KubePodInventory Contains pod metadata on ContainerID | extend ContainerName = split(ContainerName, "/")[1] // KubePodInventory stores ContainerName in format PodUI/container name, hence we split | where Namespace contains ({namespace}) | sort by TimeGenerated | project TimeGenerated, Namespace, PodName, ContainerName, LogEntry, LogEntrySource

aks1226's People

Contributors

sshabb697 avatar

Watchers

 avatar  avatar

Forkers

ravinder1076

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.