Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Logs: ObservedTimestamp field is missing in console exporter output
([#3564](https://github.com/open-telemetry/opentelemetry-python/pull/3564))
- Fix explicit bucket histogram aggregation
([#3429](https://github.com/open-telemetry/opentelemetry-python/pull/3429))
- Add `code.lineno`, `code.function` and `code.filepath` to all logs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def to_json(self, indent=4) -> str:
else None,
"dropped_attributes": self.dropped_attributes,
"timestamp": ns_to_iso_str(self.timestamp),
"observed_timestamp": ns_to_iso_str(self.observed_timestamp),
"trace_id": f"0x{format_trace_id(self.trace_id)}"
if self.trace_id is not None
else "",
Expand Down
2 changes: 2 additions & 0 deletions opentelemetry-sdk/tests/logs/test_log_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_log_record_to_json(self):
"attributes": None,
"dropped_attributes": 0,
"timestamp": "1970-01-01T00:00:00.000000Z",
"observed_timestamp": "1970-01-01T00:00:00.000000Z",
"trace_id": "",
"span_id": "",
"trace_flags": None,
Expand All @@ -38,6 +39,7 @@ def test_log_record_to_json(self):
)
actual = LogRecord(
timestamp=0,
observed_timestamp=0,
body="a log line",
).to_json()
self.assertEqual(expected, actual)
Expand Down