@@ -166,8 +166,11 @@ The **Azure Monitor Metrics Exporter** allows you to export metrics to `Azure Mo
166166
167167 def main ():
168168 # Enable metrics
169- # Set the interval in seconds in which you want to send metrics
170- exporter = metrics_exporter.new_metrics_exporter(connection_string = ' InstrumentationKey=<your-instrumentation-key-here>' )
169+ # Set the interval in seconds to 60s, which is the time interval application insights
170+ # aggregates your metrics
171+ exporter = metrics_exporter.new_metrics_exporter(
172+ connection_string = ' InstrumentationKey=<your-instrumentation-key-here>'
173+ )
171174 view_manager.register_exporter(exporter)
172175
173176 view_manager.register_view(CARROTS_VIEW )
@@ -176,7 +179,6 @@ The **Azure Monitor Metrics Exporter** allows you to export metrics to `Azure Mo
176179
177180 mmap.measure_int_put(CARROTS_MEASURE , 1000 )
178181 mmap.record(tmap)
179- # Default export interval is every 15.0s
180182
181183 print (" Done recording metrics" )
182184
@@ -196,10 +198,13 @@ The exporter also includes a set of performance counters that are exported to Az
196198 from opencensus.ext.azure import metrics_exporter
197199
198200 def main ():
199- # All you need is the next line . You can disable performance counters by
201+ # Performance counters are sent by default . You can disable performance counters by
200202 # passing in enable_standard_metrics=False into the constructor of
201203 # new_metrics_exporter()
202- _exporter = metrics_exporter.new_metrics_exporter(connection_string = ' InstrumentationKey=<your-instrumentation-key-here>' )
204+ _exporter = metrics_exporter.new_metrics_exporter(
205+ connection_string = ' InstrumentationKey=<your-instrumentation-key-here>' ,
206+ export_interval = 60 ,
207+ )
203208
204209 for i in range (100 ):
205210 print (psutil.virtual_memory())
@@ -256,8 +261,12 @@ Modifying Metrics
256261
257262 def main ():
258263 # Enable metrics
259- # Set the interval in seconds in which you want to send metrics
260- exporter = metrics_exporter.new_metrics_exporter(connection_string = ' InstrumentationKey=<your-instrumentation-key-here>' )
264+ # Set the interval in seconds to 60s, which is the time interval application insights
265+ # aggregates your metrics
266+ exporter = metrics_exporter.new_metrics_exporter(
267+ connection_string = ' InstrumentationKey=<your-instrumentation-key-here>' ,
268+ export_interval = 60 ,
269+ )
261270 exporter.add_telemetry_processor(callback_function)
262271 view_manager.register_exporter(exporter)
263272
@@ -267,7 +276,6 @@ Modifying Metrics
267276
268277 mmap.measure_int_put(CARROTS_MEASURE , 1000 )
269278 mmap.record(tmap)
270- # Default export interval is every 15.0s
271279
272280 print (" Done recording metrics" )
273281
0 commit comments