I'm trying to build new integration

You can use the CLI to collect the diagnostics.

If you are collecting metrics via beat, I believe you were making use of metricbeat modules and metricsets for your use case.
When creating integration, you need to define metricsets in your input configuration. You can refer to an existing integration such as ActiveMQ on how to define modules and metricsets