-
Notifications
You must be signed in to change notification settings - Fork 12
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
[QUESTION] Should log level be included in HostData? #140
Comments
I had to double-check how this works today, since Today, provider processes inherit environment variables from their parent, the host process. So if you start the host with I'm guessing you're looking for an equivalent for a Go provider? 😉 I'm not sure if there's a standard env var like there is for Rust, but the same process would work. However, to answer your question: yes, I do think log level should be explicitly passed to the provider rather than implicitly via a language-specific env var. I've been interested in writing an RFC around provider configuration more generally. I'm particularly interested in allowing runtime changes to logging config for providers/actors! |
Yea, I noticed that some things where using RUST_LOG while others were using, well nothing. I think the I could just have the go sdks look for |
@connorsmith256 I remember when I was creating the weld/rpc-rs/src/wasmbus_core.rs Line 314 in c979658
Which is documented as I assume that would have things like |
The I thought all env vars were passed to the provider, but now it looks like @autodidaddict can you shine some light here? |
No implicit env vars are passed for security reasons. That empty list was there in case we had specific wildcards or things that we wanted to forward |
To answer Jordan's original question, how do providers get access to the |
Not specifically |
So providers can access |
@brooksmtownsend Now I'm confused more... I found |
I can't read the Elixr code, but whereever its starting a provider, it should be handing it a JSON of the HostData as arg[1] |
It appears the host is passing a
As for env vars, it appears only So, my confusion:
|
I can speak for Go Providers, they receive the HostData, from the Host, via standard in here. Then it is parsed into the core.HostData It is my understanding that the only place a provider provided initialization data, is that stdin process you noted above (for all providers) So I would assume, in order to add a logging level, we would need to add a LogLevel field to HostData for the providers to ingest when they start To your second question, I don't think they are being passed. I think current providers are picking the the ENV straight from the host they are started on |
@jordan-rash what you said makes sense, but it contradicts my observations, which are when starting a host with |
Yea, because, correct me if I wrong, they are all being ran in the session you just started wash in. So by running wash up with that ENV, all child pids, which include the started providers, are running in a session with |
Maybe? The Port docs don't mention how child processes inherit environment variables. Under the hood it looks like elixir is calling :erlang.open_port. The docs there say about
I'm not sure whether to infer that "extended" means the parent process is passing all of its env vars to the child process. If that's the case, is it a security concern like @autodidaddict alluded to here? |
Yeah, that's correct @jordan-rash. The Rust providers get the env var I am concerned with passing the full set of environment variables and didn't know we still did that |
Per @autodidaddict comment, I dont think the host does...the field has always been blank when I checked it. |
Not sure why closed this if the 558 PR says
This seems to still be an issue? |
I determined the answer to your question is "yes" :) The issue for tracking that work is here: #145 |
Thanks Connor :-) |
For the same reason that StructuredLogging is included...the provider knows what level to log at.
weld/rpc-rs/src/wasmbus_core.rs
Lines 328 to 330 in c979658
WASMCLOUD_STRUCTURED_LOG_LEVEL
<- looking for this setting in HostDataOr am I missing it somewhere?
The text was updated successfully, but these errors were encountered: