-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Scratching my head over how to use this library with a Tracer client (jaeger) inside my views
Do i need to explicitly set OPENTRACING_TRACING in settings.py?
Getting the following error on startup
AttributeError: 'Settings' object has no attribute 'OPENTRACING_TRACING'
settings.py
# default tracer is opentracing.Tracer(), which does nothing
OPENTRACING_TRACER_CALLABLE = __name__ + '.tracer'
def tracer():
from jaeger_client import Config
config = Config(
config={
'sampler': {
'type': 'const',
'param': 1,
},
'local_agent': {
'reporting_host': os.environ.get('JAEGER_HOST', "localhost"),
'reporting_port': os.environ.get('JAEGER_PORT', 6831),
},
'logging': True,
},
service_name='-'.join([os.environ.get('JAEGER_SERVICE_NAME', ''), 'api']))
return config.initialize_tracer()
# default is False
OPENTRACING_TRACE_ALL = True
# default is []
OPENTRACING_TRACED_ATTRIBUTES = ['META']
views.py
from django.conf import settings
tracing = settings.OPENTRACING_TRACING
@tracing.trace(optional_args)
def some_view_func(request):
... # do some stuff
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels