Package: wavefront-django-sdk-python
Wavefront Django SDKThis SDK provides support for reporting out of the box metric, histograms and tracing from your Django based  application. That data is reported to Wavefront via proxy or direct ingestion. That data will help you understand how your application is performing in production.Installpipinstallwavefront_django_sdk_pythonUsageConfiguresettings.pyof your application to install Django SDK as follows:# setting.pyfromwavefront_pyformance.wavefront_reporterimportWavefrontDirectReporter,WavefrontProxyReporterfromwavefront_sdk.commonimportApplicationTagsfromwavefront_django_sdkimportDjangoTracingfromwavefront_opentracing_sdkimportreporting,WavefrontTracerINSTALLED_APPS=['...','wavefront_django_sdk','...']MIDDLEWARE=['wavefront_django_sdk.middleware.WavefrontMiddleware','...']SOURCE="{SOURCE}"APPLICATION_TAGS=ApplicationTags(application="{APP_NAME}",service="{SERVICE_NAME}",cluster="{CLUSTER_NAME}",# Optionalshard="{SHARD_NAME},",# Optionalcustom_tags={"location":"Oregon","env":"Staging"}# Optional)# Sending data via Direct IngestionWF_REPORTER=WavefrontDirectReporter(server="{ADDRESS}",token="{TOKEN}",reporting_interval=5,# Optional, default value is 10 secssource=SOURCE,tags={"application":APPLICATION_TAGS.application}).report_minute_distribution()# Or, Sending data via ProxyWF_REPORTER=WavefrontProxyReporter(host="{HOST}",port=2878,# Optional, Wavefront Proxy running on 2878 by defaultreporting_interval=5,# Optional, default value is 10 secssource=SOURCE,tags={"application":APPLICATION_TAGS.application}).report_minute_distribution()span_reporter=reporting.WavefrontSpanReporter(client=WF_REPORTER.wavefront_client,source=SOURCE,)OPENTRACING_TRACE_ALL=True# Optional, default value is FalseOPENTRACING_TRACING=DjangoTracing(WavefrontTracer(reporter=span_reporter,application_tags=APPLICATION_TAGS))Out of the box metrics and histograms for your Django based application.Assume you have the following API in your Django Application:# urls.pyfromdjango.urlsimportpathfrom.importviewsurlpatterns=[path('style/<slug:id>/make',views.make_shirts,name="style/{id}/make")]# view.pyfromdjango.httpimportHttpResponsedefmake_shirts(request,id):returnHttpResponse("completed",status=200)Request GaugesEntity NameEntity Typesourceapplicationclusterservicesharddjango.resource.moduledjango.resource.funcdjango.request.style.id.make.GET.inflight.valueGaugehost-1Orderingus-west-1stylingprimarystyling.viewsmake_shirtsdjango.total_requests.inflight.valueGaugehost-1Orderingus-west-1stylingprimaryn/an/aGranular Response related metricsEntity NameEntity Typesourceapplicationclusterservicesharddjango.resource.moduledjango.resource.funcdjango.response.style._id_.make.GET.200.cumulative.countCounterhost-1Orderingus-west-1stylingprimarystyling.viewsmake_shirtsdjango.response.style._id_.make.GET.200.aggregated_per_shard.countDeltaCounterwavefront-providedOrderingus-west-1stylingprimarystyling.viewsmake_shirtsdjango.response.style._id_.make.GET.200.aggregated_per_service.countDeltaCounterwavefront-providedOrderingus-west-1stylingn/astyling.viewsmake_shirtsdjango.response.style._id_.make.GET.200.aggregated_per_cluster.countDeltaCounterwavefront-providedOrderingus-west-1n/an/astyling.viewsmake_shirtsdjango.response.style._id_.make.GET.200.aggregated_per_application.countDeltaCounterwavefront-providedOrderingn/an/an/astyling.viewsmake_shirtsGranular Response related histogramsEntity NameEntity Typesourceapplicationclusterservicesharddjango.resource.moduledjango.resource.funcdjango.response.style._id_.make.summary.GET.200.latency.mWavefrontHistogramhost-1Orderingus-west-1stylingprimarystyling.viewsmake_shirtsdjango.response.style._id_.make.summary.GET.200.cpu_ns.mWavefrontHistogramhost-1Orderingus-west-1stylingprimarystyling.viewsmake_shirtsOverall Response related metricsThis includes all the completed requests that returned a response (i.e. success + errors).Entity NameEntity Typesourceapplicationclusterservicesharddjango.response.completed.aggregated_per_source.countCounterhost-1Orderingus-west-1stylingprimarydjango.response.completed.aggregated_per_shard.countDeltaCounterwavefont-providedOrderingus-west-1stylingprimarydjango.response.completed.aggregated_per_service.countDeltaCounterwavefont-providedOrderingus-west-1stylingn/adjango.response.completed.aggregated_per_cluster.countDeltaCounterwavefont-providedOrderingus-west-1n/an/adjango.response.completed.aggregated_per_application.countDeltaCounterwavefont-providedOrderingn/an/an/aOverall Error Response related metricsThis includes all the completed requests that resulted in an error response (that is HTTP status code of 4xx or 5xx).Entity NameEntity Typesourceapplicationclusterservicesharddjango.response.errors.aggregated_per_source.countCounterhost-1Orderingus-west-1stylingprimarydjango.response.errors.aggregated_per_shard.countDeltaCounterwavefont-providedOrderingus-west-1stylingprimarydjango.response.errors.aggregated_per_service.countDeltaCounterwavefont-providedOrderingus-west-1stylingn/adjango.response.errors.aggregated_per_cluster.countDeltaCounterwavefont-providedOrderingus-west-1n/an/adjango.response.errors.aggregated_per_application.countDeltaCounterwavefont-providedOrderingn/an/an/aTracing SpansEvery span will have the operation name as span name, start time in millisec along with duration in millisec. The following table includes all the rest attributes of generated tracing spans.Span Tag KeySpan Tag ValuetraceId4a3dc181-d4ac-44bc-848b-133bb3811c31parentq908ddfe-4723-40a6-b1d3-1e85b60d9016followsFromb768ddfe-4723-40a6-b1d3-1e85b60d9016spanIdc908ddfe-4723-40a6-b1d3-1e85b60d9016componentdjangospan.kindserverapplicationOrderingservicestylingclusterus-west-1shardprimarylocationOregon (*custom tag)envStaging (*custom tag)http.methodGEThttp.urlhttp://{SERVER_ADDR}/style/{id}/makehttp.status_code502errorTruedjango.resource.funcmake_shirtsdjango.resource.modulestyling.views