Skip to content

Handle list#43

Merged
rmfitzpatrick merged 30 commits intoopen-telemetry:mainfrom
observIQ:handle-list
Oct 20, 2021
Merged

Handle list#43
rmfitzpatrick merged 30 commits intoopen-telemetry:mainfrom
observIQ:handle-list

Conversation

@Mrod1598
Copy link
Copy Markdown
Contributor

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

@Mrod1598 Mrod1598 marked this pull request as ready for review June 29, 2021 19:21
@rmfitzpatrick
Copy link
Copy Markdown
Contributor

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

@trask trask requested a review from a team July 6, 2021 16:52
@Mrod1598
Copy link
Copy Markdown
Contributor Author

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be preferable overall to keep the existing integration tests as they were and add another for this feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to a separate test but had to modify the signature for configureContainers to allow me to pass in my own script.

@Mrod1598
Copy link
Copy Markdown
Contributor Author

Mrod1598 commented Sep 9, 2021

Altered script and test to make metrics more predictable. It was passing locally but not on actions.

@Mrod1598
Copy link
Copy Markdown
Contributor Author

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

@rmfitzpatrick
Copy link
Copy Markdown
Contributor

@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.

@Mrod1598
Copy link
Copy Markdown
Contributor Author

@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?

@Mrod1598 Mrod1598 marked this pull request as draft September 30, 2021 14:47
@Mrod1598 Mrod1598 marked this pull request as ready for review October 7, 2021 13:15
@Mrod1598
Copy link
Copy Markdown
Contributor Author

Mrod1598 commented Oct 7, 2021

@rmfitzpatrick seems the new way to handle the tests seemed to work

@djaglowski
Copy link
Copy Markdown
Member

@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")}],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely have some ideas moving forward.

Copy link
Copy Markdown
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmfitzpatrick Can you take another look at this? Would be good to verify the new groovy API

name: Integration Tests
with:
arguments: --stacktrace integrationTest
arguments: --stacktrace --max-workers 1 integrationTest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this? Don't think it's needed anymore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.utility.MountableFile;

class MultiObjTest extends AbstractIntegrationTest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I had originally setup a modified version of the cassandra test and was told to revert it and add an additional test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, can this be merged? or are the changes required to be unit tests? @rmfitzpatrick

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anuraaga are you ok with the changes as is? Improving coverage could be a future item.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the Unit test and removed the integration test

@djaglowski
Copy link
Copy Markdown
Member

@rmfitzpatrick Could this be merged?

@rmfitzpatrick
Copy link
Copy Markdown
Contributor

@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
@Mrod1598
Copy link
Copy Markdown
Contributor Author

@Mrod1598 thanks for updating. Would you be open to expanding the instrument helper tests a bit as mentioned earlier? observIQ#2

Yes, I appreciate that

Copy link
Copy Markdown
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@anuraaga
Copy link
Copy Markdown
Contributor

Was hoping to merge main for you but looks like I don't have access to update the branch

@Mrod1598
Copy link
Copy Markdown
Contributor Author

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.

@rmfitzpatrick rmfitzpatrick merged commit 7184f00 into open-telemetry:main Oct 20, 2021
@Mrod1598 Mrod1598 deleted the handle-list branch October 20, 2021 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for Multiple ObjectNames

6 participants