# Embedding a custom beat in my application

**URL:** <https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362>\
**Category:** Beats\
**Tags:** beats-development\
**Created:** [March 16, 2018, 7:16pm UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362 "2018-03-16T19:16:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkaeding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkaeding/32/12454_2.png) [@pkaeding](https://discuss.elastic.co/u/pkaeding)\
**Post date:** [March 16, 2018, 7:16pm UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/1 "2018-03-16T19:16:43Z")

</div>

I am exploring publishing metrics from my application to ES, and it looks like libbeat might be a good way to do this.

However, I'm having trouble seeing how to instantiate a `github.com/elastic/beats/libbeat/beat.Beat` to pass to the constructor of my custom `github.com/elastic/beats/libbeat/beat.Beater`. All of the examples I can find are for building a standalone monitoring application that reads config files, etc.

Am I wrong that libbeat could help me here? Can anyone point me to a similar use case?

Thanks!

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [March 19, 2018, 6:36am UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/2 "2018-03-19T06:36:39Z")

</div>

Libbeat so far is definitively focused to make building a Beat but publisher and all other functionality is inside.

Can you perhaps share a bit more details on what the exact features are you are looking for?

---

<div class="post-metadata">

**Author:** ![wklken](https://avatars.discourse-cdn.com/v4/letter/w/cab0a1/32.png) [@wklken](https://discuss.elastic.co/u/wklken)\
**Post date:** [March 21, 2018, 9:58am UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/3 "2018-03-21T09:58:12Z")

</div>

hi ruflin,  
I want to develop a output-plugins (will publish all events to my own service via that output) in a beat, is there any guide or doc?

thanks!

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [March 22, 2018, 1:57pm UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/4 "2018-03-22T13:57:43Z")

</div>

Have a look at this thread here: [How to create a new Beats output?](https://discuss.elastic.co/t/how-to-create-a-new-beats-output/61074/9)

It's a bit outdated as lots of things in the interfaces used changed with 6.0. I would recommend you to have a look at one of the simpler outputs like the file output to see what the minimal interfaces are that are required. [https://github.com/elastic/beats/tree/master/libbeat/outputs/fileout](https://github.com/elastic/beats/tree/master/libbeat/outputs/fileout)

---

<div class="post-metadata">

**Author:** ![wklken](https://avatars.discourse-cdn.com/v4/letter/w/cab0a1/32.png) [@wklken](https://discuss.elastic.co/u/wklken)\
**Post date:** [March 23, 2018, 1:42am UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/5 "2018-03-23T01:42:55Z")

</div>

Great, that's helpful! Thank you!

---

<div class="post-metadata">

**Author:** ![pkaeding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkaeding/32/12454_2.png) [@pkaeding](https://discuss.elastic.co/u/pkaeding)\
**Post date:** [March 23, 2018, 7:08pm UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/6 "2018-03-23T19:08:44Z")

</div>

Right now, we send lots of metrics on everything in our application to graphite (using [go-metrics](https://github.com/rcrowley/go-metrics)). However, we are experiencing some growing pains with graphite, so I wanted to explore using ES as the backend for this. I thought embedding beats into our application (in place of [go-metrics-graphite](https://github.com/cyberdelia/go-metrics-graphite)) would make sense, but maybe it isn't a good fit.

Thanks for helping clarify!

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [March 26, 2018, 7:22am UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/7 "2018-03-26T07:22:03Z")

</div>

It probably can be done but is not really what beats was designed for.

If you are looking for a library that you can to send data to Elasticsearch (through apm-server) have a look at our go apm agent: [https://github.com/elastic/apm-agent-go](https://github.com/elastic/apm-agent-go) It does not support yet metrics but should happen in the future.

As I'm very interested on how people want to send metrics to ES can you perhaps share some more details on the metrics you generate? To you aggregate them on the client side or send one event for each? What is the structure of the metric events you send out?

---

<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:** [April 23, 2018, 7:22am UTC](https://discuss.elastic.co/t/embedding-a-custom-beat-in-my-application/124362/8 "2018-04-23T07:22:17Z")

</div>

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