- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1k
 
Library readmes - batch 2 #14631
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
Library readmes - batch 2 #14631
Conversation
| import io.opentelemetry.api.OpenTelemetry; | ||
| import io.opentelemetry.instrumentation.jmx.engine.JmxMetricInsight; | ||
| import io.opentelemetry.instrumentation.jmx.engine.MetricConfiguration; | ||
| 
               | 
          ||
| // Get an OpenTelemetry instance | ||
| OpenTelemetry openTelemetry = ...; | ||
| 
               | 
          ||
| JmxMetricInsight jmxMetricInsight = JmxMetricInsight.createService(openTelemetry, 5000); | ||
| 
               | 
          ||
| // Configure your JMX metrics | ||
| MetricConfiguration config = new MetricConfiguration(); | ||
| 
               | 
          ||
| jmxMetricInsight.startLocal(config); | 
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.
Unfortunately this does not conform to our usual practices. @SylvainJuge any plans to make this similar to our other library instrumentations?
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.
What do you mean exactly here ? Is it packaging the JMX metrics feature to be similar to other library components in the instrumentation repository ? For example support for auto-configuration or fitting an "idiomatic way" to setup and initialize ?
For example, there is currently no way to properly shut-down or disable the feature at runtime, which could be problematic in some case if we want to provide the ability to automatically re-connect to a remote JVM (which is not the case when executed locally within the JVM).
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.
Other library instrumentations use have Telemetry/TelemetryBuilder as public api classes that users should interact with, idk if the same pattern would work here. Our library instrumentations provide minimal public api, this module has a bunch of public classes, are all of these intended to serve as the public api? If not you could move them to an internal package. The main package is io.opentelemetry.instrumentation.jmx.engine which does not match what other library insrumentations use.
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.
| .addLast(clientTelemetry.createRequestHandler()) | ||
| .addLast(clientTelemetry.createResponseHandler()); | 
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.
could use createCombinedHandler() to create both
| NettyClientTelemetry clientTelemetry = NettyClientTelemetry.create(openTelemetry); | ||
| 
               | 
          ||
| Bootstrap bootstrap = new Bootstrap(); | ||
| bootstrap.group(new NioEventLoopGroup()) | 
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.
idk if that matters but NioEventLoopGroup has been deprecated in netty 4.2
Contributes to #6947