# Metricbeat autodiscover hints for MySQL

**URL:** <https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575>\
**Category:** Beats\
**Tags:** docker, metricbeat\
**Created:** [December 12, 2019, 7:02am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575 "2019-12-12T07:02:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stingus](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@stingus](https://discuss.elastic.co/u/stingus)\
**Post date:** [December 12, 2019, 7:02am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/1 "2019-12-12T07:02:13Z")

</div>

I'm looking for a way to setup auto-discovery based on docker hints for MySQL, as described here: [https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-autodiscover-hints.html](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-autodiscover-hints.html)

How can I set the MySQL user and password supported by the module ([https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-mysql.html](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-mysql.html)), but using the labels instead? There are only a few labels supported as hints and I would like delegate to the configuration to the target, and not the metricbeat instance.

Thanks!

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [December 12, 2019, 10:26am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/2 "2019-12-12T10:26:34Z")

</div>

Hi @stingus,

how about using [`co.elastic.metrics/raw`](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-autodiscover-hints.html#_co_elastic_metricsraw)?

---

<div class="post-metadata">

**Author:** ![stingus](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@stingus](https://discuss.elastic.co/u/stingus)\
**Post date:** [December 14, 2019, 4:46am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/3 "2019-12-14T04:46:06Z")

</div>

Seems that not all json keys/values are parsed from co.elastic.metrics/raw. Tried to set the `user` key but its value isn't passed to the module. So my guess is that only accepted keys are the ones listed on the [hints based autodiscovery page](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-autodiscover-hints.html).

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [December 16, 2019, 9:28am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/4 "2019-12-16T09:28:22Z")

</div>

Hey,

tried to reproduce it (with mongodb module) and I can see the `username` config to be set.

Could you check that your hints are correct. The key is [`username`](https://github.com/elastic/beats/blob/ba8a45e6726525ed4d4fbbaaef7daaaee89b9b66/metricbeat/module/mysql/_meta/config.reference.yml#L15) and not `user` just in case.

In any case we should consider adding username/password to known hints list. I will open a Github issue for this. Thanks for bringing this up!

Regards!

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [December 16, 2019, 9:56am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/5 "2019-12-16T09:56:09Z")

</div>

Fyi github issue: [https://github.com/elastic/beats/issues/15115](https://github.com/elastic/beats/issues/15115)

---

<div class="post-metadata">

**Author:** ![stingus](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@stingus](https://discuss.elastic.co/u/stingus)\
**Post date:** [December 31, 2019, 10:33am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/6 "2019-12-31T10:33:09Z")

</div>

Thanks @ChrsMark!

---

<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:** [January 28, 2020, 10:33am UTC](https://discuss.elastic.co/t/metricbeat-autodiscover-hints-for-mysql/211575/7 "2020-01-28T10:33:12Z")

</div>

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