Describe the bug
According to elastic/apm#465 context.destination.service.resource should be ${subtype}/${instance} (or ${type}/${instance} if subtype is null) for a JDBC Span, e.g. for a postgresql db named test: postgresql/test. However, context.destination.service.resource is only ${subtype} (or ${type}), resp. postgresql in the example above.
The algorithm in co.elastic.apm.agent.impl.transaction.Span#beforeEnd is not working because:
- JDBC spans are created as normal spans, not exit spans (see
co.elastic.apm.agent.jdbc.helper.JdbcHelper#createJdbcSpan)
- JDBC spans usually set
context.destination.service.resource to ConnectionMetaData.getDbVendor() (see co.elastic.apm.agent.jdbc.helper.JdbcHelper#createJdbcSpan)
Expected behavior
For a Postgres db named test context.destination.service.resource should be postgresql/test
Describe the bug
According to elastic/apm#465
context.destination.service.resourceshould be${subtype}/${instance}(or${type}/${instance}if subtype is null) for a JDBC Span, e.g. for a postgresql db named test:postgresql/test. However,context.destination.service.resourceis only${subtype}(or${type}), resp.postgresqlin the example above.The algorithm in
co.elastic.apm.agent.impl.transaction.Span#beforeEndis not working because:co.elastic.apm.agent.jdbc.helper.JdbcHelper#createJdbcSpan)context.destination.service.resourcetoConnectionMetaData.getDbVendor()(seeco.elastic.apm.agent.jdbc.helper.JdbcHelper#createJdbcSpan)Expected behavior
For a Postgres db named test
context.destination.service.resourceshould bepostgresql/test