vmware-archive / wavefront-django-sdk-python

Apache License 2.0
2 stars 3 forks source link

Deprecated reporters used in examples #13

Open michi88 opened 3 years ago

michi88 commented 3 years ago

It looks like the reporters from the examples are deprecated. What is the recommended approach now? Something like this?

WF_SOURCE = "wavefront-pyformance"

WF_APPLICATION_TAGS = ApplicationTags(
    application="some-app",
    service="some-service"
)
client_factory = WavefrontClientFactory()
client_factory.add_client(
    url=f"https://{WAVEFRONT_TOKEN}@{WAVEFRONT_HOST}",
    max_queue_size=50000,
    batch_size=10000,
    flush_interval_seconds=5
)
wavefront_client = client_factory.get_client()

span_reporter = reporting.WavefrontSpanReporter(
    client=wavefront_client,
    source=WF_SOURCE,
)
OPENTRACING_TRACING = DjangoTracing(WavefrontTracer(reporter=span_reporter, application_tags=WF_APPLICATION_TAGS))
michi88 commented 3 years ago

Also, does the django tracer properly close the reporter upon application exit like described here? https://github.com/wavefrontHQ/wavefront-sdk-python/pull/83/files

michi88 commented 3 years ago

Asking because we see some errors looking like this: Failed to report wavefront data points to wavefront (HTTP -1). Data will be requeued and resent.. However, we do see data of manal spans we create in parts of interest (but no django sdk created spans).

michi88 commented 3 years ago

May be related to the fix here though: https://github.com/wavefrontHQ/wavefront-sdk-python/issues/84

xiaochenw-vmware commented 3 years ago

Thanks for reporting the issues. We created internal tickets to investigate. Regarding the errors like Failed to report wavefront data points to wavefront, can you provide a repo with a minimal django app that produces this issue for us to run locally and reproduce?

michi88 commented 3 years ago

Unfortunately, I cannot test it locally and the codebase is private. We will also investigate further.

michi88 commented 3 years ago

So the reason the middleware was not reporting probably is because we used WF_APPLICATION_TAGS and WF_SOURCE prefixed with WF_, which is not correct as describe in this issue as well: https://github.com/wavefrontHQ/wavefront-django-sdk-python/issues/3. Can only validate if it now works tomorrow.