File tree Expand file tree Collapse file tree 5 files changed +52
-1
lines changed
azure-monitor-opentelemetry-distro Expand file tree Collapse file tree 5 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Adding requests, flask, and psycopg2 instrumentations
6+ ([ #199 ] ( https://github.com/microsoft/ApplicationInsights-Python/pull/199 ) )
57- Added publishing action
68 ([ #193 ] ( https://github.com/microsoft/ApplicationInsights-Python/pull/193 ) )
79
Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ zip_safe = False
3232include_package_data = True
3333install_requires =
3434 azure-monitor-opentelemetry-exporter == 1.0.0b7
35- opentelemetry-instrumentation == 0.32b0
35+ opentelemetry-instrumentation == 0.33b0
36+ opentelemetry-instrumentation-requests == 0.33b0
37+ opentelemetry-instrumentation-flask == 0.33b0
38+ opentelemetry-instrumentation-psycopg2 == 0.33b0
3639
3740[options.packages.find]
3841where = src
Original file line number Diff line number Diff line change 1+ import unittest
2+
3+ from opentelemetry .instrumentation .flask import FlaskInstrumentor
4+
5+
6+ class TestFlaskInstrumentation (unittest .TestCase ):
7+ def test_instrument (self ):
8+ excluded_urls = "client/.*/info,healthcheck"
9+ try :
10+ FlaskInstrumentor ().instrument (excluded_urls = excluded_urls )
11+ except Exception as ex : # pylint: disable=broad-except
12+ print (ex )
13+ self .fail (
14+ f"Unexpected exception raised when instrumenting { FlaskInstrumentor .__name__ } "
15+ )
16+
Original file line number Diff line number Diff line change 1+ import unittest
2+
3+ from opentelemetry .instrumentation .psycopg2 import Psycopg2Instrumentor
4+
5+
6+ class TestPsycopg2Instrumentation (unittest .TestCase ):
7+ def test_instrument (self ):
8+ try :
9+ Psycopg2Instrumentor ().instrument ()
10+ except Exception as ex : # pylint: disable=broad-except
11+ print (ex )
12+ self .fail (
13+ f"Unexpected exception raised when instrumenting { Psycopg2Instrumentor .__name__ } "
14+ )
15+
Original file line number Diff line number Diff line change 1+ import unittest
2+
3+ from opentelemetry .instrumentation .requests import RequestsInstrumentor
4+
5+
6+ class TestRequestsInstrumentation (unittest .TestCase ):
7+ def test_instrument (self ):
8+ try :
9+ RequestsInstrumentor ().instrument ()
10+ except Exception as ex : # pylint: disable=broad-except
11+ print (ex )
12+ self .fail (
13+ f"Unexpected exception raised when instrumenting { RequestsInstrumentor .__name__ } "
14+ )
15+
You can’t perform that action at this time.
0 commit comments