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

OTLP exporter is encoding invalid span/trace IDs in the logs fix #4006

Merged
merged 23 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e210369
OTLP exporter encodes invalid trace/span IDs fix
soumyadeepm04 Jun 28, 2024
3647d61
fix test cases and lint issues
soumyadeepm04 Jun 28, 2024
0b66b33
Merge branch 'main' into newbranch
xrmx Jul 1, 2024
6dc18af
updated changelog
soumyadeepm04 Jul 1, 2024
1496551
update changelog
soumyadeepm04 Jul 1, 2024
bae9d33
Merge branch 'main' into newbranch
lzchen Jul 2, 2024
36d3fd6
Merge branch 'main' into newbranch
lzchen Jul 2, 2024
e2d0d42
Merge branch 'main' into newbranch
soumyadeepm04 Jul 2, 2024
0a2af9b
Merge branch 'main' into newbranch
soumyadeepm04 Jul 2, 2024
be59ef7
initial commit
soumyadeepm04 Jul 3, 2024
3fbd9a9
initial commit
soumyadeepm04 Jul 3, 2024
2eb33a7
added test cases
soumyadeepm04 Jul 3, 2024
49e31e7
resolve merge conflict
soumyadeepm04 Jul 3, 2024
9a13b80
Merge branch 'newbranch' of https://github.com/soumyadeepm04/opentele…
soumyadeepm04 Jul 3, 2024
ba6b263
fix linting issues
soumyadeepm04 Jul 3, 2024
65cd351
fixing lint issues
soumyadeepm04 Jul 3, 2024
d35d0f1
Merge branch 'main' into newbranch
soumyadeepm04 Jul 5, 2024
563569f
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
soumyadeepm04 Jul 8, 2024
4cbefa7
refactored tests
soumyadeepm04 Jul 8, 2024
3f938de
Merge branch 'newbranch' of https://github.com/soumyadeepm04/opentele…
soumyadeepm04 Jul 8, 2024
7f6b95c
fixed lint issue
soumyadeepm04 Jul 8, 2024
92be124
Merge branch 'main' into newbranch
soumyadeepm04 Jul 10, 2024
8b9f90f
Merge branch 'main' into newbranch
lzchen Jul 11, 2024
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3991](https://github.com/open-telemetry/opentelemetry-python/pull/3991))

## Version 1.25.0/0.46b0 (2024-05-30)

- OTLP exporter is encoding invalid span/trace IDs in the logs fix
xrmx marked this conversation as resolved.
Show resolved Hide resolved
([#4006](https://github.com/open-telemetry/opentelemetry-python/pull/4006))
- Fix class BoundedAttributes to have RLock rather than Lock
([#3859](https://github.com/open-telemetry/opentelemetry-python/pull/3859))
- Remove thread lock by loading RuntimeContext explicitly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@ def encode_logs(batch: Sequence[LogData]) -> ExportLogsServiceRequest:


def _encode_log(log_data: LogData) -> PB2LogRecord:
span_id = (
None
if log_data.log_record.span_id == 0
else _encode_span_id(log_data.log_record.span_id)
)
trace_id = (
None
if log_data.log_record.trace_id == 0
else _encode_trace_id(log_data.log_record.trace_id)
)
return PB2LogRecord(
time_unix_nano=log_data.log_record.timestamp,
observed_time_unix_nano=log_data.log_record.observed_timestamp,
span_id=_encode_span_id(log_data.log_record.span_id),
trace_id=_encode_trace_id(log_data.log_record.trace_id),
span_id=span_id,
lzchen marked this conversation as resolved.
Show resolved Hide resolved
trace_id=trace_id,
flags=int(log_data.log_record.trace_flags),
body=_encode_value(log_data.log_record.body),
severity_text=log_data.log_record.severity_text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def get_test_logs(
PB2LogRecord(
time_unix_nano=1644650249738562048,
observed_time_unix_nano=1644650249738562049,
trace_id=_encode_trace_id(0),
span_id=_encode_span_id(0),
trace_id=None,
span_id=None,
flags=int(TraceFlags.DEFAULT),
severity_text="WARN",
severity_number=SeverityNumber.WARN.value,
Expand Down