flexmetric 0.5.3__tar.gz → 0.5.4__tar.gz
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.
- {flexmetric-0.5.3 → flexmetric-0.5.4}/PKG-INFO +26 -1
- {flexmetric-0.5.3 → flexmetric-0.5.4}/README.md +24 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/prometheus_agent.py +4 -1
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric.egg-info/PKG-INFO +26 -1
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric.egg-info/requires.txt +1 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/setup.py +3 -2
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/__init__.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/config/__init__.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/config/configuration.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/file_recognition/__init__.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/file_recognition/exec_file.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/logging_module/__init__.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/logging_module/logger.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/__init__.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/database_connections.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/database_processing.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/expiring_queue.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/process_commands.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/queries_execution.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric/metric_process/views.py +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric.egg-info/SOURCES.txt +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric.egg-info/dependency_links.txt +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric.egg-info/entry_points.txt +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/flexmetric.egg-info/top_level.txt +0 -0
- {flexmetric-0.5.3 → flexmetric-0.5.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: flexmetric
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.4
|
4
4
|
Summary: A secure flexible Prometheus exporter for commands, databases, functions.
|
5
5
|
Home-page: https://github.com/nikhillingadhal1999/flexmetric
|
6
6
|
Author: Nikhil Lingadhal
|
@@ -22,6 +22,7 @@ Requires-Dist: twine
|
|
22
22
|
Requires-Dist: flask
|
23
23
|
Requires-Dist: clickhouse-connect
|
24
24
|
Requires-Dist: psycopg2-binary
|
25
|
+
Requires-Dist: ollama
|
25
26
|
Dynamic: author
|
26
27
|
Dynamic: classifier
|
27
28
|
Dynamic: description
|
@@ -141,7 +142,31 @@ curl -X POST http://localhost:5000/update_metric \
|
|
141
142
|
"labels": ["metric_type", "core"],
|
142
143
|
"main_label": "cpu_usage_metric"
|
143
144
|
}'
|
145
|
+
```
|
146
|
+
Python client
|
147
|
+
```python
|
148
|
+
import requests
|
149
|
+
import json
|
150
|
+
|
151
|
+
url = "http://localhost:5000/update_metric"
|
152
|
+
headers = {
|
153
|
+
"Content-Type": "application/json"
|
154
|
+
}
|
155
|
+
data = {
|
156
|
+
"result": [
|
157
|
+
{
|
158
|
+
"label": ["cpu", "core_1"],
|
159
|
+
"value": 42.5
|
160
|
+
}
|
161
|
+
],
|
162
|
+
"labels": ["metric_type", "core"],
|
163
|
+
"main_label": "cpu_usage_metric"
|
164
|
+
}
|
165
|
+
|
166
|
+
response = requests.post(url, headers=headers, data=json.dumps(data))
|
144
167
|
|
168
|
+
print(f"Status Code: {response.status_code}")
|
169
|
+
print("Response:", response.text)
|
145
170
|
```
|
146
171
|
|
147
172
|
### Using flex metrics in secure mode
|
@@ -106,7 +106,31 @@ curl -X POST http://localhost:5000/update_metric \
|
|
106
106
|
"labels": ["metric_type", "core"],
|
107
107
|
"main_label": "cpu_usage_metric"
|
108
108
|
}'
|
109
|
+
```
|
110
|
+
Python client
|
111
|
+
```python
|
112
|
+
import requests
|
113
|
+
import json
|
114
|
+
|
115
|
+
url = "http://localhost:5000/update_metric"
|
116
|
+
headers = {
|
117
|
+
"Content-Type": "application/json"
|
118
|
+
}
|
119
|
+
data = {
|
120
|
+
"result": [
|
121
|
+
{
|
122
|
+
"label": ["cpu", "core_1"],
|
123
|
+
"value": 42.5
|
124
|
+
}
|
125
|
+
],
|
126
|
+
"labels": ["metric_type", "core"],
|
127
|
+
"main_label": "cpu_usage_metric"
|
128
|
+
}
|
129
|
+
|
130
|
+
response = requests.post(url, headers=headers, data=json.dumps(data))
|
109
131
|
|
132
|
+
print(f"Status Code: {response.status_code}")
|
133
|
+
print("Response:", response.text)
|
110
134
|
```
|
111
135
|
|
112
136
|
### Using flex metrics in secure mode
|
@@ -218,7 +218,10 @@ def measure(args):
|
|
218
218
|
# print(label_dict)
|
219
219
|
|
220
220
|
try:
|
221
|
-
|
221
|
+
if len(label_dict) > 0:
|
222
|
+
gauge.labels(**label_dict).set(convert_to_data_type(result["value"]))
|
223
|
+
else:
|
224
|
+
gauge.set(result["value"])
|
222
225
|
except Exception as ex:
|
223
226
|
logger.error(f"Failed to set gauge for labels {label_dict}: {ex}")
|
224
227
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: flexmetric
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.4
|
4
4
|
Summary: A secure flexible Prometheus exporter for commands, databases, functions.
|
5
5
|
Home-page: https://github.com/nikhillingadhal1999/flexmetric
|
6
6
|
Author: Nikhil Lingadhal
|
@@ -22,6 +22,7 @@ Requires-Dist: twine
|
|
22
22
|
Requires-Dist: flask
|
23
23
|
Requires-Dist: clickhouse-connect
|
24
24
|
Requires-Dist: psycopg2-binary
|
25
|
+
Requires-Dist: ollama
|
25
26
|
Dynamic: author
|
26
27
|
Dynamic: classifier
|
27
28
|
Dynamic: description
|
@@ -141,7 +142,31 @@ curl -X POST http://localhost:5000/update_metric \
|
|
141
142
|
"labels": ["metric_type", "core"],
|
142
143
|
"main_label": "cpu_usage_metric"
|
143
144
|
}'
|
145
|
+
```
|
146
|
+
Python client
|
147
|
+
```python
|
148
|
+
import requests
|
149
|
+
import json
|
150
|
+
|
151
|
+
url = "http://localhost:5000/update_metric"
|
152
|
+
headers = {
|
153
|
+
"Content-Type": "application/json"
|
154
|
+
}
|
155
|
+
data = {
|
156
|
+
"result": [
|
157
|
+
{
|
158
|
+
"label": ["cpu", "core_1"],
|
159
|
+
"value": 42.5
|
160
|
+
}
|
161
|
+
],
|
162
|
+
"labels": ["metric_type", "core"],
|
163
|
+
"main_label": "cpu_usage_metric"
|
164
|
+
}
|
165
|
+
|
166
|
+
response = requests.post(url, headers=headers, data=json.dumps(data))
|
144
167
|
|
168
|
+
print(f"Status Code: {response.status_code}")
|
169
|
+
print("Response:", response.text)
|
145
170
|
```
|
146
171
|
|
147
172
|
### Using flex metrics in secure mode
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="flexmetric",
|
5
|
-
version="0.5.
|
5
|
+
version="0.5.4",
|
6
6
|
author="Nikhil Lingadhal",
|
7
7
|
description="A secure flexible Prometheus exporter for commands, databases, functions.",
|
8
8
|
long_description=open("README.md").read(),
|
@@ -24,7 +24,8 @@ setup(
|
|
24
24
|
"twine",
|
25
25
|
"flask",
|
26
26
|
"clickhouse-connect",
|
27
|
-
"psycopg2-binary"
|
27
|
+
"psycopg2-binary",
|
28
|
+
"ollama"
|
28
29
|
],
|
29
30
|
entry_points={
|
30
31
|
"console_scripts": [
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|