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

Prometheus API endpoint results in 404 due to missing v1 route. #925

Closed
ajohnstone opened this issue Jul 23, 2015 · 9 comments
Closed

Prometheus API endpoint results in 404 due to missing v1 route. #925

ajohnstone opened this issue Jul 23, 2015 · 9 comments

Comments

@ajohnstone
Copy link

Docker image: prom/prometheus:latest (8c05d89135bddf4dbf6a343d3fd197268cd036c53dd375193c2eb7d4880bea7d)

REPOSITORY                                          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
prom/prometheus                                     latest              8c05d89135bd        7 weeks ago         37.29 MB

http://localhost:9090/api/v1/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20
curl -v http://localhost:9090/api/v1/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20 -H Accept-Encoding: gzip, deflate, sdch -H Connection: keep-alive --compressed
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9090 (#0)
> GET /api/v1/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:9090
> Accept: */*
> Accept-Encoding: gzip, deflate, sdch
> Connection: keep-alive
> 
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< Date: Thu, 23 Jul 2015 10:48:20 GMT
< Content-Length: 19
< 
404 page not found
* Connection #0 to host localhost left intact

curl -v http://localhost:9090/api/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20 -H Accept-Encoding: gzip, deflate, sdch -H Connection: keep-alive --compressed
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9090 (#0)
> GET /api/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:9090
> Accept: */*
> Accept-Encoding: gzip, deflate, sdch
> Connection: keep-alive
> 
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
< Access-Control-Allow-Methods: GET
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Date
< Content-Encoding: gzip
< Content-Type: application/json
< Date: Thu, 23 Jul 2015 10:48:20 GMT
< Content-Length: 124
< 
{"type":"error","value":"invalid query range: strconv.ParseFloat: parsing \"\": invalid syntax","version":1}
* Connection #0 to host localhost left intact
@ajohnstone
Copy link
Author

Should ideally push successful builds to the docker registry

@brian-brazil
Copy link
Contributor

Hmm, that sounds like you're using a version of Prometheus that's too old to have that endpoint.

@discordianfish

@ajohnstone
Copy link
Author

@brian-brazil As mentioned the last docker build that was pushed is 7 weeks old from prom/prometheus:latest.

As suggested, should ideally push successful builds to the docker registry.
I've built a version locally and all works fine for Grafana.

@fabxc
Copy link
Contributor

fabxc commented Jul 23, 2015

Did someone set the stable branch to the new release tag?

On Thu, Jul 23, 2015, 8:29 PM Andrew Johnstone notifications@github.com
wrote:

@brian-brazil https://github.com/brian-brazil As mentioned the last
docker build that was pushed is 7 weeks old. From prom/prometheus:latest.

As suggested should ideally push successful builds to the docker registry.
I've built a version locally and all works fine for Grafana.


Reply to this email directly or view it on GitHub
#925 (comment)
.

@juliusv
Copy link
Member

juliusv commented Jul 23, 2015

@fabxc Nobody had, but now I did. That part is still way too tribal knowledge for people doing releases (again, should really be documented or even automated properly). @ajohnstone Did that fix the problem when you pull the latest Docker image? (can't test right now, on crappy hotel internet)

@ajohnstone
Copy link
Author

@juliusv Great thanks worked.. Unsure whether to close this ticket or whether to leave open to ensure its automated.

$ docker images | head -n1; docker images | grep prom
REPOSITORY                                      TAG                     IMAGE ID            CREATED             VIRTUAL SIZE
prom/prometheus                                 latest                  8c05d89135bd        7 weeks ago         37.29 MB

$ docker pull prom/prometheus
latest: Pulling from prom/prometheus
a52bd7281b0c: Pull complete 
b4a2a1b612b8: Pull complete 
5232f8a983de: Pull complete 
d141aae8759e: Pull complete 
a9c71ae17c76: Pull complete 
10e6bb412f7a: Pull complete 
d650923cb79d: Pull complete 
cc95d246728e: Pull complete 
0faf06dcd54f: Pull complete 
b4ab862f710c: Pull complete 
b6341635d6c2: Pull complete 
dd8ee4d64e43: Already exists 
31f630c65071: Already exists 
Digest: sha256:3056e61e4cf8ac6e09399b4f0e2bda387cf48a401fffce71b68c9bfa70b7f25b
Status: Downloaded newer image for prom/prometheus:latest

$ docker images | head -n1; docker images | grep prom
REPOSITORY                                      TAG                     IMAGE ID            CREATED             VIRTUAL SIZE
prom/prometheus                                 latest                  dd8ee4d64e43        12 minutes ago      48.6 MB

$ docker run -p 9090:9090 -it prom/prometheus:latest
prometheus, version 0.15.0 (branch: stable, revision: a59b7ac)
  build user:       @bfbdc5abbb9f
  build date:       20150723-20:10:42
  go version:       1.4.2
INFO[0000] Loading configuration file /etc/prometheus/prometheus.yml  file=main.go line=173
INFO[0000] Loading series map and head chunks...         file=storage.go line=263
INFO[0000] 0 series loaded.                              file=storage.go line=268
INFO[0000] Starting target manager...                    file=targetmanager.go line=75
INFO[0000] Listening on :9090                            file=web.go line=186

$ curl -v 'http://localhost:9090/api/v1/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20'; echo
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9090 (#0)
> GET /api/v1/query_range?query=rate(http_request_duration_microseconds_count%5B5m%5D)&start=1437625720.432&end=1437647320.432&step=20 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:9090
> Accept: */*
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
< Access-Control-Allow-Methods: GET
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Date
< Content-Type: application/json
< Date: Thu, 23 Jul 2015 20:24:52 GMT
< Content-Length: 63
< 
* Connection #0 to host localhost left intact
{"status":"success","data":{"resultType":"matrix","result":[]}}

@jimmidyson
Copy link
Contributor

I'd like to see tags for releases as they happen & perhaps keep the latest tag to track master, or keep it pointing at latest release & have develop/canary tag for master? If latest can point to non-backwards compatible versions, this can really affect users when they pull the image down again - I've been a victim of this myself with other projects :(

@juliusv
Copy link
Member

juliusv commented Jul 23, 2015

I opened a different ticket for documenting the release process properly and will close this one: #926

@jimmidyson: currently we have already have two branch->Docker tag relationships:

stable->latest
master->master

How would you ideally like this to behave? (maybe comment on that other issue)

@lock
Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants