-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VAULT-6368 Metrics-only listener for Agent #18101
Conversation
@@ -47,25 +48,6 @@ type SharedConfig struct { | |||
ClusterName string `hcl:"cluster_name"` | |||
} | |||
|
|||
// LoadConfigFile loads the configuration from the given file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two functions were not used anywhere, so I cleaned them up.
I have other things to get to before I review this, but just one question based on the description: why do we need Alternatively, maybe the top-level block should be named Also, can you look at the telemetry block in Vault server config and see what we should adopt from there? |
I had originally looked at potentially creating a So, to the point of: I'd rather not diverge the Agent listener config from the Vault listener config, so I'd rather the presence of a telemetry block did not have special behaviour for Agent that it doesn't for Vault, for example. I also think we gain a lot from sharing the listener config. |
Ok. What about the non-listener telemetry stanza, i.e. https://developer.hashicorp.com/vault/docs/configuration/telemetry ? |
I'm a little confused as to what you mean - we can't rely on items inside the telemetry stanza to determine how listeners should behave. Agent supports the telemetry stanza in the same way as Server - if we're missing functionality, that would be news to me. See also: https://developer.hashicorp.com/vault/docs/agent#telemetry-stanza Perhaps I misunderstood what you meant, though? |
Nope, I just forgot that we'd already added some metrics support to Agent. Nevermind! |
Another high-level thought: rather than a bool, how about introducing a string field? So instead of metrics_only_listener, make it a top-level listener field e.g. |
Sorry, late to the party, is this to imply the Would this look something like this:
|
Ideally I'd like this functionality to be potentially-extendable to Vault-actual if possible. While I don't know of any requests for this feature for Vault server, the listener block is shared between the two and I'd rather not have separate configs in Agent/Vault as a result. Part of the reason I'm in favour of a boolean over a string is that I see 'metrics only listener' is a very common use case and pattern that (in my mind) is distinct to other software-specific configuration options. In other words, I definitely see this kind of thing as a 'metrics only mode' that you can opt into for security reasons as opposed to something we'll apply to other APIs. As a result, I do have a preference for the bool, as I feel like a lot of the string options read awkwardly, but I don't feel massively strongly about it and open to changing. If we do, I'd like to make sure it keeps the potential of extendability to Vault server. I tried to come up with a nice sounding string option, maybe something like these?:
Looking for additional thoughts! |
Could you not just have Really sorry if I'm being dumb. Metrics Listener:
Business as usual:
or
I'm using I guess using a |
I think this issue is separate from the issue where the I opted not to try and tackle the listener/cache entanglement here to keep those pieces of work distinct, but when we do that work, I think it would be a bad idea to require a new type of listener for it - we should support The above approach of having a We can't use If you both think that the string approach is the right approach, and we think |
That works for me. There are some other examples of listeners with specific purposes in Vault already, they're just not configurable as listeners in HCL: the cluster port (8201) and per-KMIP-mount listeners. Conceivably one day we might want to allow users to control some aspects of these in HCL and we could use |
Updated to use |
This introduces a new option for the Agent HCL config,
metrics_only_listener
. It defaults to false. If set to true, it will make the defined listener only serve metrics. It can be put alongside other listener blocks, too, like so:Using the above, you can e.g. cURL the metrics (but nothing else). This shows an example with an auth failure:
Note that we still do need a cache block for this listener, though we have a separate work item tracked to enable listeners without a cache, and I felt it best to keep the two work items distinct.