Hi, is there any way to ignore certain endpoints?
# support
u
Hi, is there any way to ignore certain endpoints?
p
@Upesh Jindal can you share in a bit more detail on what you mean and the use case? Do you want the application page to not show certain end points?
s
This should be configureable at the instrumentation level mostly. Which framework are you using?
u
Using FastAPI
And I need a streaming endpoint ignored
because the request almost never ends so latency is shown in minutes/hours
s
You should be able to achieve this by using
OTEL_PYTHON_EXCLUDED_URLS
env.
u
This is a usecase for all services where you would use Server sent events
I will try that. Is it a comma separated list variable, Srikanth?
s
Yes, comma separate regex that matches with endpoint
u
Copy code
["/endpoint1.*", "/endpoint2.*"]
Something like this?
s
No just a simple string with comma separated values. Here the config doc https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/fastapi/fastapi.html#configuration. That should help.
u
Or if you can point me to documentation somewhere, I'll dig it myself
a
@Srikanth Chekuri Is this part of opentelemetry semantics? If yes, then we would have a generic env variable that should work across all languages and frameworks
s
No, it's not part of semantics. Semantics part is limited to just the quality of telemetry data.
This is the official list of env that should be supported by all SDKs. Since the instrumentation is still early and not streamlined they have flexibility to make their own env as mentioned here.