Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Bump opentracingVersion to latest#131

Merged
black-adder merged 6 commits intomasterfrom
support_newer_api
Mar 20, 2017
Merged

Bump opentracingVersion to latest#131
black-adder merged 6 commits intomasterfrom
support_newer_api

Conversation

@black-adder
Copy link
Copy Markdown
Contributor

No description provided.

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

interesting, I didn't do this manually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you need to fix your IDE formatter. I think readme has links to IntelliJ settings

if (logs == null) {
this.logs = new ArrayList<>();
}
for (Map.Entry<String, ?> kv : fields.entrySet()) {
Copy link
Copy Markdown
Contributor Author

@black-adder black-adder Mar 10, 2017

Choose a reason for hiding this comment

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

The intended use for jaeger log fields are that each log can be associated with multiple tags. Here, I'm creating a new log for each tag. In the JaegerThriftConverter I can add a special case for when the value is a map and generate multiple tags for the same log.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

-1. A log record is a timestamp + a set of fields.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

also, we don't want to do the conversion of fields here, we just want to stash the map somewhere and only do conversion when the span is reported.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 10, 2017

Codecov Report

Merging #131 into master will increase coverage by 0.11%.
The diff coverage is 77.14%.

@@             Coverage Diff              @@
##             master     #131      +/-   ##
============================================
+ Coverage     81.35%   81.46%   +0.11%     
- Complexity      512      524      +12     
============================================
  Files            90       90              
  Lines          1936     1964      +28     
  Branches        189      196       +7     
============================================
+ Hits           1575     1600      +25     
- Misses          270      271       +1     
- Partials         91       93       +2
Impacted Files Coverage Δ Complexity Δ
...java/com/uber/jaeger/dropwizard/Configuration.java 50% <0%> (ø) 3 <0> (ø) ⬇️
...er-core/src/main/java/com/uber/jaeger/LogData.java 100% <100%> (ø) 6 <2> (+2) ⬆️
...aeger-core/src/main/java/com/uber/jaeger/Span.java 80% <68.75%> (-1.09%) 49 <5> (+7)
...reporters/protocols/JaegerThriftSpanConverter.java 91.07% <81.81%> (+1.07%) 16 <5> (+2) ⬆️
.../uber/jaeger/samplers/RemoteControlledSampler.java 92.85% <0%> (+1.42%) 19% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 201762c...00d1c61. Read the comment docs.

Copy link
Copy Markdown
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

log handing is incorrect

build.gradle Outdated


ext.opentracingVersion = '0.15.0'
ext.opentracingVersion = '0.20.9'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there may be 0.20.10

if (context.isSampled()) {
if (logs == null) {
this.logs = new ArrayList<>();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Self-inflicted inefficiency here, you reuse (String, Object) signature and then are forced to check for instanceof Map. Not to mention that there may be a payload that's a map.

I suggest simply having another constructor for LogData that stores Map<String, ?> fields proper.

if (logData.getFields() != null) {
jLog.setFields(buildTags(logData.getFields()));
} else {
final Tag tag = buildTag(logData.getMessage(), logData.getPayload());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is incorrect. Should be "event": message, "payload": payload (and drop either if null)

}

@Override
public Span log(long instantMicroseconds, String message, /* @Nullable */ Object payload) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

given that this function is deprecated, I'm not going to do a check here to see if the payload is a map.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wasn't suggesting it. Payload as map should be stringified as any other object.


public Object getPayload() {
return payload;
LogData(long time, Map fields) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add generics?

@felixbarny felixbarny mentioned this pull request Mar 19, 2017
@yurishkuro
Copy link
Copy Markdown
Member

@black-adder did you cover the new methods? why did coverage go down?

@black-adder
Copy link
Copy Markdown
Contributor Author

I'm gonna go ahead and land this, the code that isnt covered wasn't covered before but I moved it one line down and all hell broke loose. Will add followup PR to cover the rest.

@black-adder black-adder merged commit 1b13636 into master Mar 20, 2017
@black-adder black-adder deleted the support_newer_api branch March 20, 2017 15:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants