mcp-instana 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_instana-0.2.0.dist-info/METADATA +1229 -0
- mcp_instana-0.2.0.dist-info/RECORD +59 -0
- {mcp_instana-0.1.0.dist-info → mcp_instana-0.2.0.dist-info}/WHEEL +1 -1
- mcp_instana-0.2.0.dist-info/entry_points.txt +4 -0
- mcp_instana-0.1.0.dist-info/LICENSE → mcp_instana-0.2.0.dist-info/licenses/LICENSE.md +3 -3
- src/application/__init__.py +1 -0
- src/{client/application_alert_config_mcp_tools.py → application/application_alert_config.py} +251 -273
- src/application/application_analyze.py +628 -0
- src/application/application_catalog.py +155 -0
- src/application/application_global_alert_config.py +653 -0
- src/{client/application_metrics_mcp_tools.py → application/application_metrics.py} +113 -131
- src/{client/application_resources_mcp_tools.py → application/application_resources.py} +131 -151
- src/application/application_settings.py +1731 -0
- src/application/application_topology.py +111 -0
- src/automation/action_catalog.py +416 -0
- src/automation/action_history.py +338 -0
- src/core/__init__.py +1 -0
- src/core/server.py +586 -0
- src/core/utils.py +213 -0
- src/event/__init__.py +1 -0
- src/event/events_tools.py +850 -0
- src/infrastructure/__init__.py +1 -0
- src/{client/infrastructure_analyze_mcp_tools.py → infrastructure/infrastructure_analyze.py} +207 -206
- src/{client/infrastructure_catalog_mcp_tools.py → infrastructure/infrastructure_catalog.py} +197 -265
- src/infrastructure/infrastructure_metrics.py +171 -0
- src/{client/infrastructure_resources_mcp_tools.py → infrastructure/infrastructure_resources.py} +198 -227
- src/{client/infrastructure_topology_mcp_tools.py → infrastructure/infrastructure_topology.py} +110 -109
- src/log/__init__.py +1 -0
- src/log/log_alert_configuration.py +331 -0
- src/prompts/__init__.py +16 -0
- src/prompts/application/__init__.py +1 -0
- src/prompts/application/application_alerts.py +54 -0
- src/prompts/application/application_catalog.py +26 -0
- src/prompts/application/application_metrics.py +57 -0
- src/prompts/application/application_resources.py +26 -0
- src/prompts/application/application_settings.py +75 -0
- src/prompts/application/application_topology.py +30 -0
- src/prompts/events/__init__.py +1 -0
- src/prompts/events/events_tools.py +161 -0
- src/prompts/infrastructure/infrastructure_analyze.py +72 -0
- src/prompts/infrastructure/infrastructure_catalog.py +53 -0
- src/prompts/infrastructure/infrastructure_metrics.py +45 -0
- src/prompts/infrastructure/infrastructure_resources.py +74 -0
- src/prompts/infrastructure/infrastructure_topology.py +38 -0
- src/prompts/settings/__init__.py +0 -0
- src/prompts/settings/custom_dashboard.py +157 -0
- src/prompts/website/__init__.py +1 -0
- src/prompts/website/website_analyze.py +35 -0
- src/prompts/website/website_catalog.py +40 -0
- src/prompts/website/website_configuration.py +105 -0
- src/prompts/website/website_metrics.py +34 -0
- src/settings/__init__.py +1 -0
- src/settings/custom_dashboard_tools.py +417 -0
- src/website/__init__.py +0 -0
- src/website/website_analyze.py +433 -0
- src/website/website_catalog.py +171 -0
- src/website/website_configuration.py +770 -0
- src/website/website_metrics.py +241 -0
- mcp_instana-0.1.0.dist-info/METADATA +0 -649
- mcp_instana-0.1.0.dist-info/RECORD +0 -19
- mcp_instana-0.1.0.dist-info/entry_points.txt +0 -3
- src/client/What is the sum of queue depth for all q +0 -55
- src/client/events_mcp_tools.py +0 -531
- src/client/instana_client_base.py +0 -93
- src/client/log_alert_configuration_mcp_tools.py +0 -316
- src/client/show the top 5 services with the highest +0 -28
- src/mcp_server.py +0 -343
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
from typing import List, Optional, Union
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EventsPrompts:
|
|
7
|
+
"""Class containing events related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_event(
|
|
12
|
+
event_id: str
|
|
13
|
+
) -> str:
|
|
14
|
+
"""Get an overview of a specific event"""
|
|
15
|
+
return f"""
|
|
16
|
+
Get specific event:
|
|
17
|
+
- Event ID: {event_id}
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
@auto_register_prompt
|
|
21
|
+
@staticmethod
|
|
22
|
+
def get_kubernetes_info_events(
|
|
23
|
+
from_time: Optional[int] = None,
|
|
24
|
+
to_time: Optional[int] = None,
|
|
25
|
+
time_range: Optional[str] = None,
|
|
26
|
+
max_events: Optional[int] = 50
|
|
27
|
+
) -> str:
|
|
28
|
+
"""Get Kubernetes info events and analyze them"""
|
|
29
|
+
return f"""
|
|
30
|
+
Get Kubernetes info events:
|
|
31
|
+
- From time: {from_time or '(default: 24 hours ago)'}
|
|
32
|
+
- To time: {to_time or '(default: current time)'}
|
|
33
|
+
- Time range: {time_range or '(not specified)'}
|
|
34
|
+
- Max events: {max_events}
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
@auto_register_prompt
|
|
38
|
+
@staticmethod
|
|
39
|
+
def get_agent_monitoring_events(
|
|
40
|
+
query: Optional[str] = None,
|
|
41
|
+
from_time: Optional[int] = None,
|
|
42
|
+
to_time: Optional[int] = None,
|
|
43
|
+
size: Optional[int] = 100,
|
|
44
|
+
max_events: Optional[int] = 50,
|
|
45
|
+
time_range: Optional[str] = None
|
|
46
|
+
) -> str:
|
|
47
|
+
"""Get Agent monitoring events and analyze them"""
|
|
48
|
+
return f"""
|
|
49
|
+
Get Agent monitoring events:
|
|
50
|
+
- Query: {query or '(not specified)'}
|
|
51
|
+
- From time: {from_time or '(default: 1 hour ago)'}
|
|
52
|
+
- To time: {to_time or '(default: current time)'}
|
|
53
|
+
- Size: {size}
|
|
54
|
+
- Max events: {max_events}
|
|
55
|
+
- Time range: {time_range or '(not specified)'}
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
@auto_register_prompt
|
|
59
|
+
@staticmethod
|
|
60
|
+
def get_issues(
|
|
61
|
+
query: Optional[str] = None,
|
|
62
|
+
from_time: Optional[int] = None,
|
|
63
|
+
to_time: Optional[int] = None,
|
|
64
|
+
filter_event_updates: Optional[bool] = None,
|
|
65
|
+
exclude_triggered_before: Optional[int] = None,
|
|
66
|
+
event_type_filters: Optional[list[str]] = None,
|
|
67
|
+
max_events: Optional[int] = 50,
|
|
68
|
+
size: Optional[int] = 100,
|
|
69
|
+
time_range: Optional[str] = None
|
|
70
|
+
) -> str:
|
|
71
|
+
"""Get all issues within a specified time range"""
|
|
72
|
+
return f"""
|
|
73
|
+
Get all events:
|
|
74
|
+
- Query: {query or '(not specified)'}
|
|
75
|
+
- From time: {from_time or '(default: 1 hour ago)'}
|
|
76
|
+
- To time: {to_time or '(default: current time)'}
|
|
77
|
+
- Size: {size}
|
|
78
|
+
- Max events: {max_events}
|
|
79
|
+
- Time range: {time_range or '(not specified)'}
|
|
80
|
+
- Filter event updates: {filter_event_updates or 'False'}
|
|
81
|
+
- Exclude triggered before: {exclude_triggered_before or 'None'}
|
|
82
|
+
- Event type filters: {event_type_filters or 'None'}
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
@auto_register_prompt
|
|
86
|
+
@staticmethod
|
|
87
|
+
def get_incidents(
|
|
88
|
+
query: Optional[str] = None,
|
|
89
|
+
from_time: Optional[int] = None,
|
|
90
|
+
to_time: Optional[int] = None,
|
|
91
|
+
filter_event_updates: Optional[bool] = None,
|
|
92
|
+
exclude_triggered_before: Optional[int] = None,
|
|
93
|
+
event_type_filters: Optional[list[str]] = None,
|
|
94
|
+
max_events: Optional[int] = 50,
|
|
95
|
+
size: Optional[int] = 100,
|
|
96
|
+
time_range: Optional[str] = None
|
|
97
|
+
) -> str:
|
|
98
|
+
"""Get all incidents within a specified time range"""
|
|
99
|
+
return f"""
|
|
100
|
+
Get all events:
|
|
101
|
+
- Query: {query or '(not specified)'}
|
|
102
|
+
- From time: {from_time or '(default: 1 hour ago)'}
|
|
103
|
+
- To time: {to_time or '(default: current time)'}
|
|
104
|
+
- Size: {size}
|
|
105
|
+
- Max events: {max_events}
|
|
106
|
+
- Time range: {time_range or '(not specified)'}
|
|
107
|
+
- Filter event updates: {filter_event_updates or 'False'}
|
|
108
|
+
- Exclude triggered before: {exclude_triggered_before or 'None'}
|
|
109
|
+
- Event type filters: {event_type_filters or 'None'}
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
@auto_register_prompt
|
|
113
|
+
@staticmethod
|
|
114
|
+
def get_changes(
|
|
115
|
+
query: Optional[str] = None,
|
|
116
|
+
from_time: Optional[int] = None,
|
|
117
|
+
to_time: Optional[int] = None,
|
|
118
|
+
filter_event_updates: Optional[bool] = None,
|
|
119
|
+
exclude_triggered_before: Optional[int] = None,
|
|
120
|
+
event_type_filters: Optional[list[str]] = None,
|
|
121
|
+
max_events: Optional[int] = 50,
|
|
122
|
+
size: Optional[int] = 100,
|
|
123
|
+
time_range: Optional[str] = None
|
|
124
|
+
) -> str:
|
|
125
|
+
"""Get all changes within a specified time range"""
|
|
126
|
+
return f"""
|
|
127
|
+
Get all events:
|
|
128
|
+
- Query: {query or '(not specified)'}
|
|
129
|
+
- From time: {from_time or '(default: 1 hour ago)'}
|
|
130
|
+
- To time: {to_time or '(default: current time)'}
|
|
131
|
+
- Size: {size}
|
|
132
|
+
- Max events: {max_events}
|
|
133
|
+
- Time range: {time_range or '(not specified)'}
|
|
134
|
+
- Filter event updates: {filter_event_updates or 'False'}
|
|
135
|
+
- Exclude triggered before: {exclude_triggered_before or 'None'}
|
|
136
|
+
- Event type filters: {event_type_filters or 'None'}
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
@auto_register_prompt
|
|
140
|
+
@staticmethod
|
|
141
|
+
def get_events_by_ids(
|
|
142
|
+
event_ids: Union[List[str], str]
|
|
143
|
+
) -> str:
|
|
144
|
+
"""Get multiple events by their IDs"""
|
|
145
|
+
return f"""
|
|
146
|
+
Get events by IDs:
|
|
147
|
+
- Event IDs: {event_ids}
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def get_prompts(cls):
|
|
152
|
+
"""Return all prompts defined in this class"""
|
|
153
|
+
return [
|
|
154
|
+
('get_event', cls.get_event),
|
|
155
|
+
('get_kubernetes_info_events', cls.get_kubernetes_info_events),
|
|
156
|
+
('get_agent_monitoring_events', cls.get_agent_monitoring_events),
|
|
157
|
+
('get_issues', cls.get_issues),
|
|
158
|
+
('get_incidents', cls.get_incidents),
|
|
159
|
+
('get_changes', cls.get_changes),
|
|
160
|
+
('get_events_by_ids', cls.get_events_by_ids),
|
|
161
|
+
]
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Infrastructure Analyze MCP Prompts Module
|
|
3
|
+
|
|
4
|
+
This module provides infrastructure analyze-specific MCP prompts for Instana monitoring.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Callable, Dict, List, Optional, Tuple
|
|
8
|
+
|
|
9
|
+
from src.prompts import auto_register_prompt
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InfrastructureAnalyzePrompts:
|
|
13
|
+
"""Class containing prompts for infrastructure analysis in Instana."""
|
|
14
|
+
|
|
15
|
+
@auto_register_prompt
|
|
16
|
+
@staticmethod
|
|
17
|
+
def infra_available_metrics(
|
|
18
|
+
type: str,
|
|
19
|
+
query: Optional[str] = None,
|
|
20
|
+
var_from: Optional[int] = None,
|
|
21
|
+
to: Optional[int] = None,
|
|
22
|
+
windowSize: Optional[int] = None) -> str:
|
|
23
|
+
"""Get available infrastructure metrics for a given entity type"""
|
|
24
|
+
return f"""
|
|
25
|
+
Get available infrastructure metrics:
|
|
26
|
+
- Type: {type}
|
|
27
|
+
- Query: {query or 'None'}
|
|
28
|
+
- From: {var_from or 'None'}
|
|
29
|
+
- To: {to or 'None'}
|
|
30
|
+
- Window size: {windowSize or 'None'}
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@auto_register_prompt
|
|
34
|
+
@staticmethod
|
|
35
|
+
def infra_get_entities(
|
|
36
|
+
type: str,
|
|
37
|
+
metrics: Optional[str] = None,
|
|
38
|
+
windowSize: Optional[int] = None,
|
|
39
|
+
to: Optional[int] = None) -> str:
|
|
40
|
+
"""Fetch infrastructure entities and their metrics"""
|
|
41
|
+
return f"""
|
|
42
|
+
Get infrastructure entities:
|
|
43
|
+
- Type: {type}
|
|
44
|
+
- Metrics: {metrics}
|
|
45
|
+
- Window size: {windowSize or 'None'}
|
|
46
|
+
- To: {to or 'None'}
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
@auto_register_prompt
|
|
50
|
+
@staticmethod
|
|
51
|
+
def infra_available_plugins(
|
|
52
|
+
offline: bool,
|
|
53
|
+
query: Optional[str] = None,
|
|
54
|
+
windowSize: Optional[int] = None,
|
|
55
|
+
to: Optional[int] = None) -> str:
|
|
56
|
+
"""List available infrastructure monitoring plugins"""
|
|
57
|
+
return f"""
|
|
58
|
+
Get available infrastructure plugins:
|
|
59
|
+
- Query: {query or 'None'}
|
|
60
|
+
- Offline: {offline or 'False'}
|
|
61
|
+
- Window size: {windowSize or 'None'}
|
|
62
|
+
- To: {to or 'None'}
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def get_prompts(cls):
|
|
67
|
+
"""Get all prompts defined in this class"""
|
|
68
|
+
return [
|
|
69
|
+
('infra_available_metrics', cls.infra_available_metrics),
|
|
70
|
+
('infra_get_entities', cls.infra_get_entities),
|
|
71
|
+
('infra_available_plugins', cls.infra_available_plugins),
|
|
72
|
+
]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InfrastructureCatalogPrompts:
|
|
7
|
+
"""Class containing infrastructure catalog related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_available_payload_keys_by_plugin_id(plugin_id: str) -> str:
|
|
12
|
+
"""Retrieve available payload keys for a specific plugin"""
|
|
13
|
+
return f"Get payload keys for plugin ID: {plugin_id}"
|
|
14
|
+
|
|
15
|
+
@auto_register_prompt
|
|
16
|
+
@staticmethod
|
|
17
|
+
def get_infrastructure_catalog_metrics(plugin: str, filter: Optional[str] = None) -> str:
|
|
18
|
+
"""
|
|
19
|
+
Get the list of available metrics for a specified plugin, supporting metric exploration for dashboards and queries.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
plugin (str): Plugin (e.g., host, JVM, Kubernetes)
|
|
23
|
+
filter (Optional[str], optional): Filter string for narrowing down metrics
|
|
24
|
+
"""
|
|
25
|
+
return f"""
|
|
26
|
+
Get infrastructure catalog metrics:
|
|
27
|
+
- Plugin: {plugin}
|
|
28
|
+
- Filter: {filter or 'None'}
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
@auto_register_prompt
|
|
32
|
+
@staticmethod
|
|
33
|
+
def get_tag_catalog(plugin: str) -> str:
|
|
34
|
+
"""Get available tags for a specific plugin"""
|
|
35
|
+
return f"Get tag catalog for plugin: {plugin}"
|
|
36
|
+
|
|
37
|
+
@auto_register_prompt
|
|
38
|
+
@staticmethod
|
|
39
|
+
def get_tag_catalog_all() -> str:
|
|
40
|
+
"""Retrieve the complete list of tags available across all monitored entities"""
|
|
41
|
+
return "Get all tag catalogs"
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def get_prompts(cls):
|
|
45
|
+
"""Return all prompts defined in this class"""
|
|
46
|
+
return [
|
|
47
|
+
('get_available_payload_keys_by_plugin_id', cls.get_available_payload_keys_by_plugin_id),
|
|
48
|
+
('get_infrastructure_catalog_metrics', cls.get_infrastructure_catalog_metrics),
|
|
49
|
+
('get_tag_catalog', cls.get_tag_catalog),
|
|
50
|
+
('get_tag_catalog_all', cls.get_tag_catalog_all),
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Infrastructure Metrics MCP Prompts Module
|
|
3
|
+
|
|
4
|
+
This module provides infrastructure metrics-specific MCP prompts for Instana monitoring.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Callable, List, Optional, Tuple
|
|
8
|
+
|
|
9
|
+
from src.prompts import auto_register_prompt
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InfrastructureMetricsPrompts:
|
|
13
|
+
"""Class containing prompts for infrastructure metrics in Instana."""
|
|
14
|
+
|
|
15
|
+
@auto_register_prompt
|
|
16
|
+
@staticmethod
|
|
17
|
+
def get_infrastructure_metrics(
|
|
18
|
+
offline: bool,
|
|
19
|
+
rollup: int,
|
|
20
|
+
plugin: str,
|
|
21
|
+
window_size: Optional[int] = None,
|
|
22
|
+
query: Optional[str] = None,
|
|
23
|
+
metrics: Optional[List] = None,
|
|
24
|
+
snapshot_ids: Optional[List] = None,
|
|
25
|
+
to: Optional[int] = None,
|
|
26
|
+
) -> str:
|
|
27
|
+
"""Retrieve infrastructure metrics for plugin and query with a given time frame"""
|
|
28
|
+
return f"""
|
|
29
|
+
Get infrastructure metrics:
|
|
30
|
+
- Plugin: {plugin}
|
|
31
|
+
- Query: {query}
|
|
32
|
+
- Metrics: {metrics}
|
|
33
|
+
- Snapshot IDs: {snapshot_ids or 'None'}
|
|
34
|
+
- Offline: {offline or 'False'}
|
|
35
|
+
- Window size: {window_size or '1 hour'}
|
|
36
|
+
- To: {to or 'current time'}
|
|
37
|
+
- Rollup: {rollup or '60 seconds'}
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def get_prompts(cls):
|
|
42
|
+
"""Get all prompts defined in this class"""
|
|
43
|
+
return [
|
|
44
|
+
('get_infrastructure_metrics', cls.get_infrastructure_metrics),
|
|
45
|
+
]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InfrastructureResourcesPrompts:
|
|
7
|
+
"""Class containing infrastructure resources related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_infrastructure_monitoring_state() -> str:
|
|
12
|
+
"""Get an overview of the current Instana monitoring state"""
|
|
13
|
+
return "Get infrastructure monitoring state"
|
|
14
|
+
|
|
15
|
+
@auto_register_prompt
|
|
16
|
+
@staticmethod
|
|
17
|
+
def get_infrastructure_plugin_payload(
|
|
18
|
+
snapshot_id: str,
|
|
19
|
+
payload_key: str,
|
|
20
|
+
to_time: Optional[int] = None,
|
|
21
|
+
window_size: Optional[int] = None
|
|
22
|
+
) -> str:
|
|
23
|
+
"""Get raw plugin payload data for a specific snapshot entity"""
|
|
24
|
+
return f"""
|
|
25
|
+
Get plugin payload:
|
|
26
|
+
- Snapshot ID: {snapshot_id}
|
|
27
|
+
- Payload key: {payload_key}
|
|
28
|
+
- To time: {to_time or 'current time'}
|
|
29
|
+
- Window size: {window_size or '1 hour'}
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
@auto_register_prompt
|
|
33
|
+
@staticmethod
|
|
34
|
+
def get_infrastructure_metrics_snapshot(
|
|
35
|
+
snapshot_id: str,
|
|
36
|
+
to_time: Optional[int] = None,
|
|
37
|
+
window_size: Optional[int] = None
|
|
38
|
+
) -> str:
|
|
39
|
+
"""Get detailed information for a single infrastructure snapshot"""
|
|
40
|
+
return f"""
|
|
41
|
+
Get infrastructure snapshot:
|
|
42
|
+
- Snapshot ID: {snapshot_id}
|
|
43
|
+
- To time: {to_time or 'current time'}
|
|
44
|
+
- Window size: {window_size or '1 hour'}
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
@auto_register_prompt
|
|
48
|
+
@staticmethod
|
|
49
|
+
def post_infrastructure_metrics_snapshot(
|
|
50
|
+
snapshot_ids: list[str],
|
|
51
|
+
to_time: Optional[int] = None,
|
|
52
|
+
window_size: Optional[int] = None,
|
|
53
|
+
detailed: Optional[bool] = False,
|
|
54
|
+
) -> str:
|
|
55
|
+
"""Fetch details of multiple snapshots by their IDs"""
|
|
56
|
+
return f"""
|
|
57
|
+
Get multiple infrastructure snapshots:
|
|
58
|
+
- Snapshot IDs: {snapshot_ids}
|
|
59
|
+
- To time: {to_time or 'current time'}
|
|
60
|
+
- Window size: {window_size or '1 hour'}
|
|
61
|
+
- Detailed: {detailed or 'False'}
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def get_prompts(cls):
|
|
66
|
+
"""Return all prompts defined in this class"""
|
|
67
|
+
return [
|
|
68
|
+
('get_infrastructure_monitoring_state', cls.get_infrastructure_monitoring_state),
|
|
69
|
+
('get_infrastructure_plugin_payload', cls.get_infrastructure_plugin_payload),
|
|
70
|
+
('get_infrastructure_metrics_snapshot', cls.get_infrastructure_metrics_snapshot),
|
|
71
|
+
('post_infrastructure_metrics_snapshot', cls.post_infrastructure_metrics_snapshot),
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InfrastructureTopologyPrompts:
|
|
7
|
+
"""Class containing infrastructure topology related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_related_hosts(
|
|
12
|
+
snapshot_id: str,
|
|
13
|
+
to_time: Optional[int] = None,
|
|
14
|
+
window_size: Optional[int] = None
|
|
15
|
+
) -> str:
|
|
16
|
+
"""Get hosts related to a specific snapshot"""
|
|
17
|
+
return f"""
|
|
18
|
+
Get related hosts:
|
|
19
|
+
- Snapshot ID: {snapshot_id}
|
|
20
|
+
- To time: {to_time or '1 hour'}
|
|
21
|
+
- Window size: {window_size or '1 hour'}
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
@auto_register_prompt
|
|
25
|
+
@staticmethod
|
|
26
|
+
def get_topology(include_data: Optional[bool] = False) -> str:
|
|
27
|
+
"""Retrieve the complete infrastructure topology"""
|
|
28
|
+
return f"Get complete topology with include_data: {include_data or 'False'}"
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def get_prompts(cls):
|
|
32
|
+
"""Return all prompts defined in this class"""
|
|
33
|
+
return [
|
|
34
|
+
('get_related_hosts', cls.get_related_hosts),
|
|
35
|
+
('get_topology', cls.get_topology),
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
File without changes
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
from typing import Any, Dict, List, Optional
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CustomDashboardPrompts:
|
|
7
|
+
"""Class containing custom dashboard related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def create_dashboard(title: str,
|
|
12
|
+
widgets: Optional[List[Dict[str, Any]]] = None,
|
|
13
|
+
access_rules: Optional[List[Dict[str, Any]]] = None,
|
|
14
|
+
description: Optional[str] = None,
|
|
15
|
+
tags: Optional[List[str]] = None) -> str:
|
|
16
|
+
"""Create a new custom dashboard with specified configuration"""
|
|
17
|
+
return f"""
|
|
18
|
+
Create a new custom dashboard with:
|
|
19
|
+
- Title: {title}
|
|
20
|
+
- Description: {description or 'None'}
|
|
21
|
+
- Widgets: {widgets or 'None'}
|
|
22
|
+
- Access rules: {access_rules or 'None'}
|
|
23
|
+
- Tags: {tags or 'None'}
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
@auto_register_prompt
|
|
27
|
+
@staticmethod
|
|
28
|
+
def get_dashboard_list(limit: Optional[int] = None,
|
|
29
|
+
tags: Optional[List[str]] = None,
|
|
30
|
+
search: Optional[str] = None) -> str:
|
|
31
|
+
"""Retrieve a list of all custom dashboards"""
|
|
32
|
+
return f"""
|
|
33
|
+
Get custom dashboards list:
|
|
34
|
+
- Limit: {limit or 'None'}
|
|
35
|
+
- Tags filter: {tags or 'None'}
|
|
36
|
+
- Search: {search or 'None'}
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
@auto_register_prompt
|
|
40
|
+
@staticmethod
|
|
41
|
+
def get_dashboard_details(dashboard_id: str) -> str:
|
|
42
|
+
"""Get detailed information about a specific custom dashboard"""
|
|
43
|
+
return f"""
|
|
44
|
+
Get custom dashboard details:
|
|
45
|
+
- Dashboard ID: {dashboard_id}
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
@auto_register_prompt
|
|
49
|
+
@staticmethod
|
|
50
|
+
def update_dashboard(dashboard_id: str,
|
|
51
|
+
title: Optional[str] = None,
|
|
52
|
+
widgets: Optional[List[Dict[str, Any]]] = None,
|
|
53
|
+
access_rules: Optional[List[Dict[str, Any]]] = None,
|
|
54
|
+
description: Optional[str] = None,
|
|
55
|
+
tags: Optional[List[str]] = None) -> str:
|
|
56
|
+
"""Update an existing custom dashboard configuration"""
|
|
57
|
+
return f"""
|
|
58
|
+
Update custom dashboard:
|
|
59
|
+
- Dashboard ID: {dashboard_id}
|
|
60
|
+
- Title: {title or 'None'}
|
|
61
|
+
- Description: {description or 'None'}
|
|
62
|
+
- Widgets: {widgets or 'None'}
|
|
63
|
+
- Access rules: {access_rules or 'None'}
|
|
64
|
+
- Tags: {tags or 'None'}
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
@auto_register_prompt
|
|
68
|
+
@staticmethod
|
|
69
|
+
def delete_dashboard(dashboard_id: str) -> str:
|
|
70
|
+
"""Delete a custom dashboard"""
|
|
71
|
+
return f"""
|
|
72
|
+
Delete custom dashboard:
|
|
73
|
+
- Dashboard ID: {dashboard_id}
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
@auto_register_prompt
|
|
77
|
+
@staticmethod
|
|
78
|
+
def get_shareable_users(dashboard_id: str) -> str:
|
|
79
|
+
"""Get list of users who can be granted access to a custom dashboard"""
|
|
80
|
+
return f"""
|
|
81
|
+
Get shareable users for dashboard:
|
|
82
|
+
- Dashboard ID: {dashboard_id}
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
@auto_register_prompt
|
|
86
|
+
@staticmethod
|
|
87
|
+
def get_shareable_api_tokens(dashboard_id: str) -> str:
|
|
88
|
+
"""Get list of API tokens that can access a custom dashboard"""
|
|
89
|
+
return f"""
|
|
90
|
+
Get shareable API tokens for dashboard:
|
|
91
|
+
- Dashboard ID: {dashboard_id}
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
@auto_register_prompt
|
|
95
|
+
@staticmethod
|
|
96
|
+
def create_metric_widget(title: str,
|
|
97
|
+
metric_name: str,
|
|
98
|
+
time_range: Optional[str] = None,
|
|
99
|
+
aggregation: Optional[str] = None,
|
|
100
|
+
filters: Optional[Dict[str, Any]] = None) -> str:
|
|
101
|
+
"""Create a metric widget for a custom dashboard"""
|
|
102
|
+
return f"""
|
|
103
|
+
Create metric widget:
|
|
104
|
+
- Title: {title}
|
|
105
|
+
- Metric: {metric_name}
|
|
106
|
+
- Time range: {time_range or 'last 1 hour'}
|
|
107
|
+
- Aggregation: {aggregation or 'None'}
|
|
108
|
+
- Filters: {filters or 'None'}
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
@auto_register_prompt
|
|
112
|
+
@staticmethod
|
|
113
|
+
def create_chart_widget(title: str,
|
|
114
|
+
chart_type: str,
|
|
115
|
+
metrics: List[str],
|
|
116
|
+
time_range: Optional[str] = None,
|
|
117
|
+
group_by: Optional[str] = None) -> str:
|
|
118
|
+
"""Create a chart widget for a custom dashboard"""
|
|
119
|
+
return f"""
|
|
120
|
+
Create chart widget:
|
|
121
|
+
- Title: {title}
|
|
122
|
+
- Chart type: {chart_type}
|
|
123
|
+
- Metrics: {metrics}
|
|
124
|
+
- Time range: {time_range or 'last 1 hour'}
|
|
125
|
+
- Group by: {group_by or 'None'}
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
@auto_register_prompt
|
|
129
|
+
@staticmethod
|
|
130
|
+
def create_application_dashboard(application_name: str,
|
|
131
|
+
include_metrics: Optional[List[str]] = None,
|
|
132
|
+
include_topology: Optional[bool] = None,
|
|
133
|
+
time_range: Optional[str] = None) -> str:
|
|
134
|
+
"""Create a comprehensive dashboard for a specific application"""
|
|
135
|
+
return f"""
|
|
136
|
+
Create application dashboard:
|
|
137
|
+
- Application: {application_name}
|
|
138
|
+
- Metrics: {include_metrics or 'None'}
|
|
139
|
+
- Include topology: {include_topology or 'None'}
|
|
140
|
+
- Time range: {time_range or 'last 1 hour'}
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
@classmethod
|
|
144
|
+
def get_prompts(cls):
|
|
145
|
+
"""Return all prompts defined in this class"""
|
|
146
|
+
return [
|
|
147
|
+
('create_dashboard', cls.create_dashboard),
|
|
148
|
+
('get_dashboard_list', cls.get_dashboard_list),
|
|
149
|
+
('get_dashboard_details', cls.get_dashboard_details),
|
|
150
|
+
('update_dashboard', cls.update_dashboard),
|
|
151
|
+
('delete_dashboard', cls.delete_dashboard),
|
|
152
|
+
('get_shareable_users', cls.get_shareable_users),
|
|
153
|
+
('get_shareable_api_tokens', cls.get_shareable_api_tokens),
|
|
154
|
+
('create_metric_widget', cls.create_metric_widget),
|
|
155
|
+
('create_chart_widget', cls.create_chart_widget),
|
|
156
|
+
('create_application_dashboard', cls.create_application_dashboard),
|
|
157
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Website prompts module
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WebsiteAnalyzePrompts:
|
|
7
|
+
"""Class containing website analyze related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_website_beacon_groups(payload: Optional[dict] = None, fill_time_series: Optional[bool] = None) -> str:
|
|
12
|
+
"""Retrieve grouped website beacon metrics for analyzing performance across different dimensions like page URLs, browsers, or geographic locations"""
|
|
13
|
+
return f"""
|
|
14
|
+
Get website beacon groups with payload:
|
|
15
|
+
- Payload: {payload or 'None (will use default payload)'}
|
|
16
|
+
- Fill time series: {fill_time_series or 'None'}
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
@auto_register_prompt
|
|
20
|
+
@staticmethod
|
|
21
|
+
def get_website_beacons(payload: Optional[dict] = None, fill_time_series: Optional[bool] = None) -> str:
|
|
22
|
+
"""Retrieve individual website beacon metrics providing detailed information about specific beacon events"""
|
|
23
|
+
return f"""
|
|
24
|
+
Get website beacons with payload:
|
|
25
|
+
- Payload: {payload or 'None (will use default payload)'}
|
|
26
|
+
- Fill time series: {fill_time_series or 'None'}
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def get_prompts(cls):
|
|
31
|
+
"""Return all prompts defined in this class"""
|
|
32
|
+
return [
|
|
33
|
+
('get_website_beacon_groups', cls.get_website_beacon_groups),
|
|
34
|
+
('get_website_beacons', cls.get_website_beacons),
|
|
35
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from src.prompts import auto_register_prompt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WebsiteCatalogPrompts:
|
|
7
|
+
"""Class containing website catalog related prompts"""
|
|
8
|
+
|
|
9
|
+
@auto_register_prompt
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_website_catalog_metrics() -> str:
|
|
12
|
+
"""Retrieve all available metric definitions for website monitoring to discover what metrics are available"""
|
|
13
|
+
return """
|
|
14
|
+
Get website catalog metrics to discover available website monitoring metrics.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
@auto_register_prompt
|
|
18
|
+
@staticmethod
|
|
19
|
+
def get_website_catalog_tags() -> str:
|
|
20
|
+
"""Retrieve all available tags for website monitoring to discover what tags are available for filtering beacons"""
|
|
21
|
+
return """
|
|
22
|
+
Get website catalog tags to discover available website monitoring tags for filtering.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
@auto_register_prompt
|
|
26
|
+
@staticmethod
|
|
27
|
+
def get_website_tag_catalog() -> str:
|
|
28
|
+
"""Retrieve all available tags for website monitoring to discover what tags are available for filtering beacons"""
|
|
29
|
+
return """
|
|
30
|
+
Get website tag catalog to discover available website monitoring tags for filtering.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def get_prompts(cls):
|
|
35
|
+
"""Return all prompts defined in this class"""
|
|
36
|
+
return [
|
|
37
|
+
('get_website_catalog_metrics', cls.get_website_catalog_metrics),
|
|
38
|
+
('get_website_catalog_tags', cls.get_website_catalog_tags),
|
|
39
|
+
('get_website_tag_catalog', cls.get_website_tag_catalog),
|
|
40
|
+
]
|