Skip to content

updated README doc.#74

Closed
bugcy013 wants to merge 1 commit intoprometheus:masterfrom
bugcy013:master
Closed

updated README doc.#74
bugcy013 wants to merge 1 commit intoprometheus:masterfrom
bugcy013:master

Conversation

@bugcy013
Copy link
Copy Markdown

@bugcy013 bugcy013 commented Mar 4, 2016

No description provided.

@brian-brazil
Copy link
Copy Markdown
Contributor

@bugcy013
Copy link
Copy Markdown
Author

bugcy013 commented Mar 6, 2016

Hi Brian,

When I tried example program I am getting this exception.

➜  ~ cat dv_Pushgateway.py
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

registry = CollectorRegistry()
g = Gauge('job_last_success_unixtime', 'Last time a batch job successfully
finished', registry=registry)
g.set_to_current_time()
push_to_gateway('172.16.30.233:9091', job='batchA', registry=registry)
➜  ~


➜  ~ python dv_Pushgateway.py
Traceback (most recent call last):
  File "dv_Pushgateway.py", line 6, in <module>
    push_to_gateway('172.16.30.233:9091', job='batchA', registry=registry)
  File
"/usr/local/lib/python2.7/dist-packages/prometheus_client/exposition.py",
line 87, in push_to_gateway
    _use_gateway('PUT', gateway, job, registry, grouping_key, timeout)
  File
"/usr/local/lib/python2.7/dist-packages/prometheus_client/exposition.py",
line 121, in _use_gateway
    resp = build_opener(HTTPHandler).open(request, timeout=timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

After When I include with* /metrics* in gateway url, it's successfully push
metrics to prometheus.

thanks.

-Dhanasekaran.

Did I learn something today? If not, I wasted it.

On Sat, Mar 5, 2016 at 12:52 AM, Brian Brazil [email protected]
wrote:

This is already there, see
https://github.com/prometheus/client_python/blob/master/prometheus_client/exposition.py#L108


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

@brian-brazil
Copy link
Copy Markdown
Contributor

Do you have a reverse proxy or something in the way?

@bugcy013
Copy link
Copy Markdown
Author

bugcy013 commented Mar 6, 2016

No, We don't have any reverse proxy.

I Just download pushgateway and started it. like ./pushgateway

@brian-brazil
Copy link
Copy Markdown
Contributor

I've verified that this works as expected on my system.

Can you run

echo "some_metric 3.14" | curl --data-binary @- http://172.16.30.233:9091/metrics/job/some_job

can confirm it appears on the pushgateway?

@bugcy013
Copy link
Copy Markdown
Author

bugcy013 commented Mar 6, 2016

➜ ~ echo "some_metric 3.14" | curl --data-binary @- http://172.16.30.233:9091/metrics/job/some_job
➜ ~

It's works,
I can see data in pushgateway web page.

screenshot from 2016-03-06 04 36 33

@brian-brazil
Copy link
Copy Markdown
Contributor

Can you confirm which version of the python client and pushgateway you're using?

@bugcy013
Copy link
Copy Markdown
Author

bugcy013 commented Mar 6, 2016

➜ ~ pip2 freeze|grep prometh
prometheus-client==0.0.11
➜ ~
pushgateway version == 0.2.0

screenshot from 2016-03-06 05 04 43

@bugcy013
Copy link
Copy Markdown
Author

bugcy013 commented Mar 6, 2016

Hi brian,

ohh, sorry
Issue with prometheus-client==0.0.11 version alone, I tried it prometheus-client==0.0.13 it's working as excepted.

Sorry I wasted your time.

@brian-brazil
Copy link
Copy Markdown
Contributor

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants