Skip to content

Commit

Permalink
Merge pull request #199 from jeremydvoss/instrumentations-minus-django
Browse files Browse the repository at this point in the history
Adding instrumentations aside from django
  • Loading branch information
jeremydvoss authored Sep 26, 2022
2 parents 181f9be + 3d3cbd9 commit 1f01f7e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Adding requests, flask, and psycopg2 instrumentations
([#199](https://github.com/microsoft/ApplicationInsights-Python/pull/199))
- Added publishing action
([#193](https://github.com/microsoft/ApplicationInsights-Python/pull/193))

Expand Down
5 changes: 4 additions & 1 deletion azure-monitor-opentelemetry-distro/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ zip_safe = False
include_package_data = True
install_requires =
azure-monitor-opentelemetry-exporter == 1.0.0b7
opentelemetry-instrumentation == 0.32b0
opentelemetry-instrumentation == 0.33b0
opentelemetry-instrumentation-requests == 0.33b0
opentelemetry-instrumentation-flask == 0.33b0
opentelemetry-instrumentation-psycopg2 == 0.33b0

[options.packages.find]
where = src
Expand Down
16 changes: 16 additions & 0 deletions azure-monitor-opentelemetry-distro/tests/test_flask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest

from opentelemetry.instrumentation.flask import FlaskInstrumentor


class TestFlaskInstrumentation(unittest.TestCase):
def test_instrument(self):
excluded_urls = "client/.*/info,healthcheck"
try:
FlaskInstrumentor().instrument(excluded_urls=excluded_urls)
except Exception as ex: # pylint: disable=broad-except
print(ex)
self.fail(
f"Unexpected exception raised when instrumenting {FlaskInstrumentor.__name__}"
)

15 changes: 15 additions & 0 deletions azure-monitor-opentelemetry-distro/tests/test_psycopg2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest

from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor


class TestPsycopg2Instrumentation(unittest.TestCase):
def test_instrument(self):
try:
Psycopg2Instrumentor().instrument()
except Exception as ex: # pylint: disable=broad-except
print(ex)
self.fail(
f"Unexpected exception raised when instrumenting {Psycopg2Instrumentor.__name__}"
)

15 changes: 15 additions & 0 deletions azure-monitor-opentelemetry-distro/tests/test_requests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest

from opentelemetry.instrumentation.requests import RequestsInstrumentor


class TestRequestsInstrumentation(unittest.TestCase):
def test_instrument(self):
try:
RequestsInstrumentor().instrument()
except Exception as ex: # pylint: disable=broad-except
print(ex)
self.fail(
f"Unexpected exception raised when instrumenting {RequestsInstrumentor.__name__}"
)

0 comments on commit 1f01f7e

Please sign in to comment.