Skip to content

merge to main from Vishwa/azuremonitor-1 - #1

Merged
vishiy merged 4 commits into
masterfrom
vishwa/azuremonitor-1
Jul 16, 2025
Merged

vishiy merged 4 commits into
masterfrom
vishwa/azuremonitor-1

Conversation

@vishiy

@vishiy vishiy commented Jul 16, 2025

Copy link
Copy Markdown
Owner

No description provided.

@vishiy
vishiy merged commit f5e654f into master Jul 16, 2025
vishiy pushed a commit that referenced this pull request Aug 2, 2025
…GPT#693)

When importing holmes and leverage RichHandler to handle log, we need to
remove existing log handlers to not let existing log handler break the
outpout format of holmes CLI.

As a result, the log may not be printed out as expected, for example,

```
Welcome to HolmesGPT: Type '/exit' to exit, '/help' for commands.
User: what's my cluster info

Thinking...

╭─ AI Response ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                       │
│  Cluster: AKS, region southeastasia, 7 nodes.                                                                                                         │
│                                                                                                                                                       │
│   • Nodepools: containerd2 (Azure Linux), nodepool1 (Ubuntu), win (Windows)                                                                           │
│   • Kubernetes version: v1.33.0                                                                                                                       │
│   • Network policy: calico                                                                                                                            │
│   • All nodes Ready, VMSS-backed, Premium_LRS storage.                                                                                                │
│                                                                                                                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

User:
```

The force arg is explained here:
```
    force     If this keyword  is specified as true, any existing handlers
              attached to the root logger are removed and closed, before
              carrying out the configuration as specified by the other
              arguments.
```


https://github.com/python/cpython/blob/e41c1ce585827f92dab9b7a7fc3df2bda2f817fe/Lib/logging/__init__.py#L2038-L2041


After the change:
```
✅ Toolset kubernetes/live-metrics
✅ Toolset kubernetes/kube-prometheus-stack
✅ Toolset internet
✅ Toolset runbook
✅ Toolset kubernetes/logs
✅ Toolset docker/core
✅ Toolset helm/core
✅ Toolset kubernetes/core
discovered service with label-selector: `app=kube-prometheus-stack-prometheus` at url:
`http://prometheus-kube-prometheus-prometheus.default.svc.cluster.local:9090`
Prometheus auto discovered at url http://prometheus-kube-prometheus-prometheus.default.svc.cluster.local:9090
❌ Toolset prometheus/metrics: Failed to initialize using url=http://prometheus-kube-prometheus-prometheus.default.svc.cluster.local:9090/-/healthy
Using 36 datasources (toolsets). To refresh: `holmes toolset refresh`
Welcome to HolmesGPT: Type '/exit' to exit, '/help' for commands.
User: what's my cluster info

Thinking...

Running tool #1 kubectl_get_by_kind_in_cluster: kubectl get -A --show-labels -o wide node
  Finished #1 in 0.94s, output length: 10,264 characters - /show to view contents

╭─ AI Response ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                       │
│  Cluster: MC_qinhao_credential-provider-win_southeastasia Region: southeastasia Kubernetes version: v1.33.0 Nodes: 7 (6 Linux, 1 Windows) Nodepools:  │
│  containerd2 (Azure Linux), nodepool1 (Ubuntu), win (Windows) Network policy: calico VM type: Standard_DS2_v2 (Linux), Standard_D2ls_v5 (Windows)     │
│  All nodes Ready.                                                                                                                                     │
│                                                                                                                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```
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.

1 participant