Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/rhobs/mcp_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ func registerMcpTools(s *mcp.Server) {
Name: "rhobs_logs",
Description: "Query RHOBS Loki logs for ROSA HCP infrastructure. " +
"Covers HCP hosted clusters, Management Clusters (MC), and Service Clusters (SC). " +
"Requires an MC cluster ID since logs are collected at the MC level. " +
"Accepts any cluster ID; HCP IDs are automatically resolved to their parent MC. " +
"The correct RHOBS cell is resolved automatically.",
Annotations: readOnlyAnnotations,
InputSchema: json.RawMessage(`{
"type": "object",
"properties": {
"cluster_id": {"type": "string", "description": "MC cluster ID or name (logs are collected at the MC level for HCP)"},
"cluster_id": {"type": "string", "description": "Cluster ID or name (HCP, MC, or SC). HCP IDs auto-resolve to their parent MC."},
"namespace": {"type": "string", "description": "Kubernetes namespace. Required unless query is set."},
"query": {"type": "string", "description": "Raw LogQL expression (overrides namespace)"},
"contain_regex": {"type": "string", "description": "Server-side regex filter (e.g., (?i)(error|timeout))"},
Expand Down
5 changes: 1 addition & 4 deletions cmd/rhobs/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,12 @@ func CreateRhobsFetcher(clusterKey string, rhobsFetchUse RhobsFetchUsage, hiveOc
isMC := false

if isHcp {
if rhobsFetchUse == RhobsFetchForLogs {
return nil, fmt.Errorf("cluster '%s' is a HCP cluster - try with its parent MC cluster", cluster.ID())
}
managementCluster, err := ocmutils.GetManagementCluster(cluster.ID())
if err != nil {
return nil, fmt.Errorf("failed to retrieve management cluster for cluster '%s': %v", cluster.ID(), err)
}
monitoredClusterId = managementCluster.ID()
log.Infof("Cluster %s is managed by MC cluster %s - using the MC cluster to retrieve the RHOBS cell for logs\n", cluster.ID(), monitoredClusterId)
log.Infof("Cluster %s is managed by MC cluster %s - using the MC cluster for RHOBS cell resolution\n", cluster.ID(), monitoredClusterId)
} else {
monitoredClusterId = cluster.ID()
isMC, err = ocmutils.IsManagementCluster(cluster.ID())
Expand Down