Handle list#43
Conversation
* Add Support for multiple object names & add test for it
|
Provided a comment on the parent issue #42 (comment) that could effect approach. Overall this seems ok to me though depending on your thoughts. Would you be willing to modify this test and its groovy script to utilize your thread pools mbean use case? https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/jmx-metrics/src/test/groovy/io/opentelemetry/contrib/jmxmetrics/OtlpIntegrationTests.groovy |
@rmfitzpatrick I've updated the test and moved it up to the newest version. I was wondering if you could approve the CI. Thanks! |
| Gauge datapoints = metric.gauge | ||
| then: 'they are of the expected size' | ||
| datapoints.dataPointsCount == 1 | ||
| datapoints.dataPointsCount == 44 |
There was a problem hiding this comment.
I'm not sure if this is related to intermediary proto changes but the number of datapoints is now more manageable. Would you mind adding more complete content validation?
There was a problem hiding this comment.
It may be preferable overall to keep the existing integration tests as they were and add another for this feature.
There was a problem hiding this comment.
moved to a separate test but had to modify the signature for configureContainers to allow me to pass in my own script.
|
Altered script and test to make metrics more predictable. It was passing locally but not on actions. |
|
After testing it seems that the actions are failing through a lack of resources. The tests pass locally if docker is given enough resources but I get the same errors if I reduce the amount of memory given to docker down to 2GB. I was wondering if you had any ideas to help reduce parallelism so that the tests aren't using all of the resources available. @rmfitzpatrick |
|
@Mrod1598, could you try restricting the worker count for the integration test action like was done previously? #41 (comment). Overall better helper logic around waiting for expected metrics is needed and I will try to take care of this in the near future, but that shouldn't block this. I think it would also be helpful if you incorporated main changes/rebased to ensure this PR is still compatible with recent updates. |
Sorry, forgot to mention that I tried restricting the worker count and it doesn't seem to help locally either. any other suggestions? |
|
@rmfitzpatrick seems the new way to handle the tests seemed to work |
|
@rmfitzpatrick Is there anything that could be done to help move this forward? |
| ]) | ||
| otel.instrument(helper, "cassandra.current_tasks", "Number of tasks in queue with the given task status.", "1", | ||
| ["stage_name":{ mbean -> mbean.name().getKeyProperty("scope")}, | ||
| "task_status":{ mbean -> mbean.name().getKeyProperty("name")}], |
There was a problem hiding this comment.
Nice! This makes me wonder if there's any existing JMX metrics we should cleanup (after this PR) to better match semantic-conventions or latest metric-naming-guidance.
There was a problem hiding this comment.
definitely have some ideas moving forward.
anuraaga
left a comment
There was a problem hiding this comment.
@rmfitzpatrick Can you take another look at this? Would be good to verify the new groovy API
.github/workflows/pr-build.yml
Outdated
| name: Integration Tests | ||
| with: | ||
| arguments: --stacktrace integrationTest | ||
| arguments: --stacktrace --max-workers 1 integrationTest |
There was a problem hiding this comment.
Can you revert this? Don't think it's needed anymore
| import org.testcontainers.junit.jupiter.Container; | ||
| import org.testcontainers.utility.MountableFile; | ||
|
|
||
| class MultiObjTest extends AbstractIntegrationTest { |
There was a problem hiding this comment.
Since this looks like a new feature of the helper rather than a new backend integration I think it's better not to add yet another integration test to make sure they don't get too slow.
How about adding unit test to instrumenthelpertest and modifying the existing Cassandra test to exercise this?
There was a problem hiding this comment.
here I had originally setup a modified version of the cassandra test and was told to revert it and add an additional test.
There was a problem hiding this comment.
My second request to keep the single mbean integration test as is and add a new one with multiples was to preserve the datapoint validation that was being removed in favor of a simple size check that was apparently flakey.
There was a problem hiding this comment.
I'm personally a fan of integration tests but can understand not want to balloon CI and dev times. If there is to be a unit test instead of the current approach I think checking the functionality of the InstrumentHelper with multi-mbean MBeanHelper would be a good way forward.
There was a problem hiding this comment.
So, can this be merged? or are the changes required to be unit tests? @rmfitzpatrick
There was a problem hiding this comment.
@anuraaga are you ok with the changes as is? Improving coverage could be a future item.
There was a problem hiding this comment.
I'd like to have the test change made yes - it's why I left a comment :P The integration tests are already up to 5 min compared to 2 for unit tests so I don't want to continue trending up.
There was a problem hiding this comment.
Added the Unit test and removed the integration test
|
@rmfitzpatrick Could this be merged? |
|
@Mrod1598 thanks for updating. Would you be open to expanding the instrument helper tests a bit as mentioned earlier? https://github.com/observIQ/opentelemetry-java-contrib/pull/2 |
…r_test Add multiple object name instrument helper test
Yes, I appreciate that |
|
Was hoping to merge main for you but looks like I don't have access to update the branch |
yeah sorry about that didn't notice the issue with the merge. should be good to go now tho. |
Description:
Resolves #42 through the proposed solution of adding the ability to pass in multiple Object Names to better support adding additional mbeans under the same metric name.
Existing Issue(s):
#42
Testing:
Added test that defines multiple mbeans and then pulls those mbeans out using multiple object names.
Documentation:
Documented the new signature of
otel.mbeans