Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed of Prometheus monitoring #27

Merged
merged 4 commits into from
Aug 20, 2023

Conversation

bbockelm
Copy link
Collaborator

This embeds the entire prometheus API, a scraper of local metrics, and the TSDB backend into the Pelican web UI. The prometheus API is mounted at /api/v1.0/prometheus.

Example query:

$ curl -k https://localhost:8444/api/v1.0/prometheus/query?query=promhttp_metric_handler_requests_total | jq

and output:

{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "__name__": "promhttp_metric_handler_requests_total",
          "code": "200",
          "instance": "localhost:8444",
          "job": "prometheus"
        },
        "value": [
          1690825915.596,
          "4"
        ]
      },
      {
        "metric": {
          "__name__": "promhttp_metric_handler_requests_total",
          "code": "500",
          "instance": "localhost:8444",
          "job": "prometheus"
        },
        "value": [
          1690825915.596,
          "0"
        ]
      },
      {
        "metric": {
          "__name__": "promhttp_metric_handler_requests_total",
          "code": "503",
          "instance": "localhost:8444",
          "job": "prometheus"
        },
        "value": [
          1690825915.596,
          "0"
        ]
      }
    ]
  }
}

bbockelm added 2 commits July 31, 2023 12:52
This pulls the prometheus monitoring stack into the web UI allowing
any future React-like Javascript application to have a self-contained
way for basic monitoring data.  The vision is this will power visualizations
in the admin dashboard.

For simplicity of review, the changes to go.mod/go.sum will come in a
follow-up commit.
@bbockelm bbockelm merged commit 0ce904e into PelicanPlatform:main Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants