-
Notifications
You must be signed in to change notification settings - Fork 37
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
Auto-detect service name from web.xml display-name #886
Auto-detect service name from web.xml display-name #886
Conversation
if (ServiceNameDetector.serviceNameNotConfigured(config)) { | ||
String serviceName = ServiceNameDetector.detectServiceName(); | ||
if (serviceName != null) { | ||
log.info("Auto-detected service name '{}'.", serviceName); |
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.
should we also log some kind of description (path to the web.xml?) based on what we auto-detected?
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.
If it's not too much trouble, then why not -- it'd make our lives easier. I'd log it at debug though, some customers are kinda sensitive to the amount of logs printed by the agent.
custom/src/main/java/com/splunk/opentelemetry/servicename/LibertyServiceNameDetector.java
Show resolved
Hide resolved
|
||
@Override | ||
Path getDeploymentDir() throws URISyntaxException { | ||
Path rootDir = getRootDir(); |
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.
our test uses webapps directory so this isn't tested
custom/src/main/java/com/splunk/opentelemetry/servicename/WebSphereServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/WildflyServiceNameDetector.java
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/JettyServiceNameDetector.java
Show resolved
Hide resolved
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.
This is awesome 👍
Even if it's only a fraction of all possible ways to deploy servlet apps, I think it's more than enough to get us started with this -- all other cases would be covered on demand (or not at all, if they're too insane)
custom/src/main/java/com/splunk/opentelemetry/SplunkConfiguration.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/ServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/AppServerServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/AppServerServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/AppServerServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/TomeeServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/TomeeServiceNameDetector.java
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/LibertyServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/WebSphereServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/WebSphereServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/AppServerServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/AppServerServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/WebSphereServiceNameDetector.java
Outdated
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/AppServerServiceNameDetector.java
Show resolved
Hide resolved
smoke-tests/src/test/java/com/splunk/opentelemetry/SmokeTest.java
Outdated
Show resolved
Hide resolved
smoke-tests/src/test/java/com/splunk/opentelemetry/WebSphereSmokeTest.java
Show resolved
Hide resolved
custom/src/main/java/com/splunk/opentelemetry/servicename/JettyServiceNameDetector.java
Show resolved
Hide resolved
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
|
||
public class AppServerServiceNameDetectorTest { |
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 don't think this is really a unit test because it does so much with the environment and tests across detectors. Feels like an integration test to me. Is there a better home for this?
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.
It does not test across detectors. It only test logic in the base detector class.
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.
Agree with others that this is fantastic! I would have loved to see it broken up into more bite sized PRs for reviewing, but great anyway. 👍🏻
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.
Looks great! 👍
custom/src/main/java/com/splunk/opentelemetry/servicename/ServiceNameResourceProvider.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
…iceNameResourceProvider.java Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
717f4b2
to
2d570ec
Compare
No description provided.