We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Configuration object stores ints as floats
The global configuration object will store `"2"` as `2.0` instead of `2`. Fix that.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `opentelemetry-api/src/opentelemetry/configuration/__init__.py`
Content:
```
1 # Copyright The 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 Simple configuration manager
17 
18 This is a configuration manager for OpenTelemetry. It reads configuration
19 values from environment variables prefixed with ``OTEL_`` (for environment
20 variables that apply to any OpenTelemetry implementation) or with
21 ``OTEL_PYTHON_`` (for environment variables that are specific to the Python
22 implementation of OpenTelemetry) whose characters are only alphanumeric
23 characters and unserscores, except for the first character after ``OTEL_`` or
24 ``OTEL_PYTHON_`` which must not be a number.
25 
26 For example, these environment variables will be read:
27 
28 1. ``OTEL_SOMETHING``
29 2. ``OTEL_SOMETHING_ELSE_``
30 3. ``OTEL_SOMETHING_ELSE_AND__ELSE``
31 4. ``OTEL_SOMETHING_ELSE_AND_else``
32 5. ``OTEL_SOMETHING_ELSE_AND_else2``
33 
34 These won't:
35 
36 1. ``OPENTELEMETRY_PYTH_SOMETHING``
37 2. ``OTEL_2_SOMETHING_AND__ELSE``
38 3. ``OTEL_SOMETHING_%_ELSE``
39 
40 The values stored in the environment variables can be found in an instance of
41 ``opentelemetry.configuration.Configuration``. This class can be instantiated
42 freely because instantiating it returns always the same object.
43 
44 For example, if the environment variable
45 ``OTEL_PYTHON_METER_PROVIDER`` value is ``my_meter_provider``, then
46 ``Configuration().meter_provider == "my_meter_provider"`` would be ``True``.
47 
48 Non defined attributes will always return ``None``. This is intended to make it
49 easier to use the ``Configuration`` object in actual code, because it won't be
50 necessary to check for the attribute to be defined first.
51 
52 Environment variables used by OpenTelemetry
53 -------------------------------------------
54 
55 1. OTEL_PYTHON_METER_PROVIDER
56 2. OTEL_PYTHON_TRACER_PROVIDER
57 
58 The value of these environment variables should be the name of the entry point
59 that points to the class that implements either provider. This OpenTelemetry
60 API package provides one entry point for each, which can be found in the
61 setup.py file::
62 
63     entry_points={
64         ...
65         "opentelemetry_meter_provider": [
66             "default_meter_provider = "
67             "opentelemetry.metrics:DefaultMeterProvider"
68         ],
69         "opentelemetry_tracer_provider": [
70             "default_tracer_provider = "
71             "opentelemetry.trace:DefaultTracerProvider"
72         ],
73     }
74 
75 To use the meter provider above, then the
76 ``OTEL_PYTHON_METER_PROVIDER`` should be set to
77 ``"default_meter_provider"`` (this is not actually necessary since the
78 OpenTelemetry API provided providers are the default ones used if no
79 configuration is found in the environment variables).
80 
81 Configuration values that are exactly ``"True"`` or ``"False"`` will be
82 converted to its boolean values of ``True`` and ``False`` respectively.
83 
84 Configuration values that can be casted to integers or floats will be casted.
85 
86 This object can be used by any OpenTelemetry component, native or external.
87 For that reason, the ``Configuration`` object is designed to be immutable.
88 If a component would change the value of one of the ``Configuration`` object
89 attributes then another component that relied on that value may break, leading
90 to bugs that are very hard to debug. To avoid this situation, the preferred
91 approach for components that need a different value than the one provided by
92 the ``Configuration`` object is to implement a mechanism that allows the user
93 to override this value instead of changing it.
94 """
95 
96 from os import environ
97 from re import fullmatch
98 from typing import ClassVar, Dict, Optional, TypeVar, Union
99 
100 ConfigValue = Union[str, bool, int, float]
101 _T = TypeVar("_T", ConfigValue, Optional[ConfigValue])
102 
103 
104 class Configuration:
105     _instance = None  # type: ClassVar[Optional[Configuration]]
106     _config_map = {}  # type: ClassVar[Dict[str, ConfigValue]]
107 
108     def __new__(cls) -> "Configuration":
109         if cls._instance is not None:
110             instance = cls._instance
111         else:
112 
113             instance = super().__new__(cls)
114             for key, value_str in environ.items():
115 
116                 match = fullmatch(r"OTEL_(PYTHON_)?([A-Za-z_][\w_]*)", key)
117 
118                 if match is not None:
119 
120                     key = match.group(2)
121                     value = value_str  # type: ConfigValue
122 
123                     if value_str == "True":
124                         value = True
125                     elif value_str == "False":
126                         value = False
127                     else:
128                         try:
129                             value = int(value_str)
130                         except ValueError:
131                             pass
132                         try:
133                             value = float(value_str)
134                         except ValueError:
135                             pass
136 
137                     instance._config_map[key] = value
138 
139             cls._instance = instance
140 
141         return instance
142 
143     def __getattr__(self, name: str) -> Optional[ConfigValue]:
144         return self._config_map.get(name)
145 
146     def __setattr__(self, name: str, value: ConfigValue) -> None:
147         if name not in self._config_map.keys():
148             self._config_map[name] = value
149         else:
150             raise AttributeError(name)
151 
152     def get(self, name: str, default: _T) -> _T:
153         """Use this typed method for dynamic access instead of `getattr`
154 
155         :rtype: str or bool or int or float or None
156         """
157         return self._config_map.get(name, default)
158 
159     @classmethod
160     def _reset(cls) -> None:
161         """
162         This method "resets" the global configuration attributes
163 
164         It is not intended to be used by production code but by testing code
165         only.
166         """
167 
168         if cls._instance:
169             cls._instance._config_map.clear()  # pylint: disable=protected-access
170             cls._instance = None
171
```
--- 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()

