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

1174 zipkin exporter v1 thrift support #2

Open
wants to merge 27 commits into
base: 1173_zipkin_exporter_v1_json_support_fix
Choose a base branch
from

Conversation

robwknox
Copy link
Owner

@robwknox robwknox commented Nov 16, 2020

Description

Adds support for the Zipkin Exporter v1 API thrift format.

Important note on Trace and Span IDs
Thrift only supports signed integers (max 64 bits). This results in the Zipkin Thrift API having type definitions of:

  • i64 id (span id)
  • i64 trace_id
  • i64 trace_id_high (used if trace_id is > 63-bits)

The default OTEL RandomIdsGenerator class generates unsigned integers of 64-bits (span) and 128-bits (trace). This results in default behavior of integer overflow during encoding ~50% of the time for Span IDs and ~75% for Trace IDs. Not a practical situation so the code provides two solutions

  1. preferred: a ThriftRandomIdsGenerator has been provided to override the default OTEL generator. This slightly reduces the size of the generated IDs (63-bit for span / 126-bit for trace) in order to enusre they will fit into the thrift data types.
  2. Implicit truncation logic in the encoding of Trace and Span IDs. A warning log is emitted when this occurs and includes both the original and truncated IDs for mapping purposes.

Fixes open-telemetry#1174

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Manual testing against local zipkin server:
    • v1-thrift support
    • v1-json / v2-json / v2-protobuf output comparison testing against v1-thrift
    • regression testing of v1-json, v2-json, v2-protobuf
  • New unit tests for v1-thrift
  • Full tox run

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@robwknox robwknox changed the base branch from 1173_zipkin_exporter_v1_json_support to 1173_zipkin_exporter_v1_json_support_fix December 3, 2020 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant