Metadata-Version: 2.0
Name: opentracing-prometheus
Version: 0.1.5
Summary: OpenTracing Jaeger and Prometheus integration
Home-page: https://github.com/casualjim/python-opentracing-prometheus
Author: Ivan Porto Carrero
Author-email: UNKNOWN
License: MIT
Description-Content-Type: text/markdown
Keywords: opentracing jaeger prometheus
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: System :: Monitoring
Requires-Dist: opentracing-instrumentation
Requires-Dist: jaeger-client
Requires-Dist: prometheus-client

# 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


