diff --git a/demo-app/Dockerfile b/demo-app/Dockerfile index 611086c..2678cff 100644 --- a/demo-app/Dockerfile +++ b/demo-app/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3.8.0b1-stretch +FROM python:3.8.2-buster RUN apt-get update \ && apt-get clean \ diff --git a/demo-app/app.py b/demo-app/app.py index 53d53d6..90ba7b0 100644 --- a/demo-app/app.py +++ b/demo-app/app.py @@ -20,11 +20,12 @@ from flask import Flask, render_template, request from opencensus.trace import execution_context -from opencensus.trace.exporters import stackdriver_exporter -from opencensus.trace.exporters.transports import background_thread -from opencensus.trace.ext.flask.flask_middleware import FlaskMiddleware +from opencensus.common.transports.async_ import AsyncTransport +from opencensus.ext.stackdriver import trace_exporter as stackdriver_exporter +from opencensus.ext.flask.flask_middleware import FlaskMiddleware from opencensus.trace.propagation import google_cloud_format -from opencensus.trace.samplers import always_on +from opencensus.trace import samplers + app = Flask(__name__) @@ -32,9 +33,10 @@ # Configure Tracing exporter = stackdriver_exporter.StackdriverExporter( - transport=background_thread.BackgroundThreadTransport) + transport=AsyncTransport) + propagator = google_cloud_format.GoogleCloudFormatPropagator() -sampler = always_on.AlwaysOnSampler() +sampler = samplers.AlwaysOnSampler() blacklist_paths = ['favicon.ico'] # Instrument Flask to do tracing automatically diff --git a/demo-app/requirements.txt b/demo-app/requirements.txt index 25cd3a4..3e08242 100644 --- a/demo-app/requirements.txt +++ b/demo-app/requirements.txt @@ -1,6 +1,7 @@ google-cloud-monitoring==0.31.1 google-cloud-pubsub==0.42.1 google-cloud-trace==0.21.0 -gunicorn==19.9.0 -opencensus==0.6.0 +gunicorn==20.0.4 +opencensus-ext-stackdriver==0.7.2 +opencensus-ext-flask==0.7.3 Flask==1.1.1