I'm trying to build new integration

hello, i'm trying to create new integration for collecting k6 metrics via rest api. I just don't understand how can i test my integration i mean i'm trying to connect k6 but idk how can i see it? is there a command for that? when i was making beat i just run ./k6beat command and it shows logs so i can see if it's connecting k6 but now i'm working on integration and don't know how to check this. hope someone will help me.


I just don't understand how can i test my integration

There are several tests you can add to your integration like pipeline tests, system tests, etc. You can refer to elastic-package/docs/howto at main · elastic/elastic-package · GitHub for adding these tests.

i mean i'm trying to connect k6 but idk how can i see it?
i'm working on integration and don't know how to check this.

You can check in the Elastic Agent debug logs if you are able to get response via the API and publish them to Elasticsearch and/or if there are any errors. Then you can either SSH into the Elastic Agent and check logs or collect Elastic Agent diagnostics which contain the debug logs.

For a fleet-managed Elastic Agent, to enable the debug logs, you can navigate to Management -> Fleet -> Select agent -> Click Logs tab -> In the drop-down at the bottom of the screen, choose Debug for Agent logging level.
For standalone agent, you can change agent.logging.level.

For collecting diagnostics, you can follow this guide to collect the agent diagnostics.

Hope this helps!

Thank you so much for your reply!! Yes i want to check Elastic Agent debug logs but is there any command for me to do it? I only wanna use terminal. And i wonder if it is the right way to collect k6 metrics by using integrations. K6 collecting metrics periodically for example there is a script file and if you configure time when the time end it stops. So k6 service doesn't produce metrics everytime. I guess it's about index modes. Hope you can understand what i want to tell. My English is kinda bad.


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

actually i don't use metricsets. Actually i was trying to create metricbeat for k6 service and someone told me beats are deprecated. And suggest i should create integration that's why i'm having a hard time creating it. I have codes for that beat. Should i make a PR? And if they accept it then i will start to make integration.


Okay, I was going through your linked post.
If I understand correctly, instead of adding a metricbeat's module & metricsets (for example memcached) for your k6 service, you are trying to create a new community beat called k6beat. I do not understand why though.

The problem with your community beats is that as mentioned in the documentation, the custom beat generation tool is deprecated and also you can't make Elastic Agent integrations based on community beats. Elastic Agent integrations are based on existing beats such as filebeat, metricbeat, etc.

What I would suggest for your k6 metrics is that:

  1. Raise PR for your k6 module with metricbeat: Creating a Metricbeat Module | Beats Developer Guide [master] | Elastic.
  2. Once that is merged into metricbeat, then define the Elastic Agent configuration with your new module: elastic-agent/specs/metricbeat.spec.yml at main · elastic/elastic-agent · GitHub
  3. Create an Elastic Agent integration named K6 using this metricbeat module definition. You can refer to my previous comment I'm trying to build new integration - #6 by kcreddy on how to utilize a module definition while creating integration.

Thank you so much for your help and guide. I am trying to improve myself that's why i was trying to do that project. If elasticsearch needs other services module and integration i'd like to work on them too. Again thank you so much it really helps me a lot!!

Happy to help :smile:
Thanks for expressing your interest in contributing. We welcome PRs from our community members :elasticheart:
You could check out some of the issues that are labelled good first issue in beats and integrations repository.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.