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
Release history Release notifications | RSS feed
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
Hashes for connexion_plus-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1da2a8b7d79e47e264bd77f95ed6faf44acfd9847b444d8a9ea4db765504c26d |
|
MD5 | a870e816e65aa8bba2c7403c7d950b10 |
|
BLAKE2b-256 | 2c51e9eaf04a5fee3cf52c0a510a7a01e7b800a52a068dff91b0d6beb0b6a1fa |