Skip to content
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

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

Open
ar-qun opened this issue Apr 18, 2024 · 4 comments

Comments

@ar-qun
Copy link

ar-qun commented Apr 18, 2024

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.

@nabheet
Copy link

nabheet commented May 29, 2024

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.

@tommyhe6
Copy link

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.

@nabheet
Copy link

nabheet commented May 29, 2024

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.

@tommyhe6
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants