Skip to content

Commit

Permalink
pass opentelemetry context to the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kukushechkin committed Nov 23, 2022
1 parent 4137583 commit cf7e1ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/iqm_client/iqm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ def submit_circuits(
if bearer_token:
headers['Authorization'] = bearer_token

try:
# check if someone is trying to profile us with OpenTelemetry
from opentelemetry import propagate
propagate.inject(headers)
except Exception as ex:
# no OpenTelemetry, no problem
pass

result = requests.post(
join(self._base_url, 'jobs'), json=data.dict(exclude_none=True), headers=headers, timeout=REQUESTS_TIMEOUT
)
Expand Down

0 comments on commit cf7e1ff

Please sign in to comment.