{ "info": { "author": "Wavefront by VMware", "author_email": "songhao@vmware.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Wavefront Django SDK\n\nThis 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.\n\n## Install\n\n```bash\npip install wavefront_django_sdk_python\n```\n\n## Usage\n\nConfigure *settings.py* of your application to install Django SDK as follows:\n\n ```python\n# setting.py\n\nfrom wavefront_pyformance.wavefront_reporter import WavefrontDirectReporter, WavefrontProxyReporter\nfrom wavefront_sdk.common import ApplicationTags\nfrom wavefront_django_sdk import DjangoTracing\nfrom wavefront_opentracing_sdk import reporting, WavefrontTracer\n\nINSTALLED_APPS = [\n '...',\n 'wavefront_django_sdk',\n '...'\n]\n \nMIDDLEWARE = [\n 'wavefront_django_sdk.middleware.WavefrontMiddleware',\n '...'\n]\n\nSOURCE = \"{SOURCE}\"\n\nAPPLICATION_TAGS = ApplicationTags(\n application=\"{APP_NAME}\",\n service=\"{SERVICE_NAME}\",\n cluster=\"{CLUSTER_NAME}\", # Optional\n shard=\"{SHARD_NAME},\" , # Optional\n custom_tags={\"location\": \"Oregon\", \"env\": \"Staging\"} # Optional\n)\n\n# Sending data via Direct Ingestion\nWF_REPORTER = WavefrontDirectReporter(\n server=\"{ADDRESS}\",\n token=\"{TOKEN}\",\n reporting_interval=5, # Optional, default value is 10 secs\n source=SOURCE,\n tags={\"application\": APPLICATION_TAGS.application}\n).report_minute_distribution()\n\n# Or, Sending data via Proxy\nWF_REPORTER = WavefrontProxyReporter(\n host=\"{HOST}\",\n port=2878, # Optional, Wavefront Proxy running on 2878 by default\n reporting_interval=5, # Optional, default value is 10 secs\n source=SOURCE,\n tags={\"application\": APPLICATION_TAGS.application}\n).report_minute_distribution()\n\nspan_reporter = reporting.WavefrontSpanReporter(\n client=WF_REPORTER.wavefront_client,\n source=SOURCE,\n)\n\nOPENTRACING_TRACE_ALL = True # Optional, default value is False\n\nOPENTRACING_TRACING = DjangoTracing(WavefrontTracer(\n reporter=span_reporter, application_tags=APPLICATION_TAGS))\n\n ```\n\n## Out of the box metrics and histograms for your Django based application.\n\n Assume you have the following API in your Django Application:\n\n```python\n# urls.py\nfrom django.urls import path\nfrom . import views\n \nurlpatterns = [\n path('style//make', views.make_shirts, name=\"style/{id}/make\")\n]\n \n# view.py\nfrom django.http import HttpResponse\n \ndef make_shirts(request, id):\n return HttpResponse(\"completed\", status=200)\n```\n\n### Request Gauges\n\n| Entity Name | Entity Type | source | application | cluster | service | shard | django.resource.module | django.resource.func |\n| :------------------------------------------------ | :---------- | :----- | :---------- | :-------- | :------ | :------ | :--------------------- | :------------------- |\n| django.request.style._id_.make.GET.inflight.value | Gauge | host-1 | Ordering | us-west-1 | styling | primary | styling.views | make_shirts |\n| django.total_requests.inflight.value | Gauge | host-1 | Ordering | us-west-1 | styling | primary | n/a | n/a |\n\n### Granular Response related metrics\n\n| Entity Name | Entity Type | source | application | cluster | service | shard | django.resource.module | django.resource.func |\n| :----------------------------------------------------------- | :----------- | :----------------- | :---------- | :-------- | :------ | :------ | :--------------------- | :------------------- |\n| django.response.style.\\_id_.make.GET.200.cumulative.count | Counter | host-1 | Ordering | us-west-1 | styling | primary | styling.views | make_shirts |\n| django.response.style.\\_id_.make.GET.200.aggregated_per_shard.count | DeltaCounter | wavefront-provided | Ordering | us-west-1 | styling | primary | styling.views | make_shirts |\n| django.response.style.\\_id_.make.GET.200.aggregated_per_service.count | DeltaCounter | wavefront-provided | Ordering | us-west-1 | styling | n/a | styling.views | make_shirts |\n| django.response.style.\\_id_.make.GET.200.aggregated_per_cluster.count | DeltaCounter | wavefront-provided | Ordering | us-west-1 | n/a | n/a | styling.views | make_shirts |\n| django.response.style.\\_id_.make.GET.200.aggregated_per_application.count | DeltaCounter | wavefront-provided | Ordering | n/a | n/a | n/a | styling.views | make_shirts |\n\n### Granular Response related histograms\n\n| Entity Name | Entity Type | source | application | cluster | service | shard | django.resource.module | django.resource.func |\n| :--------------------------------------------------------- | :----------------- | :----- | :---------- | :-------- | :------ | :------ | :--------------------- | :------------------- |\n| django.response.style.\\_id_.make.summary.GET.200.latency.m | WavefrontHistogram | host-1 | Ordering | us-west-1 | styling | primary | styling.views | make_shirts |\n| django.response.style.\\_id_.make.summary.GET.200.cpu_ns.m | WavefrontHistogram | host-1 | Ordering | us-west-1 | styling | primary | styling.views | make_shirts |\n\n### Overall Response related metrics\n\nThis includes all the completed requests that returned a response (i.e. success + errors).\n\n| Entity Name | Entity Type | source | application | cluster | service | shard |\n| :--------------------------------------------------------- | :----------- | :---------------- | :---------- | :-------- | :------ | :------ |\n| django.response.completed.aggregated_per_source.count | Counter | host-1 | Ordering | us-west-1 | styling | primary |\n| django.response.completed.aggregated_per_shard.count | DeltaCounter | wavefont-provided | Ordering | us-west-1 | styling | primary |\n| django.response.completed.aggregated_per_service.count | DeltaCounter | wavefont-provided | Ordering | us-west-1 | styling | n/a |\n| django.response.completed.aggregated_per_cluster.count | DeltaCounter | wavefont-provided | Ordering | us-west-1 | n/a | n/a |\n| django.response.completed.aggregated_per_application.count | DeltaCounter | wavefont-provided | Ordering | n/a | n/a | n/a |\n\n### Overall Error Response related metrics\n\nThis includes all the completed requests that resulted in an error response (that is HTTP status code of 4xx or 5xx).\n\n| Entity Name | Entity Type | source | application | cluster | service | shard |\n| :------------------------------------------------------ | :----------- | :---------------- | :---------- | :-------- | :------ | :------ |\n| django.response.errors.aggregated_per_source.count | Counter | host-1 | Ordering | us-west-1 | styling | primary |\n| django.response.errors.aggregated_per_shard.count | DeltaCounter | wavefont-provided | Ordering | us-west-1 | styling | primary |\n| django.response.errors.aggregated_per_service.count | DeltaCounter | wavefont-provided | Ordering | us-west-1 | styling | n/a |\n| django.response.errors.aggregated_per_cluster.count | DeltaCounter | wavefont-provided | Ordering | us-west-1 | n/a | n/a |\n| django.response.errors.aggregated_per_application.count | DeltaCounter | wavefont-provided | Ordering | n/a | n/a | n/a |\n\n### Tracing Spans\n\nEvery 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. \n\n| Span Tag Key | Span Tag Value |\n| ---------------------- | ------------------------------------ |\n| traceId | 4a3dc181-d4ac-44bc-848b-133bb3811c31 |\n| parent | q908ddfe-4723-40a6-b1d3-1e85b60d9016 |\n| followsFrom | b768ddfe-4723-40a6-b1d3-1e85b60d9016 |\n| spanId | c908ddfe-4723-40a6-b1d3-1e85b60d9016 |\n| component | django |\n| span.kind | server |\n| application | Ordering |\n| service | styling |\n| cluster | us-west-1 |\n| shard | primary |\n| location | Oregon (*custom tag) |\n| env | Staging (*custom tag) |\n| http.method | GET |\n| http.url | http://{SERVER_ADDR}/style/{id}/make |\n| http.status_code | 502 |\n| error | True |\n| django.resource.func | make_shirts |\n| django.resource.module | styling.views |", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wavefrontHQ/wavefront-django-sdk-python", "keywords": "Wavefront,Wavefront SDK,Django", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "wavefront-django-sdk-python", "package_url": "https://pypi.org/project/wavefront-django-sdk-python/", "platform": "", "project_url": "https://pypi.org/project/wavefront-django-sdk-python/", "project_urls": { "Homepage": "https://github.com/wavefrontHQ/wavefront-django-sdk-python" }, "release_url": "https://pypi.org/project/wavefront-django-sdk-python/1.0/", "requires_dist": null, "requires_python": "", "summary": "Wavefront Django SDK", "version": "1.0" }, "last_serial": 5930364, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "46233adefdb6fe3bb35dcd9f8c47df49", "sha256": "0346ec6e9291e2dca593a8da7ff5b89bd1500b942dc4ef5a6252f4b4a096e083" }, "downloads": -1, "filename": "wavefront-django-sdk-python-1.0.tar.gz", "has_sig": false, "md5_digest": "46233adefdb6fe3bb35dcd9f8c47df49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9426, "upload_time": "2019-10-04T22:08:17", "url": "https://files.pythonhosted.org/packages/2a/e4/64785dc36b7c82bd1795edd74d103eabf387b5265f6f864cb12c1ff6b09f/wavefront-django-sdk-python-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "46233adefdb6fe3bb35dcd9f8c47df49", "sha256": "0346ec6e9291e2dca593a8da7ff5b89bd1500b942dc4ef5a6252f4b4a096e083" }, "downloads": -1, "filename": "wavefront-django-sdk-python-1.0.tar.gz", "has_sig": false, "md5_digest": "46233adefdb6fe3bb35dcd9f8c47df49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9426, "upload_time": "2019-10-04T22:08:17", "url": "https://files.pythonhosted.org/packages/2a/e4/64785dc36b7c82bd1795edd74d103eabf387b5265f6f864cb12c1ff6b09f/wavefront-django-sdk-python-1.0.tar.gz" } ] }