@@ -0,0 +1,1707 @@
+# Copyright The OpenTelemetry Authors%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#     http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0Aimport random%0Aimport time%0A%0Afrom opentelemetry.metrics import get_meter_provider, set_meter_provider%0Afrom opentelemetry.sdk.metrics import MeterProvider%0Afrom opentelemetry.sdk.metrics.export import (%0A    ConsoleMetricExporter,%0A    PeriodicExportingMetricReader,%0A)%0Afrom opentelemetry.sdk.metrics.view import (%0A    DropAggregation,%0A    SumAggregation,%0A    View,%0A)%0A%0A# disable_default_aggregation.%0Adisable_default_aggregation = View(%0A    instrument_name=%22*%22, aggregation=DropAggregation()%0A)%0A%0Aexporter = ConsoleMetricExporter()%0A%0Areader = PeriodicExportingMetricReader(exporter, export_interval_millis=1_000)%0Aprovider = MeterProvider(%0A    metric_readers=%5B%0A        reader,%0A    %5D,%0A    views=%5B%0A        disable_default_aggregation,%0A        View(instrument_name=%22mycounter%22, aggregation=SumAggregation()),%0A    %5D,%0A)%0Aset_meter_provider(provider)%0A%0Ameter = get_meter_provider().get_meter(%0A    %22view-disable-default-aggregation%22, %220.1.2%22%0A)%0A# Create a view to configure aggregation specific for this counter.%0Amy_counter = meter.create_counter(%22mycounter%22)%0A%0Awhile 1:%0A    my_counter.add(random.randint(1, 10))%0A    time.sleep(random.random())%0A

Add disable default views to common view scenarios (#2983)