Skip to content

feat: Use query id as trace id #17947

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Xuanwo
Copy link
Member

@Xuanwo Xuanwo commented May 15, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Use the same ID for both the query ID and the trace ID.

The OTEL specification requires the trace ID to be 128 bits (32 hex chars). To enable us to use our query ID as the trace ID, I have changed the format of our query ID from 67e55044-10b1-426f-9247-bb680e5fe0c8 to 67e5504410b1426f9247bb680e5fe0c8.

I believe this should be a non-breaking change, as it is unlikely that any system depends on the specific representation of the query ID. However, we should still review this carefully to ensure we haven't introduced any unexpected issues.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label May 15, 2025
@Xuanwo Xuanwo requested review from BohuTANG and zhang2014 May 15, 2025 17:51
@hantmac
Copy link
Member

hantmac commented May 16, 2025

@hantmac
Copy link
Member

hantmac commented May 16, 2025

For Databend query, after implementing a compatibility feature that removes all hyphens ("-") from the received query ID, and use this new query ID and trace ID for downstream transmission. Then we can merge the following pr in clients:

@Xuanwo
Copy link
Member Author

Xuanwo commented May 16, 2025

For Databend query, after implementing a compatibility feature that removes all hyphens ("-") from the received query ID, and use this new query ID and trace ID for downstream transmission. Then we can merge the following pr in clients:

Thank you for this! I will work on this PR directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants