We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
OS: MacOS Python version: 3.12.4 telemetry.sdk.version: 1.28.2 telemetry.auto.version: 0.49b2
I'm trying to use auto-instrument with gevent, but the parent ids are null for spawned spans. Am I missing anything or do you have any suggestion?
from gevent import monkey monkey.patch_all() from flask import Flask, request app = Flask(__name__) @app.route("/server_request") def server_request(): print(request.args.get("param")) return "served" if __name__ == "__main__": app.run(port=8082)
opentelemetry-instrument --traces_exporter console --metrics_exporter none python server_automatic.py
import gevent from sys import argv from requests import get from opentelemetry import trace from opentelemetry.propagate import inject from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import ( BatchSpanProcessor, ConsoleSpanExporter, ) from opentelemetry.instrumentation.requests import RequestsInstrumentor RequestsInstrumentor().instrument() trace.set_tracer_provider(TracerProvider()) tracer = trace.get_tracer_provider().get_tracer(__name__) trace.get_tracer_provider().add_span_processor( BatchSpanProcessor(ConsoleSpanExporter()) ) assert len(argv) == 2 def make_http_call(n=None): headers = {} inject(headers) return get( "http://localhost:8082/server_request", params={"param": argv[1]}, headers=headers, ) def spawn_calls(): with tracer.start_as_current_span("spawn_calls"): jobs = [] jobs.append(gevent.spawn(make_http_call)) jobs.append(gevent.spawn(make_http_call)) jobs.append(gevent.spawn(make_http_call)) gevent.joinall(jobs, timeout=2) def launch_gevent_chain(): with tracer.start_as_current_span("test"): gevent.spawn(spawn_calls).join() gevent.spawn(launch_gevent_chain) gevent.sleep(2)
python client.py otel-flask-gevent-testing
I was expecting to see spawn_calls's span id as spawned spans' pids.
Parent IDs in the results are null
No response
None
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe your environment
OS: MacOS
Python version: 3.12.4
telemetry.sdk.version: 1.28.2
telemetry.auto.version: 0.49b2
What happened?
I'm trying to use auto-instrument with gevent, but the parent ids are null for spawned spans. Am I missing anything or do you have any suggestion?
Steps to Reproduce
Server Code
opentelemetry-instrument --traces_exporter console --metrics_exporter none python server_automatic.py
Client Code
python client.py otel-flask-gevent-testing
Expected Result
I was expecting to see spawn_calls's span id as spawned spans' pids.
Actual Result
Parent IDs in the results are null
Additional context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: