Add static name to Valkey commands #186
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Most
ValkeyCommand
types in valley-swift exactly match their underlying Valkey command name. However, for some commands like nested ones the Swift type name differs from the underlying command. This means there's no simple way of accessing the underlying command's name such as using"\(type(of: Self.self))"
, which is required for Distributed Tracing support to derive proper span operation names based on the command being executed. See Also: #177When running codegen for these commands we do have access to the underlying command names, so we could add them as properties to the generated Swift types.
Note
This PR is split off from #177 to decrease that PR's diff and keep it focused on just adding Distributed Tracing support.
Modifications
Result
All
ValkeyCommand
conforming types now have a staticname
property exposing the underlying Valkey command name. This will enable proper Distributed Tracing span operation names.