Merge pull request #117 from NathanielRN/move-instrumentation-sqlalchemy

Move instrumentation sqlalchemy
This commit is contained in:
alrex 2020-11-02 13:16:10 -08:00 committed by GitHub
commit 096c49292f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -39,14 +39,14 @@ package_dir=
=src =src
packages=find_namespace: packages=find_namespace:
install_requires = install_requires =
opentelemetry-api == 0.15.dev0 opentelemetry-api == 0.15b0
opentelemetry-instrumentation == 0.15.dev0 opentelemetry-instrumentation == 0.15b0
wrapt >= 1.11.2 wrapt >= 1.11.2
sqlalchemy sqlalchemy
[options.extras_require] [options.extras_require]
test = test =
opentelemetry-sdk == 0.15.dev0 opentelemetry-sdk == 0.15b0
pytest pytest
[options.packages.find] [options.packages.find]

View File

@ -16,7 +16,7 @@ from sqlalchemy.event import listen
from opentelemetry import trace from opentelemetry import trace
from opentelemetry.instrumentation.sqlalchemy.version import __version__ from opentelemetry.instrumentation.sqlalchemy.version import __version__
from opentelemetry.trace.status import Status, StatusCanonicalCode from opentelemetry.trace.status import Status, StatusCode
# Network attribute semantic convention here: # Network attribute semantic convention here:
# https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/span-general.md#general-network-connection-attributes # https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/span-general.md#general-network-connection-attributes
@ -112,10 +112,7 @@ class EngineTracer:
try: try:
if self.current_span.is_recording(): if self.current_span.is_recording():
self.current_span.set_status( self.current_span.set_status(
Status( Status(StatusCode.ERROR, str(context.original_exception),)
StatusCanonicalCode.UNKNOWN,
str(context.original_exception),
)
) )
finally: finally:
self.current_span.end() self.current_span.end()

View File

@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
__version__ = "0.15.dev0" __version__ = "0.15b0"