-
Notifications
You must be signed in to change notification settings - Fork 3
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
chore: Adjust default naming logic for otel resources #66
Conversation
WalkthroughThe changes involve modifications to the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🔇 Additional comments (1)go.mod (1)
The upgrade from Let's verify the version compatibility and changelog: ✅ Verification successfulTemporal SDK upgrade is safe to proceed The codebase uses Temporal SDK in a limited way, primarily for OpenTelemetry integration through the
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if the new version is stable and if there are any breaking changes
# Test 1: Verify if v1.30.0 is the latest stable version
gh release view v1.30.0 --repo go.temporal.io/sdk
# Test 2: Check the changelog for breaking changes
curl -s https://raw.githubusercontent.com/temporalio/sdk-go/v1.30.0/CHANGELOG.md | grep -A 10 "v1.30.0"
Length of output: 247 Script: #!/bin/bash
# Let's try a different approach to verify the temporal SDK version
# Check for any direct usage of temporal SDK features that might be affected
# Search for temporal imports and usage
rg -l "temporal.io/sdk" --type go
# Look for any temporal client configurations or workflow-related code
rg "temporal\." --type go -A 3
# Check if there are any tests that might verify the integration
fd -e go -exec grep -l "temporal" {} \;
Length of output: 694 Script: #!/bin/bash
# Let's examine the temporal interceptor implementation to understand the SDK usage
# Check the temporal interceptor implementation
cat temporal_interceptor.go
# Check the plugin implementation
cat plugin.go
# Look specifically for any version-specific features or configurations
rg "temporal" -A 5 -B 5 temporal_interceptor.go
Length of output: 7994 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Hey @nickdnk 👋 |
Cool. I rebased on it so it's just the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
schema.json (1)
Line range hint
1-124
: Consider enhancing schema documentation for migrationThe schema structure correctly handles the deprecation of root-level properties in favor of the
resource
object. To further improve the migration experience, consider:
- Adding examples in the schema showing both old and new configurations
- Documenting the minimum version where
resource
properties became available- Adding a note about the relationship between root-level and resource-level properties during transition
This would help users understand the migration path better and prevent confusion about property precedence.
Would you like me to help draft the enhanced documentation and examples?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- config.go (1 hunks)
- schema.json (1 hunks)
🔇 Additional comments (4)
schema.json (2)
Line range hint
1-124
: Schema structure and validation rules look goodThe schema maintains proper JSON Schema standards with:
- Clear property definitions and constraints
- Proper type validation
- Consistent structure between deprecated and new fields
31-31
: Clarify the service_name reference in default value templateWhile the change to use
<service_name>-<uuid>
makes the namespace more meaningful, please clarify:
- Which
service_name
is used (root level orresource.service_name
)?- How is this template processed?
Consider adding documentation about the templating syntax and variable resolution.
Let's check if there's any existing documentation about this templating:
✅ Verification successful
Let me search for more context about this templating mechanism in the codebase.
Based on the findings from
config.go
, I can now generate a final response as we have clear evidence of how the templating works.The default value template is correctly implemented but needs documentation
The implementation in
config.go
shows that<service_name>-<uuid>
is properly handled:
- It uses
Resource.ServiceNameKey
for the service name- Generates a new UUID using
uuid.NewString()
- Combines them using
fmt.Sprintf("%s-%s", c.Resource.ServiceNameKey, uuid.NewString())
Please add documentation in the schema or README about this templating mechanism to improve clarity for users.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for documentation about templating syntax rg -i "template|placeholder|<service_name>|<uuid>" README.md || echo "No documentation found about templating syntax"Length of output: 165
Script:
#!/bin/bash # Search for service name and UUID related code rg -i "service.*name.*uuid" -A 5 -B 5 # Search for any code that might be handling these placeholders rg -i "replace.*service.*name|replace.*uuid" -A 5 -B 5 # Look for any configuration processing code fd -e php -e go -e js "config|plugin" --exec rg -l "service.*name"Length of output: 1518
config.go (2)
Line range hint
39-43
: LGTM: Proper deprecation handlingThe code appropriately handles the deprecation of
service_name
andservice_version
fields by:
- Maintaining backward compatibility
- Providing clear warning messages
- Directing users to the new
resource
structure
97-97
: Verify impact on existing deploymentsThe change to use
ServiceNameKey
instead of the static "RoadRunner" prefix for namespace construction is a good improvement that makes the namespace more meaningful. However, this change might affect existing monitoring/tracing setups.Let's verify the potential impact:
Consider adding a note to the changelog about this behavioral change, as it affects the default namespace construction pattern.
✅ Verification successful
Let me gather more context about the service namespace usage and configuration to better understand the impact.
Based on the gathered information, I can now provide the final response:
ServiceNamespaceKey change is safe to proceed
The change from static "RoadRunner" prefix to dynamic service name is safe as:
- No hardcoded dependencies on the RoadRunner-prefixed namespace format were found
- The namespace is only used internally for telemetry identification
- The UUID suffix maintains uniqueness regardless of the prefix
- The schema.json only defines the field structure without any prefix assumptions
The change improves observability by making services more identifiable in monitoring systems while maintaining backward compatibility through the same configuration key (
service_namespace
).🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any hardcoded references to RoadRunner-prefixed namespaces rg -l 'RoadRunner-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' # Search for any configuration files that might be affected fd -e yaml -e json -e toml | xargs rg 'service_namespace'Length of output: 182
Script:
#!/bin/bash # Check the schema definition for service_namespace cat schema.json | jq '.[] | select(.service_namespace != null)' # Look for any tests or code that might be relying on the namespace format rg -A 3 -B 3 'ServiceNamespaceKey' # Check for any existing configuration examples fd -e yaml -e json -e toml -e md | xargs rg -l 'service.*namespace'Length of output: 1755
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @nickdnk 👍
That can be merged even on failing CI. Waiting for the fix from Temporal. |
Reason for This PR
The default naming logic is inconsistent here, as it depends on deprecated fields. If you don't use those deprecate fields, your service name will be empty.
This also changes the default name of the service namespace to include the service name, instead of defaulting to roadrunner (which is still the default service name key).
service_name
andservice_version
are both deprecated at the plugin level.Description of Changes
[Author TODO: add description of changes.]
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.Summary by CodeRabbit
New Features
service_namespace
to incorporate the service name, enhancing clarity and organization.Bug Fixes
service_name
andservice_version
properties, directing users to utilizeresource.service_name
andresource.service_version
for improved schema structure.Documentation
Chores
go.temporal.io/sdk
dependency version fromv1.29.1
tov1.30.0
.