We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
exception in prometheus exporter AttributeError: 'frozenset' object has no attribute 'items'
Hi,
Using the code sample from https://github.com/open-telemetry/opentelemetry-python/blob/v1.12.0rc1/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py 

```
from prometheus_client import start_http_server
from opentelemetry.exporter.prometheus import PrometheusMetricReader
from opentelemetry.metrics import get_meter_provider, set_meter_provider
from opentelemetry.sdk.metrics import MeterProvider
import random

start_http_server(port=8000, addr="localhost")

prefix = "MyAppPrefix"
reader = PrometheusMetricReader(prefix)

set_meter_provider(MeterProvider(metric_readers=[reader]))
meter = get_meter_provider().get_meter("myapp", "0.1.2")
counter = meter.create_counter(
    "requests",
    "requests",
    "number of requests",
)
labels = {"environment": "staging"}
counter.add(25, labels)
```

when accessing http://localhost:8000 and exception is thrown
`  File "/Users/m_652923/.pyenv/versions/3.8.9/lib/python3.8/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/exposition.py", line 128, in prometheus_app
    status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
  File "/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/exposition.py", line 104, in _bake_output
    output = encoder(registry)
  File "/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/exposition.py", line 197, in generate_latest
    for metric in registry.collect():
  File "/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/registry.py", line 97, in collect
    yield from collector.collect()
  File "/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/opentelemetry/exporter/prometheus/__init__.py", line 166, in collect
    self._translate_to_prometheus(
  File "/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/opentelemetry/exporter/prometheus/__init__.py", line 204, in _translate_to_prometheus
    for key, value in number_data_point.attributes.items():
AttributeError: 'frozenset' object has no attribute 'items'`

```
$pip freeze
backoff==1.11.1
certifi==2022.5.18.1
charset-normalizer==2.0.12
Deprecated==1.2.13
googleapis-common-protos==1.56.1
grpcio==1.46.3
idna==3.3
opentelemetry-api==1.12.0rc1
opentelemetry-exporter-otlp==1.12.0rc1
opentelemetry-exporter-otlp-proto-grpc==1.12.0rc1
opentelemetry-exporter-otlp-proto-http==1.12.0rc1
opentelemetry-exporter-prometheus==1.12.0rc1
opentelemetry-proto==1.12.0rc1
opentelemetry-sdk==1.12.0rc1
opentelemetry-semantic-conventions==0.31b0
prometheus-client==0.14.1
protobuf==3.20.1
requests==2.27.1
six==1.16.0
typing_extensions==4.2.0
urllib3==1.26.9
wrapt==1.14.1
```
This also happens when I try an `up_down_counter`
```
gauge = meter.create_up_down_counter(
        'requests_for_endpoints_ms',
        'millis',
        'Requests for endpoints in milliseconds'
    )

res = random.choice(results)
gauge.add(random.randint(10, 40), {'endpoint': res['endpoint']})
```

