Skip to content

Conversation

marcingrzejszczak
Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Oct 22, 2021

@spencergibb
Copy link
Member

Nice!

Copy link
Member

@jonatan-ivanov jonatan-ivanov left a comment

Choose a reason for hiding this comment

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

There might be a conflict between sync and async driver config, the tests are failing with:

org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.IllegalArgumentException: The contextProvider must be an instance of com.mongodb.client.SynchronousContextProvider when using the synchronous driver

import org.bson.BsonDocument;
import org.junit.jupiter.api.Test;
import org.mockito.BDDMockito;
import org.mockito.Mockito;
Copy link
Member

Choose a reason for hiding this comment

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

Should we replace BDDMockito and BDDAssertions whenever we see them?

childSpanBuilder.remoteIpAndPort(socketAddress.getAddress().getHostAddress(), socketAddress.getPort());
}
catch (MongoSocketException ignored) {

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we emit a DEBUG log here?

private final Map<Object, Object> map = new ConcurrentHashMap<>();

TraceRequestContext(ContextView context) {
context.stream().forEach(entry -> map.put(entry.getKey(), entry.getValue()));
Copy link
Member

Choose a reason for hiding this comment

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

How about creating the map here:

Suggested change
context.stream().forEach(entry -> map.put(entry.getKey(), entry.getValue()));
map = context.stream().collect(Collectors.toMap(entry::getKey, entry::getValue));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants