opentracing-contrib / java-jdbc

OpenTracing Instrumentation for JDBC
Apache License 2.0
82 stars 56 forks source link

Error span when record doesn't exist in database. #74

Closed Amiedeep closed 4 years ago

Amiedeep commented 4 years ago

My database has a customer table with ID as a primary key.

Expected behavior: When I search for a record that doesn't exist in the database, I should see an error span in the Jaeger UI.

Actual behavior: When I search for a record that doesn't exist in the database, there is no error span created.

Code:

I'm calling JPA repository from a service using: Customer customer = customerRepository.findByid(customerID);

findByid signature is like this: Customer findByid(long id);

malafeev commented 4 years ago

error span will be created only if there is a mistake in query, failed connection etc. but findByID returning null is valid case and normal span will be created.