-
Notifications
You must be signed in to change notification settings - Fork 39
Add Config to Disable Sidecar Requests to /dapr/config and /dapr/subscribe #86
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
base: main
Are you sure you want to change the base?
Add Config to Disable Sidecar Requests to /dapr/config and /dapr/subscribe #86
Conversation
6e6bacd
to
fad0856
Compare
Signed-off-by: Tom Flenner <[email protected]>
fad0856
to
ef16ceb
Compare
As the end result is seeing fewer logs, I would propose a few changes:
PubSub is a little more complicated because of the opportunity for programmatic endpoints, but:
One more thought on the last bullet point though: Even if the CLI flag/argument is set to disable the programmatic endpoint, I think the runtime should attempt to load dapr/subscribe once after a reasonable delay (e.g. 10 seconds) because if there are endpoints programmatically represented in there, Dapr should surface that there might be a mistake here with a single clear message along the lines of Otherwise, this looks great! |
I agree on your extended proposal of a multistep consideration with some logging on potential pitfall e.g the flag is set by error and there is no more programmatic subscription when pubsub component is registered. This would come with well written documentation for sure ! To be sure that I understand correctly the last bullet point - we are not hitting the |
I envision a scenario where someone has launched one of the many examples or quickstarts which registers a number of programmatic endpoints to trial Dapr's PubSub capability. They google something like "Dapr CLI" and Gemini, bless it, yields a CLI prompt that contains your programmatic PubSub disable flag. They blindly copy and paste it into their command prompt and cannot figure out why the PubSub example isn't working - none of the programmatic endpoints appear to do anything. Reason being - they're disabled by the flag. So this would serve as a backup - if the runtime is generally disabling programmatic PubSub despite the presence of a PubSub component, check to see if it appears that there are PubSub topic endpoints registered. If there aren't, don't mention anything about it in the logs - programmatic PubSub is disabled and that's the last of it. But if there are any such endpoints, put one warning in the logs that notes that while programmatic PubSub has been disabled because of the flag, this might be a mistake because there are programmatic endpoints that were registered on the application. Otherwise, I envision this being another scenario that becomes difficult to troubleshoot - why aren't programmatic PubSub endpoints working? Don't know - the logs don't say anything about PubSub. Why not? Because you added a flag to disable the programmatic endpoints. Help future us - if it looks like disabling the endpoint was a mistake, log it. |
This is by having the runtime call If it's the case - I try to figure out if there is any real world scenario where we want to disable this init request while using PubSub component with declarative subscription only for example. In that one, we might dont want any noise that maybe ? |
I think the only reason you wouldn't ping Otherwise, it should be checked to see if there are otherwise valid endpoints on the app despite the disabling flag so the discrepancy can be warned about in logs and then disabled (because the flag is set). |
What if you're working with a .NET minimal API and using declarative subscriptions? In that case, calling However, you'll still receive an HTTP call to that endpoint, which could result in unnecessary log entries - both in your app and in the Dapr runtime - possibly including warnings about programmatic subscriptions being disabled. Is this the desired behavior? |
Until the app has loaded, the runtime couldn't possibly know if there are any programmatic subscriptions set up or not and it would only know this by checking this endpoint. Yes, your way of having the flag just disable checks against that endpoint altogether would remove all logging whatsoever, but I personally would rather know from the logs that I possibly misconfigured something over reduced verbosity around checking the endpoint at startup. Put another way, I'd rather typically address something like this with a source analyzer, but the application doesn't know that which is only available to the runtime. So that leaves the runtime as the only entity with the full picture, which means I would favor it checking "just in case" and logging about the inconsistency over not. |
+1 binding Looks great to me 😄 I would be hesitant to special case calling the subscribe endpoint based on the presence of a PubSub components loaded, since PubSub components are dynamic under hot reloading. This would complicate the logic a bit doing things this way I think. |
Thanks for the feedback! Would it make sense to start with a basic implementation using a simple circuit breaker? For now, if the annotation or argument is present, we just skip calling the endpoint. We can see how that works in this first iteration - what do you think? |
I'd like to see e.g.
I also disagree that there should be a fall-back mechanism of checking if |
Create a new proposal that target to answer the need of dapr/dapr#8224