prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Author a full getting started guide
  As part of the final beta announce on March 30th, we should have a full getting started guide, similar to this one for js:
  
  https://github.com/open-telemetry/opentelemetry-js/blob/master/getting-started/README.md
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `docs/trace_example.py`
  Content:
  ```
  1 from opentelemetry import trace
  2 from opentelemetry.sdk.trace import TracerProvider
  3 from opentelemetry.sdk.trace.export import (
  4     ConsoleSpanExporter,
  5     SimpleExportSpanProcessor,
  6 )
  7 
  8 trace.set_preferred_tracer_provider_implementation(lambda T: TracerProvider())
  9 trace.tracer_provider().add_span_processor(
  10     SimpleExportSpanProcessor(ConsoleSpanExporter())
  11 )
  12 
  13 tracer = trace.get_tracer(__name__)
  14 
  15 with tracer.start_as_current_span("foo"):
  16     with tracer.start_as_current_span("bar"):
  17         with tracer.start_as_current_span("baz"):
  18             print("Hello world from OpenTelemetry Python!")
  19
  ```
  
  Path: `docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py`
  Content:
  ```
  1 # Copyright 2019, OpenTelemetry Authors
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 #
  15 """
  16 This module serves as an example to integrate with flask, using
  17 the requests library to perform downstream requests
  18 """
  19 import flask
  20 import pkg_resources
  21 import requests
  22 
  23 import opentelemetry.ext.http_requests
  24 from opentelemetry import trace
  25 from opentelemetry.ext.flask import instrument_app
  26 from opentelemetry.sdk.trace import TracerProvider
  27 
  28 
  29 def configure_opentelemetry(flask_app: flask.Flask):
  30     """Configure a flask application to use OpenTelemetry.
  31 
  32     This activates the specific components:
  33 
  34     * sets tracer to the SDK's Tracer
  35     * enables requests integration on the Tracer
  36     * uses a WSGI middleware to enable configuration
  37     """
  38     # Start by configuring all objects required to ensure a complete end to end
  39     # workflow.
  40     trace.set_tracer_provider(TracerProvider())
  41 
  42     # Next, we need to configure how the values that are used by traces and
  43     # metrics are propagated (such as what specific headers carry this value).
  44     # Integrations are the glue that binds the OpenTelemetry API and the
  45     # frameworks and libraries that are used together, automatically creating
  46     # Spans and propagating context as appropriate.
  47     opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())
  48     instrument_app(flask_app)
  49 
  50 
  51 app = flask.Flask(__name__)
  52 
  53 
  54 @app.route("/")
  55 def hello():
  56     # Emit a trace that measures how long the sleep takes
  57     version = pkg_resources.get_distribution(
  58         "opentelemetry-example-app"
  59     ).version
  60     tracer = trace.get_tracer(__name__, version)
  61     with tracer.start_as_current_span("example-request"):
  62         requests.get("http://www.example.com")
  63     return "hello"
  64 
  65 
  66 configure_opentelemetry(app)
  67
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py b/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py
  --- a/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py
  +++ b/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py
  @@ -17,50 +17,31 @@
   the requests library to perform downstream requests
   """
   import flask
  -import pkg_resources
   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
   
  -
  -def configure_opentelemetry(flask_app: flask.Flask):
  -    """Configure a flask application to use OpenTelemetry.
  -
  -    This activates the specific components:
  -
  -    * sets tracer to the SDK's Tracer
  -    * enables requests integration on the Tracer
  -    * uses a WSGI middleware to enable configuration
  -    """
  -    # Start by configuring all objects required to ensure a complete end to end
  -    # workflow.
  -    trace.set_tracer_provider(TracerProvider())
  -
  -    # Next, we need to configure how the values that are used by traces and
  -    # metrics are propagated (such as what specific headers carry this value).
  -    # Integrations are the glue that binds the OpenTelemetry API and the
  -    # frameworks and libraries that are used together, automatically creating
  -    # Spans and propagating context as appropriate.
  -    opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())
  -    instrument_app(flask_app)
  -
  +trace.set_tracer_provider(TracerProvider())
  +trace.get_tracer_provider().add_span_processor(
  +    SimpleExportSpanProcessor(ConsoleSpanExporter())
  +)
   
   app = flask.Flask(__name__)
  +opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())
  +instrument_app(app)
   
   
   @app.route("/")
   def hello():
  -    # Emit a trace that measures how long the sleep takes
  -    version = pkg_resources.get_distribution(
  -        "opentelemetry-example-app"
  -    ).version
  -    tracer = trace.get_tracer(__name__, version)
  +    tracer = trace.get_tracer(__name__)
       with tracer.start_as_current_span("example-request"):
           requests.get("http://www.example.com")
       return "hello"
   
   
  -configure_opentelemetry(app)
  +app.run(debug=True)
  diff --git a/docs/trace_example.py b/docs/trace_example.py
  --- a/docs/trace_example.py
  +++ b/docs/trace_example.py
  @@ -5,8 +5,8 @@
       SimpleExportSpanProcessor,
   )
   
  -trace.set_preferred_tracer_provider_implementation(lambda T: TracerProvider())
  -trace.tracer_provider().add_span_processor(
  +trace.set_tracer_provider(TracerProvider())
  +trace.get_tracer_provider().add_span_processor(
       SimpleExportSpanProcessor(ConsoleSpanExporter())
   )
  
verification_info: {"golden_diff": "diff --git a/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py b/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py\n--- a/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py\n+++ b/docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py\n@@ -17,50 +17,31 @@\n the requests library to perform downstream requests\n \"\"\"\n import flask\n-import pkg_resources\n import requests\n \n import opentelemetry.ext.http_requests\n from opentelemetry import trace\n from opentelemetry.ext.flask import instrument_app\n from opentelemetry.sdk.trace import TracerProvider\n+from opentelemetry.sdk.trace.export import ConsoleSpanExporter\n+from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor\n \n-\n-def configure_opentelemetry(flask_app: flask.Flask):\n-    \"\"\"Configure a flask application to use OpenTelemetry.\n-\n-    This activates the specific components:\n-\n-    * sets tracer to the SDK's Tracer\n-    * enables requests integration on the Tracer\n-    * uses a WSGI middleware to enable configuration\n-    \"\"\"\n-    # Start by configuring all objects required to ensure a complete end to end\n-    # workflow.\n-    trace.set_tracer_provider(TracerProvider())\n-\n-    # Next, we need to configure how the values that are used by traces and\n-    # metrics are propagated (such as what specific headers carry this value).\n-    # Integrations are the glue that binds the OpenTelemetry API and the\n-    # frameworks and libraries that are used together, automatically creating\n-    # Spans and propagating context as appropriate.\n-    opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())\n-    instrument_app(flask_app)\n-\n+trace.set_tracer_provider(TracerProvider())\n+trace.get_tracer_provider().add_span_processor(\n+    SimpleExportSpanProcessor(ConsoleSpanExporter())\n+)\n \n app = flask.Flask(__name__)\n+opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())\n+instrument_app(app)\n \n \n @app.route(\"/\")\n def hello():\n-    # Emit a trace that measures how long the sleep takes\n-    version = pkg_resources.get_distribution(\n-        \"opentelemetry-example-app\"\n-    ).version\n-    tracer = trace.get_tracer(__name__, version)\n+    tracer = trace.get_tracer(__name__)\n     with tracer.start_as_current_span(\"example-request\"):\n         requests.get(\"http://www.example.com\")\n     return \"hello\"\n \n \n-configure_opentelemetry(app)\n+app.run(debug=True)\ndiff --git a/docs/trace_example.py b/docs/trace_example.py\n--- a/docs/trace_example.py\n+++ b/docs/trace_example.py\n@@ -5,8 +5,8 @@\n     SimpleExportSpanProcessor,\n )\n \n-trace.set_preferred_tracer_provider_implementation(lambda T: TracerProvider())\n-trace.tracer_provider().add_span_processor(\n+trace.set_tracer_provider(TracerProvider())\n+trace.get_tracer_provider().add_span_processor(\n     SimpleExportSpanProcessor(ConsoleSpanExporter())\n )\n", "issue": "Author a full getting started guide\nAs part of the final beta announce on March 30th, we should have a full getting started guide, similar to this one for js:\r\n\r\nhttps://github.com/open-telemetry/opentelemetry-js/blob/master/getting-started/README.md\r\n\r\n\n", "before_files": [{"content": "from opentelemetry import trace\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import (\n    ConsoleSpanExporter,\n    SimpleExportSpanProcessor,\n)\n\ntrace.set_preferred_tracer_provider_implementation(lambda T: TracerProvider())\ntrace.tracer_provider().add_span_processor(\n    SimpleExportSpanProcessor(ConsoleSpanExporter())\n)\n\ntracer = trace.get_tracer(__name__)\n\nwith tracer.start_as_current_span(\"foo\"):\n    with tracer.start_as_current_span(\"bar\"):\n        with tracer.start_as_current_span(\"baz\"):\n            print(\"Hello world from OpenTelemetry Python!\")\n", "path": "docs/trace_example.py"}, {"content": "# Copyright 2019, OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\"\"\"\nThis module serves as an example to integrate with flask, using\nthe requests library to perform downstream requests\n\"\"\"\nimport flask\nimport pkg_resources\nimport requests\n\nimport opentelemetry.ext.http_requests\nfrom opentelemetry import trace\nfrom opentelemetry.ext.flask import instrument_app\nfrom opentelemetry.sdk.trace import TracerProvider\n\n\ndef configure_opentelemetry(flask_app: flask.Flask):\n    \"\"\"Configure a flask application to use OpenTelemetry.\n\n    This activates the specific components:\n\n    * sets tracer to the SDK's Tracer\n    * enables requests integration on the Tracer\n    * uses a WSGI middleware to enable configuration\n    \"\"\"\n    # Start by configuring all objects required to ensure a complete end to end\n    # workflow.\n    trace.set_tracer_provider(TracerProvider())\n\n    # Next, we need to configure how the values that are used by traces and\n    # metrics are propagated (such as what specific headers carry this value).\n    # Integrations are the glue that binds the OpenTelemetry API and the\n    # frameworks and libraries that are used together, automatically creating\n    # Spans and propagating context as appropriate.\n    opentelemetry.ext.http_requests.enable(trace.get_tracer_provider())\n    instrument_app(flask_app)\n\n\napp = flask.Flask(__name__)\n\n\n@app.route(\"/\")\ndef hello():\n    # Emit a trace that measures how long the sleep takes\n    version = pkg_resources.get_distribution(\n        \"opentelemetry-example-app\"\n    ).version\n    tracer = trace.get_tracer(__name__, version)\n    with tracer.start_as_current_span(\"example-request\"):\n        requests.get(\"http://www.example.com\")\n    return \"hello\"\n\n\nconfigure_opentelemetry(app)\n", "path": "docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py"}], "after_files": [{"content": "from opentelemetry import trace\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import (\n    ConsoleSpanExporter,\n    SimpleExportSpanProcessor,\n)\n\ntrace.set_tracer_provider(TracerProvider())\ntrace.get_tracer_provider().add_span_processor(\n    SimpleExportSpanProcessor(ConsoleSpanExporter())\n)\n\ntracer = trace.get_tracer(__name__)\n\nwith tracer.start_as_current_span(\"foo\"):\n    with tracer.start_as_current_span(\"bar\"):\n        with tracer.start_as_current_span(\"baz\"):\n            print(\"Hello world from OpenTelemetry Python!\")\n", "path": "docs/trace_example.py"}, {"content": "# Copyright 2019, OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\"\"\"\nThis module serves as an example to integrate with flask, using\nthe requests library to perform downstream requests\n\"\"\"\nimport flask\nimport requests\n\nimport opentelemetry.ext.http_requests\nfrom opentelemetry import trace\nfrom opentelemetry.ext.flask import instrument_app\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import ConsoleSpanExporter\nfrom opentelemetry.sdk.trace.export import SimpleExportSpanProcessor\n\ntrace.set_tracer_provider(TracerProvider())\ntrace.get_tracer_provider().add_span_processor(\n    SimpleExportSpanProcessor(ConsoleSpanExporter())\n)\n\napp = flask.Flask(__name__)\nopentelemetry.ext.http_requests.enable(trace.get_tracer_provider())\ninstrument_app(app)\n\n\n@app.route(\"/\")\ndef hello():\n    tracer = trace.get_tracer(__name__)\n    with tracer.start_as_current_span(\"example-request\"):\n        requests.get(\"http://www.example.com\")\n    return \"hello\"\n\n\napp.run(debug=True)\n", "path": "docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py"}]}