Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upConsul Node Metadata missing #5044
Comments
This comment has been minimized.
This comment has been minimized.
|
You need to update to a more recent version of Prometheus. Metadata is available since v2.4.0. |
simonpasquier
closed this
Jan 2, 2019
This comment has been minimized.
This comment has been minimized.
|
@simonpasquier 2.4.0 introduced Service metadata support. The metadata I'm attempting to access is node metadata, which has been around since 1.8.0: https://github.com/prometheus/prometheus/blob/master/CHANGELOG.md#180--2017-10-06 In addition, this works on the other prometheus servers I have in other dc's that are all running 2.3.2. This particular issue is only happening on this host, and seems to be a prometheus issue because i'm able to obtain the node meta from consul directly. |
simonpasquier
added
the
component/service discovery
label
Jan 4, 2019
simonpasquier
reopened this
Jan 4, 2019
This comment has been minimized.
This comment has been minimized.
|
Can you share a screenshot of the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I tried to reproduce on my local machine and node's metadata shows as expected. Maybe you can try to capture the traffic between Prometheus and Consul with tcpdump (or similar tool)? |
This comment has been minimized.
This comment has been minimized.
|
I'm seeing this same behavior (NodeMeta sometimes goes missing) from my debugging I found that the issue was consul sometimes returning a |
This comment has been minimized.
This comment has been minimized.
|
Maybe we should treat |
This comment has been minimized.
This comment has been minimized.
|
|
simonpasquier
added
the
kind/bug
label
Jan 22, 2019
This comment has been minimized.
This comment has been minimized.
|
Right at the moment they're the same. I'm suggesting we (or @jacksontj if he's interested) could look into whether we get |
This comment has been minimized.
This comment has been minimized.
|
We just finished an upgrade to consul 1.4 (to pick up the fix in the upstream issue). After the upgrade we are no longer seeing the issue! So if you are running into the issue I suggest upgrading consul -- and assuming that works for you as well its probably not worth trying to add workarounds in the code since it is an upstream bug in consul |
This comment has been minimized.
This comment has been minimized.
|
Thanks @jacksontj! I agree with you that we shouldn't try to hack around a Consul bug that's been fixed. |

Zenebatos commentedDec 27, 2018
•
edited
Bug Report
What did you do?
I configured some nodes in consul to have metadata attached to them. Below is a sample node config(that also happens to be a server):
I was able to properly query consul to give me the host's metadata:
I then configured prometheus with some service discovery and relabel configs for myservice
What did you expect to see?
I expected that, under /service-discovery , my job would include a discovered label for each node metadata that I exposed via consul.
What did you see instead? Under which circumstances?
The node metadata was missing from my job. I expected to see entries like
__meta_consul_metadata_envand__meta_consul_metadata_pop. Other metadata like__meta_consul_service,__meta_consul_service_port, and__meta_consul_dcwas present.Environment
I have both prometheus and consul running as docker containers each using host networking mode. Both containers have their config and data dirs mounted as volumes on the main host.
uname -srm
Linux 3.10.0-693.2.2.el7.x86_64 x86_64centos-release
centos-release-7-4.1708.el7.centos.x86_64consul version
Consul v1.0.7Issue was also reproduced on the same server but the below prometheus version running in a different container w/ the same config as the above prometheus instance:
I ran this in debug mode but no relevant discovery logs were outputted