Skip to content

Commit

Permalink
Fix/remove dependencies at initialization (#102)
Browse files Browse the repository at this point in the history
* Fixed initialization if not install py-ms[all]
  • Loading branch information
avara1986 committed Mar 23, 2020
1 parent 8a409e8 commit becc1f8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pyms/flask/services/tracer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import logging

import opentracing
try:
import opentracing
except ModuleNotFoundError: # pragma: no cover
opentracing = None
try:
from jaeger_client.metrics.prometheus import PrometheusMetricsFactory
except ModuleNotFoundError: # pragma: no cover
PrometheusMetricsFactory = None
try:
from opentracing_instrumentation import get_current_span
except ModuleNotFoundError: # pragma: no cover
get_current_span = None

from flask import current_app, request, has_request_context
from jaeger_client.metrics.prometheus import PrometheusMetricsFactory
from opentracing_instrumentation import get_current_span

from pyms.config.conf import get_conf
from pyms.constants import LOGGER_NAME
Expand Down

0 comments on commit becc1f8

Please sign in to comment.