Skip to content

Conversation

shakuzen
Copy link
Member

This will catch issues in the implementation of instrumentation. For example, if the carrier is set after an Observation is started, this new test will not pass.

Server equivalent of #3504

This will catch issues in the implementation of instrumentation. For example, if the carrier is set after an Observation is started, this new test will not pass.
@shakuzen shakuzen added type: task A general task module: micrometer-test An issue that is related to our TCK labels Oct 28, 2022
@shakuzen shakuzen added this to the 1.10.0 milestone Oct 28, 2022
@@ -36,7 +36,7 @@ public class JerseyContext extends RequestReplyReceiverContext<ContainerRequest,
public JerseyContext(RequestEvent requestEvent) {
super((carrier, key) -> {
List<String> requestHeader = carrier.getRequestHeader(key);
if (requestHeader.isEmpty()) {
if (requestHeader == null || requestHeader.isEmpty()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A NPE was being thrown when trying to use the Getter on a key that wasn't in the headers. The above getRequestHeader returns null for an absent key.

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Oct 28, 2022

⚠️ 10 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

@shakuzen shakuzen merged commit c57883c into micrometer-metrics:main Oct 31, 2022
@shakuzen shakuzen deleted the server-context-prop-tck branch October 31, 2022 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: micrometer-test An issue that is related to our TCK type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants