prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  KeyError: 'split_by_domain' 
  ```
    File "/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/requests/sessions.py", line 581, in post
      return self.request('POST', url, data=data, json=json, **kwargs)
    File "/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
      resp = self.send(prep, **send_kwargs)
    File "/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/ddtrace/contrib/requests/connection.py", line 73, in _wrap_send
      span.service = _extract_service_name(instance, span, hostname=hostname)
    File "/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/ddtrace/contrib/requests/connection.py", line 30, in _extract_service_name
      if cfg['split_by_domain'] and hostname:
  KeyError: 'split_by_domain'
  ```
  
  Happens on python 3.6 and 3.7
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `ddtrace/contrib/requests/session.py`
  Content:
  ```
  1 import requests
  2 
  3 from ddtrace.vendor.wrapt import wrap_function_wrapper as _w
  4 
  5 from .connection import _wrap_send
  6 
  7 
  8 class TracedSession(requests.Session):
  9     """TracedSession is a requests' Session that is already traced.
  10     You can use it if you want a finer grained control for your
  11     HTTP clients.
  12     """
  13 
  14     pass
  15 
  16 
  17 # always patch our `TracedSession` when imported
  18 _w(TracedSession, "send", _wrap_send)
  19
  ```
  --- 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/ddtrace/contrib/requests/session.py b/ddtrace/contrib/requests/session.py
  --- a/ddtrace/contrib/requests/session.py
  +++ b/ddtrace/contrib/requests/session.py
  @@ -2,6 +2,8 @@
   
   from ddtrace.vendor.wrapt import wrap_function_wrapper as _w
   
  +from ddtrace import config, Pin
  +
   from .connection import _wrap_send
   
   
  @@ -16,3 +18,4 @@
   
   # always patch our `TracedSession` when imported
   _w(TracedSession, "send", _wrap_send)
  +Pin(_config=config.requests).onto(TracedSession)
  
verification_info: {"golden_diff": "diff --git a/ddtrace/contrib/requests/session.py b/ddtrace/contrib/requests/session.py\n--- a/ddtrace/contrib/requests/session.py\n+++ b/ddtrace/contrib/requests/session.py\n@@ -2,6 +2,8 @@\n \n from ddtrace.vendor.wrapt import wrap_function_wrapper as _w\n \n+from ddtrace import config, Pin\n+\n from .connection import _wrap_send\n \n \n@@ -16,3 +18,4 @@\n \n # always patch our `TracedSession` when imported\n _w(TracedSession, \"send\", _wrap_send)\n+Pin(_config=config.requests).onto(TracedSession)\n", "issue": "KeyError: 'split_by_domain' \n```\r\n  File \"/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/requests/sessions.py\", line 581, in post\r\n    return self.request('POST', url, data=data, json=json, **kwargs)\r\n  File \"/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/requests/sessions.py\", line 533, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \"/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/ddtrace/contrib/requests/connection.py\", line 73, in _wrap_send\r\n    span.service = _extract_service_name(instance, span, hostname=hostname)\r\n  File \"/Users/viperfx/.pyenv/versions/scrumgenius-env-3.6/lib/python3.6/site-packages/ddtrace/contrib/requests/connection.py\", line 30, in _extract_service_name\r\n    if cfg['split_by_domain'] and hostname:\r\nKeyError: 'split_by_domain'\r\n```\r\n\r\nHappens on python 3.6 and 3.7\n", "before_files": [{"content": "import requests\n\nfrom ddtrace.vendor.wrapt import wrap_function_wrapper as _w\n\nfrom .connection import _wrap_send\n\n\nclass TracedSession(requests.Session):\n    \"\"\"TracedSession is a requests' Session that is already traced.\n    You can use it if you want a finer grained control for your\n    HTTP clients.\n    \"\"\"\n\n    pass\n\n\n# always patch our `TracedSession` when imported\n_w(TracedSession, \"send\", _wrap_send)\n", "path": "ddtrace/contrib/requests/session.py"}], "after_files": [{"content": "import requests\n\nfrom ddtrace.vendor.wrapt import wrap_function_wrapper as _w\n\nfrom ddtrace import config, Pin\n\nfrom .connection import _wrap_send\n\n\nclass TracedSession(requests.Session):\n    \"\"\"TracedSession is a requests' Session that is already traced.\n    You can use it if you want a finer grained control for your\n    HTTP clients.\n    \"\"\"\n\n    pass\n\n\n# always patch our `TracedSession` when imported\n_w(TracedSession, \"send\", _wrap_send)\nPin(_config=config.requests).onto(TracedSession)\n", "path": "ddtrace/contrib/requests/session.py"}]}