awslabs.prometheus-mcp-server 0.1.1__py3-none-any.whl → 0.2.1__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.
@@ -14,4 +14,4 @@
14
14
 
15
15
  """awslabs Prometheus MCP Server."""
16
16
 
17
- __version__ = '0.1.0'
17
+ __version__ = '0.2.0'
@@ -14,70 +14,8 @@
14
14
 
15
15
  """Data models for the Prometheus MCP server."""
16
16
 
17
- from pydantic import BaseModel, Field, field_validator
18
- from typing import Any, List, Optional
19
-
20
-
21
- class PrometheusConfig(BaseModel):
22
- """Configuration for the Prometheus MCP server.
23
-
24
- This model defines the parameters that control the connection to AWS Managed Prometheus,
25
- including authentication and retry settings.
26
-
27
- Attributes:
28
- prometheus_url: URL of the AWS Managed Prometheus endpoint.
29
- aws_region: AWS region where the Prometheus service is located.
30
- aws_profile: AWS profile name to use for authentication (optional).
31
- service_name: AWS service name for SigV4 authentication (default: 'aps').
32
- retry_delay: Delay between retry attempts in seconds (default: 1).
33
- max_retries: Maximum number of retry attempts (default: 3).
34
- """
35
-
36
- prometheus_url: str = Field(description='URL of the AWS Managed Prometheus endpoint')
37
- aws_region: str = Field(description='AWS region where the Prometheus service is located')
38
- aws_profile: Optional[str] = Field(
39
- None, description='AWS profile name to use for authentication (optional)'
40
- )
41
- service_name: str = Field(
42
- default='aps', description='AWS service name for SigV4 authentication'
43
- )
44
- retry_delay: int = Field(
45
- default=1, description='Delay between retry attempts in seconds', ge=1
46
- )
47
- max_retries: int = Field(
48
- default=3, description='Maximum number of retry attempts', ge=1, le=10
49
- )
50
-
51
- @field_validator('prometheus_url')
52
- def validate_prometheus_url(cls, v):
53
- """Validate that the Prometheus URL is properly formatted."""
54
- if not v:
55
- raise ValueError('Prometheus URL cannot be empty')
56
-
57
- from urllib.parse import urlparse
58
-
59
- parsed = urlparse(v)
60
- if not all([parsed.scheme, parsed.netloc]):
61
- raise ValueError('Prometheus URL must include scheme (https://) and hostname')
62
-
63
- return v
64
-
65
-
66
- class QueryResponse(BaseModel):
67
- """Response from a Prometheus query.
68
-
69
- This model defines the structure of responses from Prometheus API queries,
70
- including status information and result data.
71
-
72
- Attributes:
73
- status: Status of the query ('success' or 'error').
74
- data: The query result data.
75
- error: Error message if status is 'error'.
76
- """
77
-
78
- status: str = Field(description="Status of the query ('success' or 'error')")
79
- data: Any = Field(description='The query result data')
80
- error: Optional[str] = Field(None, description="Error message if status is 'error'")
17
+ from pydantic import BaseModel, Field
18
+ from typing import List, Optional
81
19
 
82
20
 
83
21
  class MetricsList(BaseModel):
@@ -102,7 +40,11 @@ class ServerInfo(BaseModel):
102
40
  service_name: AWS service name for SigV4 authentication.
103
41
  """
104
42
 
105
- prometheus_url: str = Field(description='URL of the AWS Managed Prometheus endpoint')
43
+ prometheus_url: Optional[str] = Field(
44
+ None, description='URL of the AWS Managed Prometheus endpoint'
45
+ )
106
46
  aws_region: str = Field(description='AWS region where the Prometheus service is located')
107
- aws_profile: str = Field(description='AWS profile name used for authentication')
47
+ aws_profile: Optional[str] = Field(
48
+ None, description='AWS profile name used for authentication'
49
+ )
108
50
  service_name: str = Field(description='AWS service name for SigV4 authentication')