Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of setting up tracer without lightstep? #17

Open
viperfx opened this issue Jan 17, 2018 · 7 comments
Open

Example of setting up tracer without lightstep? #17

viperfx opened this issue Jan 17, 2018 · 7 comments

Comments

@viperfx
Copy link

viperfx commented Jan 17, 2018

How do I configure a trace and connect it to a local docker container let's say, exposed at localhost.

How would I change settings.py to connect to the default Jaeger docker image?

@elnappo
Copy link

elnappo commented Mar 7, 2018

I could not confirm this because I'm using python3 only but this could work in settings.py for localhost:

def initialize_tracer():
  config = Config(
      config={
          'sampler': {'type': 'const', 'param': 1}
      },
      service_name='hello-world')
  return config.initialize_tracer()

OPENTRACING_TRACE_ALL = True 
OPENTRACING_TRACED_ATTRIBUTES = ['META']

OPENTRACING_TRACER = django_opentracing.DjangoTracer(initialize_tracer())

@SEJeff
Copy link

SEJeff commented Apr 24, 2018

First, setup the all in one jaeger docker container. Then update your settings to look like this. The key is adding django_opentracing.OpenTracingMiddleware to MIDDLEWARE_CLASSES and the OPENTRACING_* settings.

Confirmed working.

@ror6ax
Copy link

ror6ax commented May 15, 2018

I think adding separate example using Jaeger to mirror flask examples would be beneficial.

@spybdai
Copy link

spybdai commented Dec 27, 2018

I think adding separate example using Jaeger to mirror flask examples would be beneficial.

Yes, think this should be more helpful.

@spybdai
Copy link

spybdai commented Dec 28, 2018

First, setup the all in one jaeger docker container. Then update your settings to look like this. The key is adding django_opentracing.OpenTracingMiddleware to MIDDLEWARE_CLASSES and the OPENTRACING_* settings.

Confirmed working.

Hi guys, the latest version of django_opentracing requires version of opentracing >= 2.0, while the latest version of jaeger-client-python requires version of opentracing < 2,

How should make them work together?

I know django_opentracing version 0.1.20 works with opentracing version < 2.0, but there are some obvious features which are absent comparing with the latest version.

@bj00rn
Copy link

bj00rn commented Jun 26, 2019

Hi guys, the latest version of django_opentracing requires version of opentracing >= 2.0, while the latest version of jaeger-client-python requires version of opentracing < 2

dependency issue was apparently fixed in 1.1.0 ef50385

@bj00rn
Copy link

bj00rn commented Jun 26, 2019

First, setup the all in one jaeger docker container. Then update your settings to look like this. The key is adding django_opentracing.OpenTracingMiddleware to MIDDLEWARE_CLASSES and the OPENTRACING_* settings.

Confirmed working.

How about OPENTRACING_TRACING setting?

I wan't to do

views.py

from django.conf import settings

tracing = settings.OPENTRACING_TRACING

@tracing.trace(optional_args)
def some_view_func(request):
    ... # do some stuff

from docs:

# some_opentracing_tracer can be any valid OpenTracing tracer implementation
OPENTRACING_TRACING = django_opentracing.DjangoTracing(some_opentracing_tracer)

sorry for partial repost of #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants