Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Add types to queries #11

Merged
merged 5 commits into from
Oct 2, 2024
Merged

Add types to queries #11

merged 5 commits into from
Oct 2, 2024

Conversation

abefernan
Copy link
Collaborator

Closes #5.

The wip rendering of the tags also shows now as a map, since we use that type for that field now:
type-traces

@abefernan abefernan requested a review from hashedone September 30, 2024 08:43
@abefernan abefernan self-assigned this Sep 30, 2024
Copy link

@hashedone hashedone left a comment

Choose a reason for hiding this comment

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

Before approve I want to double check if I understand this correctly. You moved from generic typescript any assuming the received span data is a Json type as you expected to some zod crate which allows you to operate on typed Json validated against a schema, right?

@abefernan
Copy link
Collaborator Author

Before approve I want to double check if I understand this correctly. You moved from generic typescript any assuming the received span data is a Json type as you expected to some zod crate which allows you to operate on typed Json validated against a schema, right?

Exactly, it runtime checks that what we get from the API is what we want, that way.

It also transforms the received data, so for example we can check the parent span with the parentSpanId field, instead of having to check the references array for a CHILD_OF element.

https://github.com/confio/cosmwasm-tracing-ui/blob/type-traces/types/txs.ts#L28-L32

hashedone
hashedone previously approved these changes Oct 2, 2024
Copy link

@hashedone hashedone left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from show-actor-type to main October 2, 2024 10:55
@abefernan abefernan dismissed hashedone’s stale review October 2, 2024 10:55

The base branch was changed.

@abefernan abefernan merged commit 350617f into main Oct 2, 2024
1 check passed
@abefernan abefernan deleted the type-traces branch October 2, 2024 11:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add types to traces and spans
2 participants