```

diff --git a/opentelemetry-api/src/opentelemetry/configuration/__init__.py b/opentelemetry-api/src/opentelemetry/configuration/__init__.py
--- a/opentelemetry-api/src/opentelemetry/configuration/__init__.py
+++ b/opentelemetry-api/src/opentelemetry/configuration/__init__.py
@@ -128,11 +128,10 @@
                         try:
                             value = int(value_str)
                         except ValueError:
-                            pass
-                        try:
-                            value = float(value_str)
-                        except ValueError:
-                            pass
+                            try:
+                                value = float(value_str)
+                            except ValueError:
+                                pass
 
                     instance._config_map[key] = value

{"golden_diff": "diff --git a/opentelemetry-api/src/opentelemetry/configuration/__init__.py b/opentelemetry-api/src/opentelemetry/configuration/__init__.py\n--- a/opentelemetry-api/src/opentelemetry/configuration/__init__.py\n+++ b/opentelemetry-api/src/opentelemetry/configuration/__init__.py\n@@ -128,11 +128,10 @@\n                         try:\n                             value = int(value_str)\n                         except ValueError:\n-                            pass\n-                        try:\n-                            value = float(value_str)\n-                        except ValueError:\n-                            pass\n+                            try:\n+                                value = float(value_str)\n+                            except ValueError:\n+                                pass\n \n                     instance._config_map[key] = value\n", "issue": "Configuration object stores ints as floats\nThe global configuration object will store `\"2\"` as `2.0` instead of `2`. Fix that.\n", "before_files": [{"content": "# Copyright The 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\"\"\"\nSimple configuration manager\n\nThis is a configuration manager for OpenTelemetry. It reads configuration\nvalues from environment variables prefixed with ``OTEL_`` (for environment\nvariables that apply to any OpenTelemetry implementation) or with\n``OTEL_PYTHON_`` (for environment variables that are specific to the Python\nimplementation of OpenTelemetry) whose characters are only alphanumeric\ncharacters and unserscores, except for the first character after ``OTEL_`` or\n``OTEL_PYTHON_`` which must not be a number.\n\nFor example, these environment variables will be read:\n\n1. ``OTEL_SOMETHING``\n2. ``OTEL_SOMETHING_ELSE_``\n3. ``OTEL_SOMETHING_ELSE_AND__ELSE``\n4. ``OTEL_SOMETHING_ELSE_AND_else``\n5. ``OTEL_SOMETHING_ELSE_AND_else2``\n\nThese won't:\n\n1. ``OPENTELEMETRY_PYTH_SOMETHING``\n2. ``OTEL_2_SOMETHING_AND__ELSE``\n3. ``OTEL_SOMETHING_%_ELSE``\n\nThe values stored in the environment variables can be found in an instance of\n``opentelemetry.configuration.Configuration``. This class can be instantiated\nfreely because instantiating it returns always the same object.\n\nFor example, if the environment variable\n``OTEL_PYTHON_METER_PROVIDER`` value is ``my_meter_provider``, then\n``Configuration().meter_provider == \"my_meter_provider\"`` would be ``True``.\n\nNon defined attributes will always return ``None``. This is intended to make it\neasier to use the ``Configuration`` object in actual code, because it won't be\nnecessary to check for the attribute to be defined first.\n\nEnvironment variables used by OpenTelemetry\n-------------------------------------------\n\n1. OTEL_PYTHON_METER_PROVIDER\n2. OTEL_PYTHON_TRACER_PROVIDER\n\nThe value of these environment variables should be the name of the entry point\nthat points to the class that implements either provider. This OpenTelemetry\nAPI package provides one entry point for each, which can be found in the\nsetup.py file::\n\n    entry_points={\n        ...\n        \"opentelemetry_meter_provider\": [\n            \"default_meter_provider = \"\n            \"opentelemetry.metrics:DefaultMeterProvider\"\n        ],\n        \"opentelemetry_tracer_provider\": [\n            \"default_tracer_provider = \"\n            \"opentelemetry.trace:DefaultTracerProvider\"\n        ],\n    }\n\nTo use the meter provider above, then the\n``OTEL_PYTHON_METER_PROVIDER`` should be set to\n``\"default_meter_provider\"`` (this is not actually necessary since the\nOpenTelemetry API provided providers are the default ones used if no\nconfiguration is found in the environment variables).\n\nConfiguration values that are exactly ``\"True\"`` or ``\"False\"`` will be\nconverted to its boolean values of ``True`` and ``False`` respectively.\n\nConfiguration values that can be casted to integers or floats will be casted.\n\nThis object can be used by any OpenTelemetry component, native or external.\nFor that reason, the ``Configuration`` object is designed to be immutable.\nIf a component would change the value of one of the ``Configuration`` object\nattributes then another component that relied on that value may break, leading\nto bugs that are very hard to debug. To avoid this situation, the preferred\napproach for components that need a different value than the one provided by\nthe ``Configuration`` object is to implement a mechanism that allows the user\nto override this value instead of changing it.\n\"\"\"\n\nfrom os import environ\nfrom re import fullmatch\nfrom typing import ClassVar, Dict, Optional, TypeVar, Union\n\nConfigValue = Union[str, bool, int, float]\n_T = TypeVar(\"_T\", ConfigValue, Optional[ConfigValue])\n\n\nclass Configuration:\n    _instance = None  # type: ClassVar[Optional[Configuration]]\n    _config_map = {}  # type: ClassVar[Dict[str, ConfigValue]]\n\n    def __new__(cls) -> \"Configuration\":\n        if cls._instance is not None:\n            instance = cls._instance\n        else:\n\n            instance = super().__new__(cls)\n            for key, value_str in environ.items():\n\n                match = fullmatch(r\"OTEL_(PYTHON_)?([A-Za-z_][\\w_]*)\", key)\n\n                if match is not None:\n\n                    key = match.group(2)\n                    value = value_str  # type: ConfigValue\n\n                    if value_str == \"True\":\n                        value = True\n                    elif value_str == \"False\":\n                        value = False\n                    else:\n                        try:\n                            value = int(value_str)\n                        except ValueError:\n                            pass\n                        try:\n                            value = float(value_str)\n                        except ValueError:\n                            pass\n\n                    instance._config_map[key] = value\n\n            cls._instance = instance\n\n        return instance\n\n    def __getattr__(self, name: str) -> Optional[ConfigValue]:\n        return self._config_map.get(name)\n\n    def __setattr__(self, name: str, value: ConfigValue) -> None:\n        if name not in self._config_map.keys():\n            self._config_map[name] = value\n        else:\n            raise AttributeError(name)\n\n    def get(self, name: str, default: _T) -> _T:\n        \"\"\"Use this typed method for dynamic access instead of `getattr`\n\n        :rtype: str or bool or int or float or None\n        \"\"\"\n        return self._config_map.get(name, default)\n\n    @classmethod\n    def _reset(cls) -> None:\n        \"\"\"\n        This method \"resets\" the global configuration attributes\n\n        It is not intended to be used by production code but by testing code\n        only.\n        \"\"\"\n\n        if cls._instance:\n            cls._instance._config_map.clear()  # pylint: disable=protected-access\n            cls._instance = None\n", "path": "opentelemetry-api/src/opentelemetry/configuration/__init__.py"}], "after_files": [{"content": "# Copyright The 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\"\"\"\nSimple configuration manager\n\nThis is a configuration manager for OpenTelemetry. It reads configuration\nvalues from environment variables prefixed with ``OTEL_`` (for environment\nvariables that apply to any OpenTelemetry implementation) or with\n``OTEL_PYTHON_`` (for environment variables that are specific to the Python\nimplementation of OpenTelemetry) whose characters are only alphanumeric\ncharacters and unserscores, except for the first character after ``OTEL_`` or\n``OTEL_PYTHON_`` which must not be a number.\n\nFor example, these environment variables will be read:\n\n1. ``OTEL_SOMETHING``\n2. ``OTEL_SOMETHING_ELSE_``\n3. ``OTEL_SOMETHING_ELSE_AND__ELSE``\n4. ``OTEL_SOMETHING_ELSE_AND_else``\n5. ``OTEL_SOMETHING_ELSE_AND_else2``\n\nThese won't:\n\n1. ``OPENTELEMETRY_PYTH_SOMETHING``\n2. ``OTEL_2_SOMETHING_AND__ELSE``\n3. ``OTEL_SOMETHING_%_ELSE``\n\nThe values stored in the environment variables can be found in an instance of\n``opentelemetry.configuration.Configuration``. This class can be instantiated\nfreely because instantiating it returns always the same object.\n\nFor example, if the environment variable\n``OTEL_PYTHON_METER_PROVIDER`` value is ``my_meter_provider``, then\n``Configuration().meter_provider == \"my_meter_provider\"`` would be ``True``.\n\nNon defined attributes will always return ``None``. This is intended to make it\neasier to use the ``Configuration`` object in actual code, because it won't be\nnecessary to check for the attribute to be defined first.\n\nEnvironment variables used by OpenTelemetry\n-------------------------------------------\n\n1. OTEL_PYTHON_METER_PROVIDER\n2. OTEL_PYTHON_TRACER_PROVIDER\n\nThe value of these environment variables should be the name of the entry point\nthat points to the class that implements either provider. This OpenTelemetry\nAPI package provides one entry point for each, which can be found in the\nsetup.py file::\n\n    entry_points={\n        ...\n        \"opentelemetry_meter_provider\": [\n            \"default_meter_provider = \"\n            \"opentelemetry.metrics:DefaultMeterProvider\"\n        ],\n        \"opentelemetry_tracer_provider\": [\n            \"default_tracer_provider = \"\n            \"opentelemetry.trace:DefaultTracerProvider\"\n        ],\n    }\n\nTo use the meter provider above, then the\n``OTEL_PYTHON_METER_PROVIDER`` should be set to\n``\"default_meter_provider\"`` (this is not actually necessary since the\nOpenTelemetry API provided providers are the default ones used if no\nconfiguration is found in the environment variables).\n\nConfiguration values that are exactly ``\"True\"`` or ``\"False\"`` will be\nconverted to its boolean values of ``True`` and ``False`` respectively.\n\nConfiguration values that can be casted to integers or floats will be casted.\n\nThis object can be used by any OpenTelemetry component, native or external.\nFor that reason, the ``Configuration`` object is designed to be immutable.\nIf a component would change the value of one of the ``Configuration`` object\nattributes then another component that relied on that value may break, leading\nto bugs that are very hard to debug. To avoid this situation, the preferred\napproach for components that need a different value than the one provided by\nthe ``Configuration`` object is to implement a mechanism that allows the user\nto override this value instead of changing it.\n\"\"\"\n\nfrom os import environ\nfrom re import fullmatch\nfrom typing import ClassVar, Dict, Optional, TypeVar, Union\n\nConfigValue = Union[str, bool, int, float]\n_T = TypeVar(\"_T\", ConfigValue, Optional[ConfigValue])\n\n\nclass Configuration:\n    _instance = None  # type: ClassVar[Optional[Configuration]]\n    _config_map = {}  # type: ClassVar[Dict[str, ConfigValue]]\n\n    def __new__(cls) -> \"Configuration\":\n        if cls._instance is not None:\n            instance = cls._instance\n        else:\n\n            instance = super().__new__(cls)\n            for key, value_str in environ.items():\n\n                match = fullmatch(r\"OTEL_(PYTHON_)?([A-Za-z_][\\w_]*)\", key)\n\n                if match is not None:\n\n                    key = match.group(2)\n                    value = value_str  # type: ConfigValue\n\n                    if value_str == \"True\":\n                        value = True\n                    elif value_str == \"False\":\n                        value = False\n                    else:\n                        try:\n                            value = int(value_str)\n                        except ValueError:\n                            try:\n                                value = float(value_str)\n                            except ValueError:\n                                pass\n\n                    instance._config_map[key] = value\n\n            cls._instance = instance\n\n        return instance\n\n    def __getattr__(self, name: str) -> Optional[ConfigValue]:\n        return self._config_map.get(name)\n\n    def __setattr__(self, name: str, value: ConfigValue) -> None:\n        if name not in self._config_map.keys():\n            self._config_map[name] = value\n        else:\n            raise AttributeError(name)\n\n    def get(self, name: str, default: _T) -> _T:\n        \"\"\"Use this typed method for dynamic access instead of `getattr`\n\n        :rtype: str or bool or int or float or None\n        \"\"\"\n        return self._config_map.get(name, default)\n\n    @classmethod\n    def _reset(cls) -> None:\n        \"\"\"\n        This method \"resets\" the global configuration attributes\n\n        It is not intended to be used by production code but by testing code\n        only.\n        \"\"\"\n\n        if cls._instance:\n            cls._instance._config_map.clear()  # pylint: disable=protected-access\n            cls._instance = None\n", "path": "opentelemetry-api/src/opentelemetry/configuration/__init__.py"}]}