-
Notifications
You must be signed in to change notification settings - Fork 462
internal/namingschema: add package for selecting and working with the naming schema #1819
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
Conversation
8ca3243
to
2ed5fdb
Compare
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.
looks good to me (from a functional point of view)
feb6d72
to
f3c7822
Compare
…1834) * internal/namingschema: remove init method * ddtrace/tracer: add attribute schema version config variable and tag
e42132a
to
2e3b0a7
Compare
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.
Thank you!
If you could document all the public types/methods/functions that'd be great! LGTM otherwise!
What does this PR do?
(This PR also includes changes from #1834)
Adds
internal/namingschema
package, which provides functionality to create naming schemas used by integrations to set different service and span/operation names based on the value of theDD_TRACE_SPAN_ATTRIBUTE_SCHEMA
environment variable.It also provides some already implemented schemas for common use cases (client-server, db, messaging, etc.).
How to use this package:
VersionSupportSchema
interface containing the correct name for each version.Schema
using theNew
function.Schema.GetName
to get the correct name based on the user selected schema.Alternatively, the following functions can be used to get already implemented schemas for common use cases:
NewServiceNameSchema
-> will be used by most integrations, the behavior is: in-code override >DD_SERVICE
environment variable > integration default name.NewClientOutboundOp
-> will be used by client integrations (i.e. http or grpc clients)NewHTTPClientOp
-> specific forhttp
NewGRPCClientOp
-> specific forgrpc
NewServerInboundOp
-> will be used by server integrations (i.e. http or grpc servers)NewHTTPServerOp
-> specific forhttp
NewGRPCServerOp
-> specific forgrpc
NewDBOutboundOp
-> will be used by integrations classified as DBNewElasticsearchOutboundOp
-> specific for elasticsearch.NewCacheOutboundOp
-> will be used by integrations classified as cacheNewMemcachedOutboundOp
-> specific for memcached.NewMessagingOutboundOp
-> will be used by integrations classified as messagingNewKafkaOutboundOp
-> specific forkafka
integrationsNewMessagingInboundOp
-> will be used by integrations classified as messagingNewKafkaInboundOp
-> specific forkafka
integrationsSince
v0
(current state) doesn't generally follow any structure among integrations, theWithVersionOverride
option is provided to not break any existing behavior.Motivation
To bring uniformity to span names and service names across integrations and tracers.
This package is designed this way to easily update schemas in the codebase when new versions are released (update
VersionSupportSchema
interface and update implementations until build is fixed).Describe how to test/QA your changes
Reviewer's Checklist
Triage
milestone is set.