OpenTracing Jaeger and Prometheus integration
Project description
# OpenTracing Prometheus
An integration for opentracing and prometheus.
It exposes the same metrics as jaeger and prometheus for golang.
This package contains a PrometheusReporter and PrometheusMetricsFactory
The reporter is used to report on metrics based on span contents
The factory is used to report on metrics from jaeger itself.
There is also a wsgi middleware that combines all the options.
## Middleware
```python
from flask import Flask, make_response
from opentracing_prometheus import TracerMiddleware
import logging
import sys
app = Flask('prometheus-tracing')
logging.basicConfig(stream=sys.stderr)
log_level = logging.DEBUG
logging.getLogger('').handlers = []
logging.basicConfig(format='%(asctime)s %(message)s', level=log_level)
app.wsgi_app = TracerMiddleware(app)
log = logging.getLogger()
@app.route('/')
def fetch_hello_world():
resp = make_response('Hello, World!')
resp.headers['Content-Type'] = 'text/plain'
return resp
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
```
You can then make a few requests to localhost:5000 and check the metrics at: http://localhost:5000/metrics
An integration for opentracing and prometheus.
It exposes the same metrics as jaeger and prometheus for golang.
This package contains a PrometheusReporter and PrometheusMetricsFactory
The reporter is used to report on metrics based on span contents
The factory is used to report on metrics from jaeger itself.
There is also a wsgi middleware that combines all the options.
## Middleware
```python
from flask import Flask, make_response
from opentracing_prometheus import TracerMiddleware
import logging
import sys
app = Flask('prometheus-tracing')
logging.basicConfig(stream=sys.stderr)
log_level = logging.DEBUG
logging.getLogger('').handlers = []
logging.basicConfig(format='%(asctime)s %(message)s', level=log_level)
app.wsgi_app = TracerMiddleware(app)
log = logging.getLogger()
@app.route('/')
def fetch_hello_world():
resp = make_response('Hello, World!')
resp.headers['Content-Type'] = 'text/plain'
return resp
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
```
You can then make a few requests to localhost:5000 and check the metrics at: http://localhost:5000/metrics
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for opentracing_prometheus-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b581b2a4aa53bc05ec957cfe74afcce99bb8a81b76f6a35268364bf1ace517 |
|
MD5 | 4a68c6a22ac6fd19bf2f8855299511f7 |
|
BLAKE2b-256 | 65d2c68fc19fdbc53864aad8db4a50e524d3ad028fe62c5fcb011d64efe39f8e |
Close
Hashes for opentracing_prometheus-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62dc7631969dbbf3f8571e7e71284a6b9fbebf85cf66f96ccc1896bc067ccc8e |
|
MD5 | 48be675f4118e5c40580b59b323845bd |
|
BLAKE2b-256 | d5f0772e619fb4f67faa0c583f1a24dfbea1c08dd9e1207dba5f03b8f87193a2 |