# Issue Creating a Custom Metricset

**URL:** <https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [October 26, 2020, 6:51pm UTC](https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358 "2020-10-26T18:51:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![traw1234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/traw1234/32/77094_2.png) [@traw1234](https://discuss.elastic.co/u/traw1234)\
**Post date:** [October 26, 2020, 6:51pm UTC](https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358/1 "2020-10-26T18:51:32Z")

</div>

I am working to create a custom metricset for Metricbeat but am having difficulty with the documentation. I am following the guide [here](https://www.elastic.co/guide/en/beats/devguide/current/metricbeat-developer-guide.html), have installed `go`, `mage`, ran `go get` for the beats repo, am writing the module within my `$GOPATH`, etc etc.

I have no issues running `make create-metricset` and can verify that it ends up creating the module within `module/{module}` as well as a metricset in `module/{module}/{metricset}/`. The issue is, when it says to run `make collect` and `make` ([here](https://www.elastic.co/guide/en/beats/devguide/current/creating-metricsets.html)), I get the error:

`make: *** No rule to make target `collect'. Stop.`

When looking at the [Makefile](https://github.com/elastic/beats/blob/master/metricbeat/Makefile), it seems like there is no command `collect`. When I try to run `make`, I get

`Use mage rather than make. Here are the available mage targets:`

So instead of using `make`, I tried doing the following:

```auto
mage collectAll
mage build

```

Now, this works and compiles me a binary that runs metricbeat successfully (`./metricbeat -e`). However, the module/metricset I created are not recognized:

```auto
2020-10-26T14:51:00.604-0400	INFO	instance/beat.go:423	metricbeat stopped.
2020-10-26T14:51:00.604-0400	ERROR	instance/beat.go:940	Exiting: 1 error: metricset 'metricsd/server' not found
Exiting: 1 error: metricset 'metricsd/server' not found

```

I was wondering, is this an issue with outdated docs? Is there a new process, or am I missing something here?

---

<div class="post-metadata">

**Author:** ![Alex\_Kristiansen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_kristiansen/32/46086_2.png) [@Alex\_Kristiansen](https://discuss.elastic.co/u/Alex_Kristiansen)\
**Post date:** [October 26, 2020, 8:22pm UTC](https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358/2 "2020-10-26T20:22:42Z")

</div>

It looks like the docs might be a little out of date. Try `mage update` in the metricbeat directory, and see how that works.

---

<div class="post-metadata">

**Author:** ![traw1234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/traw1234/32/77094_2.png) [@traw1234](https://discuss.elastic.co/u/traw1234)\
**Post date:** [October 26, 2020, 9:05pm UTC](https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358/3 "2020-10-26T21:05:54Z")

</div>

Works perfectly, thanks!

---

<div class="post-metadata">

**Author:** ![traw1234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/traw1234/32/77094_2.png) [@traw1234](https://discuss.elastic.co/u/traw1234)\
**Post date:** [October 27, 2020, 3:29pm UTC](https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358/4 "2020-10-27T15:29:28Z")

</div>

Just out of curiosity, if I "fork" previous metricsets on Metricbeat to create my own metricset, am I violating the Elastic License? If so, what's the best way to "learn" how to create one?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 24, 2020, 5:29pm UTC](https://discuss.elastic.co/t/issue-creating-a-custom-metricset/253358/5 "2020-11-24T17:29:29Z")

</div>

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