-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service name improvements #64
Conversation
@@ -116,7 +116,6 @@ Modern web application frameworks such as Dropwizard or Spring Boot are automati | |||
| Hibernate| 5.x | Please check the following [JDBC instrumentation](#jdbc-instrumentation) section | | |||
| [MongoDB](https://github.com/opentracing-contrib/java-mongo-driver) | 3.x | Intercepts all the calls from the MongoDB client | | |||
| [Cassandra](https://github.com/opentracing-contrib/java-cassandra-driver) | 3.2.x | Intercepts all the calls from the Cassandra client | | |||
| [Elasticsearch](https://github.com/opentracing-contrib/java-elasticsearch-client) | 5.4.x | Intercepts all the calls from the ES Transport client | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes let's work on it in another PR
I moved the 2 yaml files from dd-java-agent to dd-trace. The decorators are dd-trace stuff and automatically added when the tracer is initialized by the resolver. The dd-trace.yaml is more tricky. A part of the configuration is related to the dd-tracer (service name, writer, sampler) and another part is related to the java-agent (annotations, package ...) |
- type: HTTPComponent | ||
matchingValue: java-aws-sdk | ||
setValue: aws-client | ||
- type: URLAsResourceName | ||
# - type: URLAsResourceName # Performance issues, no URL generalisation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we may think to remove that one, or provide a different implementation. It would be great if in someway we can have something like /api/:id
rather than /api/42
, /api/43
and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gpolaert just one comment about it, otherwise I think it's a great improvement!
@@ -116,7 +116,6 @@ Modern web application frameworks such as Dropwizard or Spring Boot are automati | |||
| Hibernate| 5.x | Please check the following [JDBC instrumentation](#jdbc-instrumentation) section | | |||
| [MongoDB](https://github.com/opentracing-contrib/java-mongo-driver) | 3.x | Intercepts all the calls from the MongoDB client | | |||
| [Cassandra](https://github.com/opentracing-contrib/java-cassandra-driver) | 3.2.x | Intercepts all the calls from the Cassandra client | | |||
| [Elasticsearch](https://github.com/opentracing-contrib/java-elasticsearch-client) | 5.4.x | Intercepts all the calls from the ES Transport client | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes let's work on it in another PR
@@ -12,12 +12,12 @@ | |||
|
|||
public DBComponent() { | |||
super(); | |||
this.setMatchingTag(Tags.COMPONENT.getKey()); | |||
this.setMatchingTag(Tags.DB_TYPE.getKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! considering that this value is set when using OT JDBC module, I think it's a great default.
this.setSetTag(DDTags.SERVICE_NAME); | ||
} | ||
|
||
@Override | ||
public boolean afterSetTag(DDSpanContext context, String tag, Object value) { | ||
public boolean afterSetTag(final DDSpanContext context, final String tag, final Object value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a kind of optimization? why those arguments must be set as final
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's the save actions plugin rule. Final avoids some mistakes (but not all) related to object manipulations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to me so!
@@ -5,14 +5,8 @@ decorators: | |||
matchingValue: java-okhttp | |||
setValue: http-client | |||
- type: DBComponent | |||
matchingValue: java-mongo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By removing these values, it means that by default Tags.DB_TYPE
is used even for Mongo right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the behavior of this decorator.
Mongo, JDBC, Cassandra, ES decorate the DB_TYPE with the value we want.
So, I generalize the decorator.
Each time a DB_TYPE is set, the service name is set to the actual value.
This thing may change depending the way we provide a manual way to set the service name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
- type: HTTPComponent | ||
matchingValue: java-aws-sdk | ||
setValue: aws-client | ||
- type: URLAsResourceName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment I agree to remove it, since we should design better that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
this.setSetTag(DDTags.SERVICE_NAME); | ||
} | ||
|
||
@Override | ||
public boolean afterSetTag(DDSpanContext context, String tag, Object value) { | ||
public boolean afterSetTag(final DDSpanContext context, final String tag, final Object value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to me so!
@@ -5,14 +5,8 @@ decorators: | |||
matchingValue: java-okhttp | |||
setValue: http-client | |||
- type: DBComponent | |||
matchingValue: java-mongo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
@palazzem I added some comments, let me know if I merge or not this PR |
The aim to this PR is to improve how user set the service name for each contribution.
2 things to do:
1/ Set a default service name for common contribution
2/Add the ability for the users to override these defaults and keep the decorators logic hidden for them