-
Notifications
You must be signed in to change notification settings - Fork 325
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
Issue 1699 extend destination field #1788
Issue 1699 extend destination field #1788
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
Hey @kananindzya 👋 |
…-destination-field
…-destination-field
…elds from serializaiton. Deleted this field from public api.
apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java
Show resolved
Hide resolved
Blocked until elastic/apm#436 is finalized |
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.
Thanks (again) @kananindzya !
Some changes required, mostly minor ones.
Please add tests to verify that the destination.service.resource
provide through the API always take precedence, considering that it can be set before or after the resource was automatically set.
apm-agent-api/src/main/java/co/elastic/apm/api/AbstractSpanImpl.java
Outdated
Show resolved
Hide resolved
apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java
Outdated
Show resolved
Hide resolved
apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java
Outdated
Show resolved
Hide resolved
apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java
Outdated
Show resolved
Hide resolved
...apm-api-plugin/src/main/java/co/elastic/apm/agent/pluginapi/AbstractSpanInstrumentation.java
Outdated
Show resolved
Hide resolved
...apm-api-plugin/src/main/java/co/elastic/apm/agent/pluginapi/AbstractSpanInstrumentation.java
Outdated
Show resolved
Hide resolved
...apm-api-plugin/src/main/java/co/elastic/apm/agent/pluginapi/AbstractSpanInstrumentation.java
Outdated
Show resolved
Hide resolved
...ins/apm-api-plugin/src/test/java/co/elastic/apm/agent/pluginapi/SpanInstrumentationTest.java
Outdated
Show resolved
Hide resolved
@kananindzya would you like me to take over and apply these minor fixes? |
Hi @eyalkoren, after 30 min I will send changes. |
…-destination-field
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.
@kananindzya Thanks for the fixes! 🙏
There were some required fixes, including for tests and updating according to the latest spec changes, so I did these changes myself.
If you disagree with something in my latest commits, please let me know.
Thanks!
@Advice.Argument(1) int port) { | ||
if (context instanceof Span) { | ||
SpanContext spanContext = ((Span) context).getContext(); | ||
if (address != null && !address.isBlank()) { |
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.
isBlank()
is Java 11, we cannot use it
public String getType() { | ||
return type; | ||
} | ||
|
||
public boolean hasContent() { | ||
return resource.length() > 0 || name.length() > 0 || type != null; | ||
return resource.length() > 0; |
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.
userResource
should be taken into account as well
@@ -185,52 +186,75 @@ public Destination withInetAddress(InetAddress inetAddress) { | |||
*/ | |||
private final StringBuilder resource = new StringBuilder(); | |||
|
|||
private final StringBuilder userResource = new StringBuilder(); |
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.
Must be reset in resetState()
Instead of duplicating the properties for user-supplied values, would it be possible to either
|
@elasticmachine run elasticsearch-ci/docs |
What does this PR do?
closes #1699
Checklist