{"action":"closed","issue":{"url":"https://api.github.com/repos/philiplb/PHPProm/issues/2","repository_url":"https://api.github.com/repos/philiplb/PHPProm","labels_url":"https://api.github.com/repos/philiplb/PHPProm/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/philiplb/PHPProm/issues/2/comments","events_url":"https://api.github.com/repos/philiplb/PHPProm/issues/2/events","html_url":"https://github.com/philiplb/PHPProm/issues/2","id":191906041,"number":2,"title":"Prometheus not scraping from Crudlex endpoint","user":{"login":"dakala","id":285543,"avatar_url":"https://avatars.githubusercontent.com/u/285543?v=3","gravatar_id":"","url":"https://api.github.com/users/dakala","html_url":"https://github.com/dakala","followers_url":"https://api.github.com/users/dakala/followers","following_url":"https://api.github.com/users/dakala/following{/other_user}","gists_url":"https://api.github.com/users/dakala/gists{/gist_id}","starred_url":"https://api.github.com/users/dakala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakala/subscriptions","organizations_url":"https://api.github.com/users/dakala/orgs","repos_url":"https://api.github.com/users/dakala/repos","events_url":"https://api.github.com/users/dakala/events{/privacy}","received_events_url":"https://api.github.com/users/dakala/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-28T02:23:30Z","updated_at":"2016-11-29T21:48:03Z","closed_at":"2016-11-29T21:48:03Z","body":"Great work! I'm doing an article on PHPProm and interested in writing an integration for Drupal 8. I've set up Prometheus locally with Crudlex also running on the same machine. However, I'm having issues with Prometheus not scraping from my endpoint. I can `curl` my `/metrics` endpoint, the data is visible in Redis but Prometheus is reporting status as \"down\" with the error \"context deadline exceeded\". \r\n\r\nHave I missed anything? Any assistance would be appreciated please.\r\n\r\n**What I've done:**\r\n\r\n- I added this to `web\\index.php`:\r\n\r\n```php\r\n$storage = new PHPProm\\Storage\\Redis('localhost', ''); // /usr/local/etc/redis.conf\r\n\r\n$silexPrometheusSetup = new PHPProm\\Integration\\SilexSetup();\r\n$metricsAction = $silexPrometheusSetup->setupAndGetMetricsRoute($app, $storage);\r\n$app->get('/metrics', $metricsAction);\r\n```\r\n- I added **my-job** to `prometheus.yml`:\r\n\r\n```\r\n# my global config\r\nglobal:\r\n  scrape_interval:     15s # By default, scrape targets every 15 seconds.\r\n  evaluation_interval: 15s # By default, scrape targets every 15 seconds.\r\n  # scrape_timeout is set to the global default (10s).\r\n\r\n  # Attach these labels to any time series or alerts when communicating with\r\n  # external systems (federation, remote storage, Alertmanager).\r\n  external_labels:\r\n      monitor: 'codelab-monitor'\r\n\r\n# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.\r\nrule_files:\r\n  # - \"first.rules\"\r\n  # - \"second.rules\"\r\n  - 'prometheus.rules'\r\n\r\n# A scrape configuration containing exactly one endpoint to scrape:\r\n# Here it's Prometheus itself.\r\nscrape_configs:\r\n  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.\r\n  - job_name: 'prometheus'\r\n\r\n    # Override the global default and scrape targets from this job every 5 seconds.\r\n    scrape_interval: 5s\r\n\r\n    # metrics_path defaults to '/metrics'\r\n    # scheme defaults to 'http'.\r\n\r\n    static_configs:\r\n      - targets: ['localhost:9090']\r\n\r\n  - job_name: 'my-job'\r\n    scrape_interval: 20s\r\n    static_configs:\r\n      - targets: ['test-site.dev']\r\n        labels:\r\n          group: 'my-job-test'\r\n\r\n  - job_name:       'example-random'\r\n\r\n    # Override the global default and scrape targets from this job every 5 seconds.\r\n    scrape_interval: 5s\r\n\r\n    static_configs:\r\n      - targets: ['localhost:8080', 'localhost:8081']\r\n        labels:\r\n          group: 'production'\r\n\r\n      - targets: ['localhost:8082']\r\n        labels:\r\n          group: 'canary'\r\n```          \r\n\r\nI've also filed an issue with Prometheus, perhaps it's a misconfiguration. Thanks."}}
{"actor":{"display_login":"philiplb"}}