pgjones / hypercorn

Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is Hypercorn pre-fork or post-fork? How can I integrate it with opentelemetry?

ar-qun opened this issue · comments

commented

Hello everybody,

I don't seem to manage to make open telemetry work with Hypercorn.

Could someone give me any suggestions related to the process model Hypercorn is using? Here is for uWSGI and Gunicorn https://opentelemetry-python.readthedocs.io/en/latest/examples/fork-process-model/README.html

I am using a WSGI Flask app.

Thanks in advance.

I think the process model is still fork but I don't see any way to specify callbacks for a pre-fork event or something. It would be really nice to have a prefork event.

EDIT: Actually, looks like it uses multi-processing.spawn.

Would be interested in anyone that got hypercorn to work with opentelemetry! I'm having trouble getting it to send any traces at all, even with 1 worker. Here's a minimal example: https://github.com/tommyhe6/otel-hypercorn, where hypercorn was not sending any traces but uvicorn working.

I got it to work. It is definitely sending metrics every 5secs. And I log traces to stdout, so looks like it is sending traces also.

Metrics seem to work, but I can't get traces to show up. Is there anything wrong with the configuration in my example? Or do you have a public repo showcasing this by chance? Appreciate the help.