Skip to content

Commit

Permalink
fix: update versions and fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
avara1986 committed May 25, 2024
1 parent 7c1e709 commit 1539e05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
9 changes: 2 additions & 7 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ confidence=
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=logging-format-interpolation,broad-except,unnecessary-pass,no-member,line-too-long,invalid-name,
missing-module-docstring,missing-class-docstring,missing-function-docstring,too-few-public-methods
missing-module-docstring,missing-class-docstring,missing-function-docstring,too-few-public-methods,
consider-using-f-string,deprecated-class,unnecessary-dunder-call,deprecated-module

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -256,12 +257,6 @@ max-line-length=120
# Maximum number of lines in a module
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
Expand Down
2 changes: 1 addition & 1 deletion pyms/flask/services/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FlaskMetricsWrapper:
def __init__(self, app_name):
self.app_name = app_name

def before_request(self) -> None: # pylint: disable=R0201
def before_request(self) -> None:
request.start_time = time.time() # pylint: disable=assigning-non-slot

def after_request(self, response: Response) -> Response:
Expand Down
13 changes: 6 additions & 7 deletions pyms/flask/services/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

from flask import current_app, has_request_context, request

from pyms.config.conf import get_conf
from pyms.constants import LOGGER_NAME
from pyms.flask.services.driver import DriverService, get_service_name
from pyms.flask.services.driver import DriverService
from pyms.utils import check_package_exists, import_from, import_package

opentracing = None
Expand All @@ -32,7 +31,7 @@ def inject_span_in_headers(headers: dict) -> dict:
if tracer:
span = tracer.get_span(request=request)
if not span: # pragma: no cover
span = get_current_span()
span = get_current_span
if not span:
span = tracer.tracer.start_span()
context = span.context if span else None
Expand Down Expand Up @@ -78,11 +77,11 @@ def init_jaeger_tracer(self):
host = {}
if self.host:
host = {"local_agent": {"reporting_host": self.host}}
metrics_config = get_conf(service=get_service_name(service="metrics"), empty_init=True)
# metrics_config = get_conf(service=get_service_name(service="metrics"), empty_init=True)
metrics = ""
if metrics_config:
service_name = self.component_name.lower().replace("-", "_").replace(" ", "_")
metrics = PrometheusMetricsFactory(service_name_label=service_name)
# if metrics_config:
# service_name = self.component_name.lower().replace("-", "_").replace(" ", "_")
# metrics = PrometheusMetricsFactory(service_name_label=service_name)
config = Config(
config={
**{
Expand Down

0 comments on commit 1539e05

Please sign in to comment.