Package: wavefront-flask-sdk-python
Wavefront Flask SDKThis SDK provides support for reporting out of the box metric, histograms and tracing from your Flask 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_flask_sdk_pythonUsageConfigure your Flask application to install the SDK as follows:fromwavefront_sdk.commonimportApplicationTagsfromwavefront_opentracing_sdkimportWavefrontTracerfromwavefront_opentracing_sdk.reportingimportWavefrontSpanReporterfromwavefront_pyformance.wavefront_reporterimportWavefrontDirectReporterfromwavefront_flask_sdk.flask_tracingimportFlaskTracingfromflaskimportFlaskif__name__=='__main__':app=Flask(__name__)source='{SOURCE}'application_tags=ApplicationTags(application="{APP_NAME}",service="{SERVICE_NAME}",cluster="{CLUSTER_NAME}",# Optionalshard="{SHARD_NAME},",# Optionalcustom_tags=[("{KEY}","{VAL}")]# Optional)wf_reporter=WavefrontDirectReporter(server="{SERV_ADDR}",token="{TOKEN}",source=source).report_minute_distribution()span_reporter=WavefrontSpanReporter(wf_reporter.wavefront_client,source=source)tracer=WavefrontTracer(span_reporter,application_tags)tracing=FlaskTracing(tracer=tracer,reporter=wf_reporter,application_tags=application_tags,app=app)app.run(host='0.0.0.0',port=8080)Out of the box metrics and histograms for your Flask based application.Assume you have the following API in your Flask Application:@app.route('/style/<path:id>/make')defmake_shirts(id):return"Shirts{}made.".format(id)Request GaugesEntity NameEntity Typesourceapplicationclusterserviceshardflask.funcflask.request.style.path:id.make.GET.inflight.valueGaugehost-1Orderingus-west-1stylingprimarymake_shirtsflask.total_requests.inflight.valueGaugehost-1Orderingus-west-1stylingprimaryn/aGranular Response related metricsEntity NameEntity Typesourceapplicationclusterserviceshardflask.funcflask.response.style.path:id.make.GET.200.cumulative.countCounterhost-1Orderingus-west-1stylingprimarymake_shirtsflask.response.style.path:id.make.GET.200.aggregated_per_shard.countDeltaCounterwavefront-providedOrderingus-west-1stylingprimarymake_shirtsflask.response.style.path:id.make.GET.200.aggregated_per_service.countDeltaCounterwavefront-providedOrderingus-west-1stylingn/amake_shirtsflask.response.style.path:id.make.GET.200.aggregated_per_cluster.countDeltaCounterwavefront-providedOrderingus-west-1n/an/amake_shirtsflask.response.style.path:id.make.GET.200.aggregated_per_application.countDeltaCounterwavefront-providedOrderingn/an/an/amake_shirtsGranular Response related histogramsEntity NameEntity Typesourceapplicationclusterserviceshardflask.funcflask.response.style.path:id.make.summary.GET.200.latency.mWavefrontHistogramhost-1Orderingus-west-1stylingprimarymake_shirtsflask.response.style.path:id.make.summary.GET.200.cpu_ns.mWavefrontHistogramhost-1Orderingus-west-1stylingprimarymake_shirtsOverall Response related metricsThis includes all the completed requests that returned a response (i.e. success + errors).Entity NameEntity Typesourceapplicationclusterserviceshardflask.response.completed.aggregated_per_source.countCounterhost-1Orderingus-west-1stylingprimaryflask.response.completed.aggregated_per_shard.countDeltaCounterwavefont-providedOrderingus-west-1stylingprimaryflask.response.completed.aggregated_per_service.countDeltaCounterwavefont-providedOrderingus-west-1stylingn/aflask.response.completed.aggregated_per_cluster.countDeltaCounterwavefont-providedOrderingus-west-1n/an/aflask.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 Typesourceapplicationclusterserviceshardflask.response.errors.aggregated_per_source.countCounterhost-1Orderingus-west-1stylingprimaryflask.response.errors.aggregated_per_shard.countDeltaCounterwavefont-providedOrderingus-west-1stylingprimaryflask.response.errors.aggregated_per_service.countDeltaCounterwavefont-providedOrderingus-west-1stylingn/aflask.response.errors.aggregated_per_cluster.countDeltaCounterwavefont-providedOrderingus-west-1n/an/aflask.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-1e85b60d9016componentflaskspan.kindserverapplicationOrderingservicestylingclusterus-west-1shardprimarylocationOregon (*custom tag)envStaging (*custom tag)http.methodGEThttp.urlhttp://{SERVER_ADDR}/style/{id}/makehttp.status_code502errortrueflask.funcmake_shirts