Skip to main content

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


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

opentracing_prometheus-0.1.5.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

opentracing_prometheus-0.1.5-py2.py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page