Skip to content

Commit

Permalink
fix pymssql entry_point for auto-instrumentation (#3214)
Browse files Browse the repository at this point in the history
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
  • Loading branch information
emdneto and xrmx authored Jan 28, 2025
1 parent eabab7d commit dd68241
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ instruments = [
]

[project.entry-points.opentelemetry_instrumentor]
pymssql = "opentelemetry.instrumentation.pymssql:pymssqlInstrumentor"
pymssql = "opentelemetry.instrumentation.pymssql:PyMSSQLInstrumentor"

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-pymssql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from opentelemetry.instrumentation.pymssql import PyMSSQLInstrumentor
from opentelemetry.sdk import resources
from opentelemetry.test.test_base import TestBase
from opentelemetry.util._importlib_metadata import entry_points


def mock_connect(*args, **kwargs):
Expand Down Expand Up @@ -182,3 +183,15 @@ def test_uninstrument_connection(self):

spans_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans_list), 1)

def test_load_entry_point(self):
self.assertIs(
next(
iter(
entry_points(
group="opentelemetry_instrumentor", name="pymssql"
)
)
).load(),
PyMSSQLInstrumentor,
)

0 comments on commit dd68241

Please sign in to comment.