Conversation
Codecov Report
@@ Coverage Diff @@
## master #976 +/- ##
============================================
+ Coverage 63.23% 63.72% +0.48%
Complexity 85 85
============================================
Files 252 255 +3
Lines 10193 10482 +289
Branches 1345 1391 +46
============================================
+ Hits 6446 6680 +234
- Misses 3364 3393 +29
- Partials 383 409 +26
Continue to review full report at Codecov.
|
|
Some general questions:
|
May be only relevant for HTTP URLs, but maybe there are things agents need to take care differently anyway in this sense (eg IPv6 with/without square brackets ?). For DB- those are JDBC-specific URLs AFAIU.
What's missing from the GH issues?
The |
felixbarny
left a comment
There was a problem hiding this comment.
To make sure we don't forget adding destination.* fields going forward, check the presence of those fields in MockReporter.reportSpan if it's an external span. For those span types where we can't determine the destination fields, like Hibernate search, maintain an exclude list. Nice to have: If the test fails the error message should link to the spec/issue to read up on how the fields should be populated.
Overall a bit more complex than what I was expecting/hoping for but seems to be inherent complexity as opposed to accidental. Some examples:
- Some HTTP clients use square brackets for IPV6 addresses, some don't
- JDBC parsing is quite complex and highly specific to the vendor
This is also a thing to always keep in mind when adding new integrations (no judgment, just an observation).
...ugins/apm-jdbc-plugin/src/main/java/co/elastic/apm/agent/jdbc/helper/ConnectionMetaData.java
Show resolved
Hide resolved
apm-agent-plugins/apm-jdbc-plugin/src/test/java/co/elastic/apm/agent/jdbc/JdbcDbIT.java
Outdated
Show resolved
Hide resolved
.../apm-mongoclient-plugin/src/main/java/co/elastic/apm/agent/mongoclient/ConnectionAdvice.java
Show resolved
Hide resolved
...in/apm-jedis-plugin/src/main/java/co/elastic/apm/agent/redis/jedis/JedisInstrumentation.java
Show resolved
Hide resolved
apm-agent-core/src/main/java/co/elastic/apm/agent/impl/context/Destination.java
Show resolved
Hide resolved
Good idea, will do.
I did expect some complexity due to the reasons you listed, as well as the fact that you need to look in different places in different frameworks. In addition, trying to avoid allocations or expensive lookups, you need to be specific on where you get the info, for example in some cases you it's cheapest to use a ready URL and in others it's best to get the host and port. But certainly more complex than I wanted it to be...
True, but your suggestion to fail tests when not setting these fields should remind us. |
Closes #934
Closes #957
Closes #969
Some technology-specific info:
For example- the Oracle address list parenthesis syntax or MySQL's multiple host configuration. If those are required, we can add them in the future.
((ActiveMQMessageProducer) producer).session.getConnection().getTransport().getRemoteAddress()returns a String that we can use to create a URI, from which host and port can be extracted.((TopologyMember)((ActiveMQMessageProducer)producer).connection.getSessionFactory().getServerLocator().getTopology().getMembers().toArray()[0]).toURI()returns a String that we can use to create a URI, from which host and port of one broker node can be extracted. If multiple destinations are configured, this is not enough to get the actual address used for a specific connection.Checklist