We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fedd9cd commit 65cac6dCopy full SHA for 65cac6d
app.py
@@ -16,11 +16,12 @@
16
app = Flask(__name__)
17
18
# Setup Azure Monitor
19
-# middleware = FlaskMiddleware(
20
-# app,
21
-# exporter=AzureExporter(connection_string="InstrumentationKey={0}".format(os.environ['APPINSIGHTS_KEY'])),
22
-# sampler=ProbabilitySampler(rate=1.0),
23
-# )
+if 'APPINSIGHTS_KEY' in os.environ:
+ middleware = FlaskMiddleware(
+ app,
+ exporter=AzureExporter(connection_string="InstrumentationKey={0}".format(os.environ['APPINSIGHTS_KEY'])),
+ sampler=ProbabilitySampler(rate=1.0),
24
+ )
25
26
# Setup Flask Restful framework
27
api = Api(app)
0 commit comments