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

When using a Rest server, an error log occurs when opentelemetry is not set. #78

Open
stat-kwon opened this issue Aug 2, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@stat-kwon
Copy link
Member

stat-kwon commented Aug 2, 2023

Description

Opentelemetry was already applied to the backend framework python-core and was collecting spans.

The service-portal where the problem occurred is running based on FastAPI, and the trace infrastructure is not built in the current product environment, so all OpenTelemetry settings are set to disabled.

In this case, Error log should not occur, but as shown in the code below, Error log is occurring even though Otel is not used.

2023-07-30T11:58:58.834Z [DEBUG] {trace_id} domain-xxxxxxxxxx api.service-portal Demo.create (stibee_connector.py:50) [add_email] https://api.stibee.com/v1/lists/187034/subscribers => {'eventOccuredBy': 'SUBSCRIBER', 'groupIds': ['123456'], 'subscribers': [{'email': '[email protected]'}]}
INFO:     10.0.40.169:0 - "POST /demo/create HTTP/1.0" 200 OK
Exception while exporting Span batch.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/sdk/trace/export/__init__.py", line 368, in _export_batch
    self.span_exporter.export(self.spans_list[:idx])  # type: ignore
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/sdk/trace/export/__init__.py", line 522, in export
    self.out.write(self.formatter(span))
AttributeError: 'NoneType' object has no attribute 'write'
@stat-kwon stat-kwon added the bug Something isn't working label Aug 2, 2023
@stat-kwon stat-kwon self-assigned this Aug 2, 2023
stat-kwon added a commit to stat-kwon/python-core that referenced this issue Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant