-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[pkg/ottl] Add InsertXML Converter #35436
Merged
djaglowski
merged 1 commit into
open-telemetry:main
from
djaglowski:ottl-add-element-xml
Sep 30, 2024
Merged
[pkg/ottl] Add InsertXML Converter #35436
djaglowski
merged 1 commit into
open-telemetry:main
from
djaglowski:ottl-add-element-xml
Sep 30, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
requested review from
bogdandrutu,
evan-bradley,
kentquirk and
TylerHelmuth
September 26, 2024 14:47
djaglowski
force-pushed
the
ottl-add-element-xml
branch
from
September 26, 2024 14:48
663c97f
to
2fe7e84
Compare
I converted this back to a draft because I think there is a way to better generalize this. Rather than providing just a string to name the element, we should be able to accept any valid XML document and insert it in the same way. |
djaglowski
force-pushed
the
ottl-add-element-xml
branch
from
September 26, 2024 16:49
6097bea
to
d497f3e
Compare
djaglowski
changed the title
[pkg/ottl] Add AddElementXML Converter
[pkg/ottl] Add InsertXML Converter
Sep 26, 2024
djaglowski
force-pushed
the
ottl-add-element-xml
branch
from
September 26, 2024 16:53
d497f3e
to
37da93b
Compare
github-actions
bot
added
cmd/otelcontribcol
otelcontribcol command
confmap/provider/s3provider
confmap/provider/secretsmanagerprovider
exporter/awskinesis
exporter/loadbalancing
extension/sigv4auth
processor/k8sattributes
k8s Attributes processor
receiver/awss3
labels
Sep 26, 2024
djaglowski
force-pushed
the
ottl-add-element-xml
branch
from
September 26, 2024 16:59
a00e4c8
to
1df669b
Compare
This was referenced Sep 27, 2024
TylerHelmuth
approved these changes
Sep 30, 2024
jriguera
pushed a commit
to springernature/opentelemetry-collector-contrib
that referenced
this pull request
Oct 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cmd/otelcontribcol
otelcontribcol command
confmap/provider/s3provider
confmap/provider/secretsmanagerprovider
exporter/awskinesis
exporter/loadbalancing
extension/sigv4auth
pkg/ottl
processor/k8sattributes
k8s Attributes processor
receiver/awss3
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.
This simple converter allows a basic form of XML document modification. Aside from the obvious, this can be used to disambiguate elements which should be members of a slice when parsed by the proposed
ParseSimplifiedXML
.To illustrate this, consider how you would expect the following two documents to parse:
The second document can clearly be understood as a slice of
File
elements:but the first document could be misunderstood as a map where
File
is a unique key:That is, there is no way to infer the schema from a single example. However, by adding an empty
File
element, we can disambiguate the schema.Many users will not care about this detail but for those who need the schema to be interpreted consistently, this mechanism provides a solution. Note that in the proposed
ParseSimplifyXML
converter, empty elements without text content are dropped, since they would be keys without values in a map.See #35281