mirror of
https://github.com/MaxenceG2M/prometheus-immich-exporter.git
synced 2025-12-08 23:03:22 +00:00
Merge branch 'master' into master
This commit is contained in:
@@ -64,6 +64,7 @@ class ImmichMetricsCollector:
|
|||||||
def get_immich_users_stat(self):
|
def get_immich_users_stat(self):
|
||||||
try:
|
try:
|
||||||
endpoint_user_stats = "/statistics"
|
endpoint_user_stats = "/statistics"
|
||||||
|
|
||||||
response_user_stats = self.request(endpoint_user_stats).json()
|
response_user_stats = self.request(endpoint_user_stats).json()
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
logger.error(f"API ERROR: can't get server statistic: {e}")
|
logger.error(f"API ERROR: can't get server statistic: {e}")
|
||||||
@@ -172,6 +173,7 @@ class ImmichMetricsCollector:
|
|||||||
# throwing connectionRefused exception usually means that immich isn't running
|
# throwing connectionRefused exception usually means that immich isn't running
|
||||||
|
|
||||||
server_version_endpoint = "/version"
|
server_version_endpoint = "/version"
|
||||||
|
|
||||||
response_server_version = ""
|
response_server_version = ""
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -306,7 +308,7 @@ def check_server_up(immichHost, immichPort):
|
|||||||
try:
|
try:
|
||||||
requests.request(
|
requests.request(
|
||||||
"GET",
|
"GET",
|
||||||
f"http://{immichHost}:{immichPort}/api/server-info/ping",
|
f"http://{immichHost}:{immichPort}/api/server/ping",
|
||||||
headers={'Accept': 'application/json'}
|
headers={'Accept': 'application/json'}
|
||||||
)
|
)
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
@@ -331,7 +333,7 @@ def check_immich_api_key(immichHost, immichPort, immichApiKey):
|
|||||||
try:
|
try:
|
||||||
requests.request(
|
requests.request(
|
||||||
"GET",
|
"GET",
|
||||||
f"http://{immichHost}:{immichPort}/api/server-info/",
|
f"http://{immichHost}:{immichPort}/api/server/",
|
||||||
headers={
|
headers={
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
"x-api-key": immichApiKey
|
"x-api-key": immichApiKey
|
||||||
|
|||||||
Reference in New Issue
Block a user