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
packages=find_namespace:
install_requires =
opentelemetry-api == 0.15.dev0
opentelemetry-instrumentation == 0.15.dev0
opentelemetry-api == 0.15b0
opentelemetry-instrumentation == 0.15b0
wrapt >= 1.11.2
sqlalchemy
[options.extras_require]
test =
opentelemetry-sdk == 0.15.dev0
opentelemetry-sdk == 0.15b0
pytest
[options.packages.find]

View File

@ -16,7 +16,7 @@ from sqlalchemy.event import listen
from opentelemetry import trace
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:
# 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:
if self.current_span.is_recording():
self.current_span.set_status(
Status(
StatusCanonicalCode.UNKNOWN,
str(context.original_exception),
)
Status(StatusCode.ERROR, str(context.original_exception),)
)
finally:
self.current_span.end()

View File

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