# Path: osprofiler/web.py
# _REQUIRED_KEYS = ("base_id", "hmac_key")
# _OPTIONAL_KEYS = ("parent_id",)
# X_TRACE_INFO = "X-Trace-Info"
# X_TRACE_HMAC = "X-Trace-HMAC"
# _ENABLED = None
# _HMAC_KEYS = None
#     _ENABLED = False
#     _ENABLED = True
#     _HMAC_KEYS = utils.split(hmac_keys or "")
# def get_trace_id_headers():
# def disable():
# def enable(hmac_keys=None):
#     def __init__(self, application, hmac_keys=None, enabled=False, **kwargs):
#     def factory(cls, global_conf, **local_conf):
#         def filter_(app):
#     def _trace_is_valid(self, trace_info):
#     def __call__(self, request):
# class WsgiMiddleware(object):


from oslo_config import cfg
from osprofiler import web
                         group=_profiler_opt_group.name)

    if sentinel_service_name is not None:
        conf.set_default("sentinel_service_name", sentinel_service_name,
                         group=_profiler_opt_group.name)


def is_trace_enabled(conf=None):
    if conf is None:
        conf = cfg.CONF
    return conf.profiler.enabled


def is_db_trace_enabled(conf=None):
    if conf is None:
        conf = cfg.CONF
    return conf.profiler.enabled and conf.profiler.trace_sqlalchemy


def enable_web_trace(conf=None):
    if conf is None:
        conf = cfg.CONF
    if conf.profiler.enabled:
        web.enable(conf.profiler.hmac_keys)


def disable_web_trace(conf=None):
    if conf is None:
        conf = cfg.CONF
    if conf.profiler.enabled:

# Path: osprofiler/web.py
# _REQUIRED_KEYS = ("base_id", "hmac_key")
# _OPTIONAL_KEYS = ("parent_id",)
# X_TRACE_INFO = "X-Trace-Info"
# X_TRACE_HMAC = "X-Trace-HMAC"
# _ENABLED = None
# _HMAC_KEYS = None
#     _ENABLED = False
#     _ENABLED = True
#     _HMAC_KEYS = utils.split(hmac_keys or "")
# def get_trace_id_headers():
# def disable():
# def enable(hmac_keys=None):
#     def __init__(self, application, hmac_keys=None, enabled=False, **kwargs):
#     def factory(cls, global_conf, **local_conf):
#         def filter_(app):
#     def _trace_is_valid(self, trace_info):
#     def __call__(self, request):
# class WsgiMiddleware(object):


# Path: osprofiler/opts.py
from oslo_config import cfg
from osprofiler import web

                         group=_profiler_opt_group.name)

    if sentinel_service_name is not None:
        conf.set_default("sentinel_service_name", sentinel_service_name,
                         group=_profiler_opt_group.name)


def is_trace_enabled(conf=None):
    if conf is None:
        conf = cfg.CONF
    return conf.profiler.enabled


def is_db_trace_enabled(conf=None):
    if conf is None:
        conf = cfg.CONF
    return conf.profiler.enabled and conf.profiler.trace_sqlalchemy


def enable_web_trace(conf=None):
    if conf is None:
        conf = cfg.CONF
    if conf.profiler.enabled:
        web.enable(conf.profiler.hmac_keys)


def disable_web_trace(conf=None):
    if conf is None:
        conf = cfg.CONF
    if conf.profiler.enabled:

        web.disable()