Skip to content

Commit

Permalink
Fix example in documentation (open-telemetry#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl authored Apr 8, 2020
1 parent b3e4f3c commit 91cdfe7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ And let's write a small Flask application that sends an HTTP request, activating
.. code-block:: python
# flask_example.py
from opentelemetry.ext.flask import FlaskInstrumentor
FlaskInstrumentor().instrument() # This needs to be executed before importing Flask
import flask
import requests
import opentelemetry.ext.http_requests
from opentelemetry import trace
from opentelemetry.ext.flask import instrument_app
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor
Expand All @@ -201,7 +203,6 @@ And let's write a small Flask application that sends an HTTP request, activating
app = flask.Flask(__name__)
opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())
instrument_app(app)
@app.route("/")
def hello():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
.. code-block:: python
from opentelemetry.ext.flask import FlaskInstrumentor
FlaskInstrumentor().instrument() # This needs to be executed before importing Flask
from flask import Flask
from opentelemetry.ext.flask import instrument_app
app = Flask(__name__)
instrument_app(app) # This is where the magic happens. ✨
@app.route("/")
def hello():
Expand Down

0 comments on commit 91cdfe7

Please sign in to comment.