hashicorp / hashicorp/consul-template

Add API function to fetch session metadata

Open
#2,003 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
4.8k
Forks
801
Avg merge
4h 5m
Merged PRs (30d)
6

Description

Consul-template allows fetching the contents of a KV through the `key` function, but as far as I can tell there is no way to get the metadata from an associated [session](https://developer.hashicorp.com/consul/docs/dynamic-app-config/sessions).
It would be nice to have a function that gets the metadata of a session coupled to a KV entry (e.g. `{{ session "my/kv/path" }}`) in a way like the `service` function exposes things.

Useful information in session metadata includes the NodeID of the node holding the session, and service health check ID's. These can be re-used with the `node` and `service` functions respectively.

Relevant api docs:
https://developer.hashicorp.com/consul/api-docs/kv
https://developer.hashicorp.com/consul/api-docs/session

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.