peimanja / artifactory_exporter

JFrog Artifactory Prometheus Exporter written in Go
Apache License 2.0
141 stars 37 forks source link

Health check endpoint needs to be updated #54

Closed mliang2 closed 2 years ago

mliang2 commented 3 years ago

Summary: The http://localhost:8081/artifactory/api/system/ping endpoint used to check Artifactory's health status is insufficient. Requesting an option to use http://localhost:8082/router/api/v1/system/health for the artifactory_system_healthy metric.

Note: the new endpoint is on port 8082, not 8081

With v7.x, Artifactory has switch to a micro-service architecture. We had a bad node and /artifactory/api/system/ping returns OK. artifactory_system_healthy metric returned healthy. With http://localhost:8082/router/api/v1/system/health, it returned status code 503:

{
  "router": {
    "node_id": "node2",
    "state": "HEALTHY",
    "message": "OK"
  },
  "services": [
    {
      "service_id": "jf-access@cf62cb13-312c-46c5-991d-a48344080da9",
      "node_id": "node2",
      "state": "UNHEALTHY_PEER",
      "message": "Service is healthy; there are missing services: jffe"
    },
    {
      "service_id": "jf-artifactory@077da22b-c412-4df0-92f4-c4141b813080",
      "node_id": "node2",
      "state": "UNHEALTHY_PEER",
      "message": "Service is healthy; there are missing services: jffe"
    },
    {
      "service_id": "jfevt@cf62cb13-312c-46c5-991d-a48344080da9",
      "node_id": "node2",
      "state": "UNHEALTHY_PEER",
      "message": "Service is healthy; there are missing services: jffe"
    },
    {
      "service_id": "jfmd@01f10z6zy2aqwrk5twc5kdc7hp",
      "node_id": "node2",
      "state": "UNHEALTHY_PEER",
      "message": "Service is healthy; there are missing services: jffe"
    }
  ]
}
peimanja commented 3 years ago

@mliang2 Thanks for pointing this out. I will look into this.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

lonacluka commented 2 years ago

@peimanja Any progress on this issue?

peimanja commented 2 years ago

hey @lonacluka I forgot to update here. So last time I checked we do not have router enabled. Not sure if that's an enterprise+ feature or not but we have CommercialX license and running version 7.X.

Since it is hard for me to develop or check this, I'm open to review your PR if you can work on this issue or provide me with some information on how to set that up locally for testing

lonacluka commented 2 years ago

@peimanja thank you for your response and for this great exporter. I'm afraid making a PR for this is beyond my abilities (for now that is :).

I understand. I made a workaround using a simple bash script that curls the output of that endpoint and writes a Prometheus metric to a file - depending on the curl's output it's value is 1/0 - which node_exporter then collects using textfile-collector.

I don't know if the output of that endpoint is enough for you to add this feature/metric? Note that the port is 8082 instead of 8081 as @mliang2 mentioned.

Thank you either way!

curl.txt !

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.