Skip to content

Commit

Permalink
Changed the format of traceparent id (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiyagu55 committed Mar 16, 2022
1 parent 640b117 commit abd01fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- `opentelemetry-instrumentation-dbapi` Changed the format of traceparent id.
([#941](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/941))
- `opentelemetry-instrumentation-logging` retrieves service name defensively.
([#890](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/890))
- `opentelemetry-instrumentation-wsgi` WSGI: Conditionally create SERVER spans
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@

from opentelemetry import trace as trace_api
from opentelemetry.instrumentation.dbapi.version import __version__
from opentelemetry.instrumentation.utils import _generate_sql_comment, unwrap
from opentelemetry.instrumentation.utils import (
_generate_opentelemetry_traceparent,
_generate_sql_comment,
unwrap,
)
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, TracerProvider, get_tracer

Expand Down Expand Up @@ -369,14 +373,7 @@ def _generate_comment(span: Span) -> str:
span_context = span.get_span_context()
meta = {}
if span_context.is_valid:
meta.update(
{
"trace_id": span_context.trace_id,
"span_id": span_context.span_id,
"trace_flags": span_context.trace_flags,
"trace_state": span_context.trace_state.to_header(),
}
)
meta.update(_generate_opentelemetry_traceparent(span))
# TODO(schekuri): revisit to enrich with info such as route, db_driver etc...
return _generate_sql_comment(**meta)

Expand Down

0 comments on commit abd01fb

Please sign in to comment.