-
Notifications
You must be signed in to change notification settings - Fork 186
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
Can I access extensions.http.routePrefix at runtime? #1366
Comments
@martinjt this information is not made available to the worker today. The simplest way to get this information, today, would be to read the host.json file and get that information directly. |
Another option is to define the route prefix as an app setting/environment variable (i.e., |
I might miss some Functions context, but Isn't it something that ASP.NET Core instrumentation should populate along with |
This is specific to functions. The wider host takes a config that will essentially add a base path to all routes. If you don't supply it, it adds
When the function has been selected, we can get the attributes and find the route, but that doesn't take into account if someone has passed a |
I believe with this recent change open-telemetry/opentelemetry-specification#3164 introduced in OTel HTTP spec Once Functions support OTel, I assume it should be possible to update |
This is purely "how do we get the prefix", the attribute is there, we can use it... but I can't get access to the prefix in order to add it to the attrivute. |
I mean functions can populate the attribute once they support OTel and adopt conventions, but today yes, no way. |
To be clear, I'm not asking for it on an Activity. I'm asking where it exists so that the Runtime can have access to it outside the worker host. |
Reviewing open items and this is still a gap. @martinjt are the options I've shared above viable workarounds in the meantime? |
I haven't looked at this recently, however, this wasn't viable at the time. I could look into why though. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If you are not the original author (martinjt) and believe this issue is not stale, please comment with |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
1 similar comment
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Is there anyway to access to the routePrefix set in
host.json
at the runtime?I'm trying to establish the actual route of a HttpTrigger function, which I can't do without the
routePrefix
as the method's route attribute doesn't include it.The text was updated successfully, but these errors were encountered: