-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Proposal] Resource schema translation #3944
Conversation
18ee2b2
to
a8bc6f8
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.
LGTM! Should examples be updated to demonstrate this usage?
SGTM 👍 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3944 +/- ##
=======================================
- Coverage 82.1% 81.7% -0.5%
=======================================
Files 174 177 +3
Lines 12975 13196 +221
=======================================
+ Hits 10655 10783 +128
- Misses 2100 2183 +83
- Partials 220 230 +10
|
I have no objections to the underlying mechanics, but I do have some questions that might affect this PR:
|
Like should we continue to provide
Having to require users to import another package from contrib just so they can merge resources from this package does not seem appropriate. We have added clear documentation that these will make external requests. I see that as sufficient to inform users of the added functions behavior.
I can see an environment that want this caching it over their network. I.e. they have their DNS server point to a local HTTP cache they run. |
Some thoughts from someone grappling with otel implementation and management atm.
|
Yes, but do Merge like other languages where it returns a merged resource and an error. This would allow users to merge without having to change spec levels, and in cases where that wouldn't help, like merging with a custom URL.
Requiring a network request to do merges also does not seem appropriate. If this logic was upgrade/downgrade by passing in an already parsed Schema then I have no objection, but mandating a network lookup when this information can be available in other ways goes too far. Couldn't these schemas be already compiled into the semver, and available in binaries at startup without the network?
The
No, there isn't anything that I know of that uses the schema, this would be the first. |
I don't see a reason to change our behavior for
We could cache the OTel schemas in code, but it would become stale if there are fixes pushed to their source. How would 3rd party schemas be handled without a network request to fetch them? |
@MrAlias + @MadVikingGod I'm still confused as to the requirement here for a schema URL HTTP request. My understanding is that this go package, at the point of publication, has the schemas embedded within the package, so as to ensure that it can be used. Hence the references I've raised above about hard coding schemas to tagged releases of this package. Why wouldn't that be the approach adopted? Further, with semver, I'm not sure I understand the following assertion:
Is this a reference to new schemas rather than fixes to existing schemas? |
SIG feedback: The spec should be updated to require some sort of translation like this. |
Might want to include a digest of downloaded schemas |
Can the specification provide these? |
Closing in favor of https://github.com/MrAlias/otel-schema-utils |
Add resource schema translation via a
WithSchemaURL
method to theResource
or theMergeAt
function.Related to ...
As stated in the merge section of the specification:
Given we still support
Merge
which follows this behavior andMergeAt
is additional functionality, it seems like we wouldn't violate the specification. That said, it may be the case the specification needs to be updated before this is added.