Skip to main content

Connexion with benefits for microservices

Project description

Connexion with benefits for microservices.

Connexion Plus

If you want to use Connexion for your microservice, you have to add an opentracing or prometheus client on your own. With this library, you instantiate everything before your connexion app starts and this library will take care to put it all together, so you get everything fine.

Importing

import connexion_plus

OpenTracing

Currently it is only supported the opentracing implementation of jaeger-client. If you want to use it, you have to initialize the client before you start your connexion app and give it via the tracer-parameter to the connexion_plus Factory, where the magic happens.

import connexion_plus
from jaeger_client import Config as jConfig

config = jConfig(
        config={
            'logging': True,
        },
    )
jaeger_tracer = config.initialize_tracer()

app = connexion.App(__name__)
connexion_plus.Factory(app, tracer=jaeger_tracer)

Prometheus

Currently, it is only the prometheus-flask-exporter supported for connexion, so only for flask connexion. You only have to set the metrics-parameter to True

import connexion_plus

app = connexion.App(__name__)
connexion_plus.Factory(app, metrics=True)

Example

If you want to use tracer and metrics together, see here a complete example.

import connexion_plus
from jaeger_client import Config as jConfig

config = jConfig(
        config={
            'logging': True,
        },
    )
jaeger_tracer = config.initialize_tracer()

app = connexion.App(__name__)
connexion_plus.Factory(app, tracer=jaeger_tracer, metrics=True)

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

connexion-plus-0.4.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

connexion_plus-0.4-py3-none-any.whl (4.5 kB view hashes)

Uploaded 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