--- 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-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.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 from logging import getLogger
17 from threading import Lock
18 from typing import Dict, Iterable
19 
20 from opentelemetry.metrics import Instrument
21 from opentelemetry.sdk.metrics._internal.aggregation import (
22     Aggregation,
23     DefaultAggregation,
24     _Aggregation,
25     _SumAggregation,
26 )
27 from opentelemetry.sdk.metrics._internal.export import AggregationTemporality
28 from opentelemetry.sdk.metrics._internal.measurement import Measurement
29 from opentelemetry.sdk.metrics._internal.point import DataPointT
30 from opentelemetry.sdk.metrics._internal.view import View
31 from opentelemetry.util._time import _time_ns
32 
33 _logger = getLogger(__name__)
34 
35 
36 class _ViewInstrumentMatch:
37     def __init__(
38         self,
39         view: View,
40         instrument: Instrument,
41         instrument_class_aggregation: Dict[type, Aggregation],
42     ):
43         self._start_time_unix_nano = _time_ns()
44         self._view = view
45         self._instrument = instrument
46         self._attributes_aggregation: Dict[frozenset, _Aggregation] = {}
47         self._lock = Lock()
48         self._instrument_class_aggregation = instrument_class_aggregation
49         self._name = self._view._name or self._instrument.name
50         self._description = (
51             self._view._description or self._instrument.description
52         )
53         if not isinstance(self._view._aggregation, DefaultAggregation):
54             self._aggregation = self._view._aggregation._create_aggregation(
55                 self._instrument, None, 0
56             )
57         else:
58             self._aggregation = self._instrument_class_aggregation[
59                 self._instrument.__class__
60             ]._create_aggregation(self._instrument, None, 0)
61 
62     def conflicts(self, other: "_ViewInstrumentMatch") -> bool:
63         # pylint: disable=protected-access
64 
65         result = (
66             self._name == other._name
67             and self._instrument.unit == other._instrument.unit
68             # The aggregation class is being used here instead of data point
69             # type since they are functionally equivalent.
70             and self._aggregation.__class__ == other._aggregation.__class__
71         )
72         if isinstance(self._aggregation, _SumAggregation):
73             result = (
74                 result
75                 and self._aggregation._instrument_is_monotonic
76                 == other._aggregation._instrument_is_monotonic
77                 and self._aggregation._instrument_temporality
78                 == other._aggregation._instrument_temporality
79             )
80 
81         return result
82 
83     # pylint: disable=protected-access
84     def consume_measurement(self, measurement: Measurement) -> None:
85 
86         if self._view._attribute_keys is not None:
87 
88             attributes = {}
89 
90             for key, value in (measurement.attributes or {}).items():
91                 if key in self._view._attribute_keys:
92                     attributes[key] = value
93         elif measurement.attributes is not None:
94             attributes = measurement.attributes
95         else:
96             attributes = {}
97 
98         attributes = frozenset(attributes.items())
99 
100         if attributes not in self._attributes_aggregation:
101             with self._lock:
102                 if attributes not in self._attributes_aggregation:
103                     if not isinstance(
104                         self._view._aggregation, DefaultAggregation
105                     ):
106                         aggregation = (
107                             self._view._aggregation._create_aggregation(
108                                 self._instrument,
109                                 attributes,
110                                 self._start_time_unix_nano,
111                             )
112                         )
113                     else:
114                         aggregation = self._instrument_class_aggregation[
115                             self._instrument.__class__
116                         ]._create_aggregation(
117                             self._instrument,
118                             attributes,
119                             self._start_time_unix_nano,
120                         )
121                     self._attributes_aggregation[attributes] = aggregation
122 
123         self._attributes_aggregation[attributes].aggregate(measurement)
124 
125     def collect(
126         self,
127         aggregation_temporality: AggregationTemporality,
128         collection_start_nanos: int,
129     ) -> Iterable[DataPointT]:
130 
131         with self._lock:
132             for aggregation in self._attributes_aggregation.values():
133                 yield aggregation.collect(
134                     aggregation_temporality, collection_start_nanos
135                 )
136
```
--- 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-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py
--- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py
+++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py
@@ -95,11 +95,11 @@
         else:
             attributes = {}
 
-        attributes = frozenset(attributes.items())
+        aggr_key = frozenset(attributes.items())
 
-        if attributes not in self._attributes_aggregation:
+        if aggr_key not in self._attributes_aggregation:
             with self._lock:
-                if attributes not in self._attributes_aggregation:
+                if aggr_key not in self._attributes_aggregation:
                     if not isinstance(
                         self._view._aggregation, DefaultAggregation
                     ):
@@ -118,9 +118,9 @@
                             attributes,
                             self._start_time_unix_nano,
                         )
-                    self._attributes_aggregation[attributes] = aggregation
+                    self._attributes_aggregation[aggr_key] = aggregation
 
-        self._attributes_aggregation[attributes].aggregate(measurement)
+        self._attributes_aggregation[aggr_key].aggregate(measurement)
 
     def collect(
         self,

{"golden_diff": "diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py\n--- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py\n+++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py\n@@ -95,11 +95,11 @@\n         else:\n             attributes = {}\n \n-        attributes = frozenset(attributes.items())\n+        aggr_key = frozenset(attributes.items())\n \n-        if attributes not in self._attributes_aggregation:\n+        if aggr_key not in self._attributes_aggregation:\n             with self._lock:\n-                if attributes not in self._attributes_aggregation:\n+                if aggr_key not in self._attributes_aggregation:\n                     if not isinstance(\n                         self._view._aggregation, DefaultAggregation\n                     ):\n@@ -118,9 +118,9 @@\n                             attributes,\n                             self._start_time_unix_nano,\n                         )\n-                    self._attributes_aggregation[attributes] = aggregation\n+                    self._attributes_aggregation[aggr_key] = aggregation\n \n-        self._attributes_aggregation[attributes].aggregate(measurement)\n+        self._attributes_aggregation[aggr_key].aggregate(measurement)\n \n     def collect(\n         self,\n", "issue": "exception in prometheus exporter AttributeError: 'frozenset' object has no attribute 'items'\nHi,\r\nUsing the code sample from https://github.com/open-telemetry/opentelemetry-python/blob/v1.12.0rc1/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py \r\n\r\n```\r\nfrom prometheus_client import start_http_server\r\nfrom opentelemetry.exporter.prometheus import PrometheusMetricReader\r\nfrom opentelemetry.metrics import get_meter_provider, set_meter_provider\r\nfrom opentelemetry.sdk.metrics import MeterProvider\r\nimport random\r\n\r\nstart_http_server(port=8000, addr=\"localhost\")\r\n\r\nprefix = \"MyAppPrefix\"\r\nreader = PrometheusMetricReader(prefix)\r\n\r\nset_meter_provider(MeterProvider(metric_readers=[reader]))\r\nmeter = get_meter_provider().get_meter(\"myapp\", \"0.1.2\")\r\ncounter = meter.create_counter(\r\n    \"requests\",\r\n    \"requests\",\r\n    \"number of requests\",\r\n)\r\nlabels = {\"environment\": \"staging\"}\r\ncounter.add(25, labels)\r\n```\r\n\r\nwhen accessing http://localhost:8000 and exception is thrown\r\n`  File \"/Users/m_652923/.pyenv/versions/3.8.9/lib/python3.8/wsgiref/handlers.py\", line 137, in run\r\n    self.result = application(self.environ, self.start_response)\r\n  File \"/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/exposition.py\", line 128, in prometheus_app\r\n    status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)\r\n  File \"/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/exposition.py\", line 104, in _bake_output\r\n    output = encoder(registry)\r\n  File \"/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/exposition.py\", line 197, in generate_latest\r\n    for metric in registry.collect():\r\n  File \"/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/prometheus_client/registry.py\", line 97, in collect\r\n    yield from collector.collect()\r\n  File \"/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/opentelemetry/exporter/prometheus/__init__.py\", line 166, in collect\r\n    self._translate_to_prometheus(\r\n  File \"/Users/m_652923/.pyenv/versions/otel/lib/python3.8/site-packages/opentelemetry/exporter/prometheus/__init__.py\", line 204, in _translate_to_prometheus\r\n    for key, value in number_data_point.attributes.items():\r\nAttributeError: 'frozenset' object has no attribute 'items'`\r\n\r\n```\r\n$pip freeze\r\nbackoff==1.11.1\r\ncertifi==2022.5.18.1\r\ncharset-normalizer==2.0.12\r\nDeprecated==1.2.13\r\ngoogleapis-common-protos==1.56.1\r\ngrpcio==1.46.3\r\nidna==3.3\r\nopentelemetry-api==1.12.0rc1\r\nopentelemetry-exporter-otlp==1.12.0rc1\r\nopentelemetry-exporter-otlp-proto-grpc==1.12.0rc1\r\nopentelemetry-exporter-otlp-proto-http==1.12.0rc1\r\nopentelemetry-exporter-prometheus==1.12.0rc1\r\nopentelemetry-proto==1.12.0rc1\r\nopentelemetry-sdk==1.12.0rc1\r\nopentelemetry-semantic-conventions==0.31b0\r\nprometheus-client==0.14.1\r\nprotobuf==3.20.1\r\nrequests==2.27.1\r\nsix==1.16.0\r\ntyping_extensions==4.2.0\r\nurllib3==1.26.9\r\nwrapt==1.14.1\r\n```\r\nThis also happens when I try an `up_down_counter`\r\n```\r\ngauge = meter.create_up_down_counter(\r\n        'requests_for_endpoints_ms',\r\n        'millis',\r\n        'Requests for endpoints in milliseconds'\r\n    )\r\n\r\nres = random.choice(results)\r\ngauge.add(random.randint(10, 40), {'endpoint': res['endpoint']})\r\n```\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\nfrom logging import getLogger\nfrom threading import Lock\nfrom typing import Dict, Iterable\n\nfrom opentelemetry.metrics import Instrument\nfrom opentelemetry.sdk.metrics._internal.aggregation import (\n    Aggregation,\n    DefaultAggregation,\n    _Aggregation,\n    _SumAggregation,\n)\nfrom opentelemetry.sdk.metrics._internal.export import AggregationTemporality\nfrom opentelemetry.sdk.metrics._internal.measurement import Measurement\nfrom opentelemetry.sdk.metrics._internal.point import DataPointT\nfrom opentelemetry.sdk.metrics._internal.view import View\nfrom opentelemetry.util._time import _time_ns\n\n_logger = getLogger(__name__)\n\n\nclass _ViewInstrumentMatch:\n    def __init__(\n        self,\n        view: View,\n        instrument: Instrument,\n        instrument_class_aggregation: Dict[type, Aggregation],\n    ):\n        self._start_time_unix_nano = _time_ns()\n        self._view = view\n        self._instrument = instrument\n        self._attributes_aggregation: Dict[frozenset, _Aggregation] = {}\n        self._lock = Lock()\n        self._instrument_class_aggregation = instrument_class_aggregation\n        self._name = self._view._name or self._instrument.name\n        self._description = (\n            self._view._description or self._instrument.description\n        )\n        if not isinstance(self._view._aggregation, DefaultAggregation):\n            self._aggregation = self._view._aggregation._create_aggregation(\n                self._instrument, None, 0\n            )\n        else:\n            self._aggregation = self._instrument_class_aggregation[\n                self._instrument.__class__\n            ]._create_aggregation(self._instrument, None, 0)\n\n    def conflicts(self, other: \"_ViewInstrumentMatch\") -> bool:\n        # pylint: disable=protected-access\n\n        result = (\n            self._name == other._name\n            and self._instrument.unit == other._instrument.unit\n            # The aggregation class is being used here instead of data point\n            # type since they are functionally equivalent.\n            and self._aggregation.__class__ == other._aggregation.__class__\n        )\n        if isinstance(self._aggregation, _SumAggregation):\n            result = (\n                result\n                and self._aggregation._instrument_is_monotonic\n                == other._aggregation._instrument_is_monotonic\n                and self._aggregation._instrument_temporality\n                == other._aggregation._instrument_temporality\n            )\n\n        return result\n\n    # pylint: disable=protected-access\n    def consume_measurement(self, measurement: Measurement) -> None:\n\n        if self._view._attribute_keys is not None:\n\n            attributes = {}\n\n            for key, value in (measurement.attributes or {}).items():\n                if key in self._view._attribute_keys:\n                    attributes[key] = value\n        elif measurement.attributes is not None:\n            attributes = measurement.attributes\n        else:\n            attributes = {}\n\n        attributes = frozenset(attributes.items())\n\n        if attributes not in self._attributes_aggregation:\n            with self._lock:\n                if attributes not in self._attributes_aggregation:\n                    if not isinstance(\n                        self._view._aggregation, DefaultAggregation\n                    ):\n                        aggregation = (\n                            self._view._aggregation._create_aggregation(\n                                self._instrument,\n                                attributes,\n                                self._start_time_unix_nano,\n                            )\n                        )\n                    else:\n                        aggregation = self._instrument_class_aggregation[\n                            self._instrument.__class__\n                        ]._create_aggregation(\n                            self._instrument,\n                            attributes,\n                            self._start_time_unix_nano,\n                        )\n                    self._attributes_aggregation[attributes] = aggregation\n\n        self._attributes_aggregation[attributes].aggregate(measurement)\n\n    def collect(\n        self,\n        aggregation_temporality: AggregationTemporality,\n        collection_start_nanos: int,\n    ) -> Iterable[DataPointT]:\n\n        with self._lock:\n            for aggregation in self._attributes_aggregation.values():\n                yield aggregation.collect(\n                    aggregation_temporality, collection_start_nanos\n                )\n", "path": "opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.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\nfrom logging import getLogger\nfrom threading import Lock\nfrom typing import Dict, Iterable\n\nfrom opentelemetry.metrics import Instrument\nfrom opentelemetry.sdk.metrics._internal.aggregation import (\n    Aggregation,\n    DefaultAggregation,\n    _Aggregation,\n    _SumAggregation,\n)\nfrom opentelemetry.sdk.metrics._internal.export import AggregationTemporality\nfrom opentelemetry.sdk.metrics._internal.measurement import Measurement\nfrom opentelemetry.sdk.metrics._internal.point import DataPointT\nfrom opentelemetry.sdk.metrics._internal.view import View\nfrom opentelemetry.util._time import _time_ns\n\n_logger = getLogger(__name__)\n\n\nclass _ViewInstrumentMatch:\n    def __init__(\n        self,\n        view: View,\n        instrument: Instrument,\n        instrument_class_aggregation: Dict[type, Aggregation],\n    ):\n        self._start_time_unix_nano = _time_ns()\n        self._view = view\n        self._instrument = instrument\n        self._attributes_aggregation: Dict[frozenset, _Aggregation] = {}\n        self._lock = Lock()\n        self._instrument_class_aggregation = instrument_class_aggregation\n        self._name = self._view._name or self._instrument.name\n        self._description = (\n            self._view._description or self._instrument.description\n        )\n        if not isinstance(self._view._aggregation, DefaultAggregation):\n            self._aggregation = self._view._aggregation._create_aggregation(\n                self._instrument, None, 0\n            )\n        else:\n            self._aggregation = self._instrument_class_aggregation[\n                self._instrument.__class__\n            ]._create_aggregation(self._instrument, None, 0)\n\n    def conflicts(self, other: \"_ViewInstrumentMatch\") -> bool:\n        # pylint: disable=protected-access\n\n        result = (\n            self._name == other._name\n            and self._instrument.unit == other._instrument.unit\n            # The aggregation class is being used here instead of data point\n            # type since they are functionally equivalent.\n            and self._aggregation.__class__ == other._aggregation.__class__\n        )\n        if isinstance(self._aggregation, _SumAggregation):\n            result = (\n                result\n                and self._aggregation._instrument_is_monotonic\n                == other._aggregation._instrument_is_monotonic\n                and self._aggregation._instrument_temporality\n                == other._aggregation._instrument_temporality\n            )\n\n        return result\n\n    # pylint: disable=protected-access\n    def consume_measurement(self, measurement: Measurement) -> None:\n\n        if self._view._attribute_keys is not None:\n\n            attributes = {}\n\n            for key, value in (measurement.attributes or {}).items():\n                if key in self._view._attribute_keys:\n                    attributes[key] = value\n        elif measurement.attributes is not None:\n            attributes = measurement.attributes\n        else:\n            attributes = {}\n\n        aggr_key = frozenset(attributes.items())\n\n        if aggr_key not in self._attributes_aggregation:\n            with self._lock:\n                if aggr_key not in self._attributes_aggregation:\n                    if not isinstance(\n                        self._view._aggregation, DefaultAggregation\n                    ):\n                        aggregation = (\n                            self._view._aggregation._create_aggregation(\n                                self._instrument,\n                                attributes,\n                                self._start_time_unix_nano,\n                            )\n                        )\n                    else:\n                        aggregation = self._instrument_class_aggregation[\n                            self._instrument.__class__\n                        ]._create_aggregation(\n                            self._instrument,\n                            attributes,\n                            self._start_time_unix_nano,\n                        )\n                    self._attributes_aggregation[aggr_key] = aggregation\n\n        self._attributes_aggregation[aggr_key].aggregate(measurement)\n\n    def collect(\n        self,\n        aggregation_temporality: AggregationTemporality,\n        collection_start_nanos: int,\n    ) -> Iterable[DataPointT]:\n\n        with self._lock:\n            for aggregation in self._attributes_aggregation.values():\n                yield aggregation.collect(\n                    aggregation_temporality, collection_start_nanos\n                )\n", "path": "opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py"}]}