Skip to content

Adapt common utilities to OTel specifications#550

Closed
GSVarsha wants to merge 31 commits into
otel_migrationfrom
otel_utilities
Closed

Adapt common utilities to OTel specifications#550
GSVarsha wants to merge 31 commits into
otel_migrationfrom
otel_utilities

Conversation

@GSVarsha

@GSVarsha GSVarsha commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

Adapt the following to OTel specifications:

  • inject()
  • extract()
  • traceparent
  • tracestate
  • get_current_span()
  • get_active_tracer()
  • get_tracer_tuple()

Signed-off-by: Varsha GS varsha.gs@ibm.com
Co-authored-by: Paulo Vital paulo.vital@ibm.com

pvital and others added 24 commits June 28, 2024 13:39
setup.py configuration to replace the dependency of OpenTracing with OpenTelemetry (OTel) and bump up to version 3.0.0.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Disabled all tests that are not necessary in the beginning of the migration.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
- Implement all the abstract methods provided by the OTel API
- Adapt the existing code to OTel conventions.
- Inherit OTel's SpanContext.
- Comment out the usage of baggage.
- Use time in nano seconds for start_time and end_time.
- Initialization of Span's attributes, events, start_time, status, duration,
and synthetic.
- Add the duration, status, and parent_id properties.
- Minor fixes to set values or get a dictionary value.

Co-authored-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
…olations.

Used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Co-authored-by: Varsha GS <varsha.gs@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
- contextmanager for start_as_current_span().
- use trace_flags.sampled instead of sampled.
- Add Instana specific attributes to SpanContext.
- Add parent Span_Context class arguments as necessary arguments to fix
the serialization of binary objects.
- Use format_span_id() for both representation of the trace_id and span_id
since Instana uses 64-bit integers.

Co-authored-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
- Refactor InstanaTracerProvider class for better performance.
- Add the missing add_span_processor() method for InstanaTracerProvider.
- Refactor InstanaTracer constructor removing all Optional arguments.
- Fix the start_span() method to handle the root SpanContext properly.
- Use TraceFlags as trace_flags arguments in new SpanContext objects.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Following the OpenTelemetry API, guarantee Traces and Spans IDs are now
64-bit integers instead of strings. The data transmited to the Instana
Agents or Backend are still 16HEXDIG strings.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Disabled the load of the auto instrumentation for tests and the load
of the instana package from the beginning of test execution.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Adds a pytest.mark.skipif running on macOS to avoid the raise of a
NotImplementedError when calling multiprocessing.Queue.qsize().

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Add new unit tests to check the implementation of the new TracerProvider
and Tracer classed and their methods following OpenTelemetry API.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Add type hints to methods and used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
…redSpan.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
… OTel

Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Co-authored-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Co-authored-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
@GSVarsha GSVarsha self-assigned this Jul 4, 2024
@GSVarsha GSVarsha added this to the H2-2024 milestone Jul 4, 2024
@GSVarsha GSVarsha marked this pull request as ready for review July 4, 2024 11:41
@GSVarsha GSVarsha requested a review from pvital July 4, 2024 11:41
@GSVarsha GSVarsha changed the title Otel utilities Adapt common utilities to OTel specifications Jul 4, 2024

@pvital pvital left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

GSVarsha and others added 7 commits July 4, 2024 15:09
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Signed-off-by: Ferenc Géczi <ferenc.geczi@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
@pvital pvital force-pushed the otel_migration branch 2 times, most recently from e8aef70 to 2795a4b Compare July 5, 2024 11:31
@pvital pvital added OTel_migration Migration the code dependency from OpenTracing to OpenTelemetry Review & Merge and removed Review & Merge labels Jul 8, 2024
@pvital

pvital commented Jul 8, 2024

Copy link
Copy Markdown
Member

Closing in favor of #552

@pvital pvital closed this Jul 8, 2024
@GSVarsha GSVarsha deleted the otel_utilities branch July 9, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OTel_migration Migration the code dependency from OpenTracing to OpenTelemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants