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.
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
Code improvements for ETW exporter #519
Code improvements for ETW exporter #519
Changes from all commits
6bd4aaa
f8a3af1
035d863
1141e29
01cd9ac
01c693c
66b1ee2
90ecfd0
5acc2d3
013d1fd
956e38d
bcc54f7
846ad71
16ccb2a
fc55f3c
1b039a8
af1718f
d142031
c02a822
d86267f
c4d73ad
afd035e
a1141e4
93b2480
897da33
07952be
09d8fa9
8a737c7
a4b459d
0c3b167
fc2cbb3
b7153eb
a09a941
5de423b
4b5d3b7
fdda4da
ee14876
51461d4
ebcd88e
c81d08e
44f0ce2
c3a7442
6d70f6d
81f0db9
9475c16
0d993d0
e159b2c
4adafce
c9f1efa
ec0ef2e
48adeea
c3d0dc8
753521b
5ed213c
1d46f76
131f801
51bea36
4543a47
48991c0
8678a91
665422e
fb71a95
f459bd3
4fd5528
da56e3e
2951a1e
127f149
b51040a
0f2b8d6
b78797f
a683ed5
1db003e
3a7831a
b0c31bf
bcf7325
1561bd0
b51cd39
61b2f7c
467f823
576d510
a1653b4
57ab55b
1b0baf7
e37cee5
63f793d
a8afc39
18b2f9b
c2777e2
bf8a3d4
8feee53
888a040
69c5e66
80512b5
550f2d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why is this removed ? To accommodate
Properties
class ? Just want to ensure that this won't make it error-prone if someone tries to create it's instance with incorrect type.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.
I removed it, adding an explanation of why exactly. Short answer is that it's a transform into
KeyValueIterable
whereValue = common::AtributeValue
, but the original containerT
- may have wider typing system! Its own value may be an extension over the basic set of OTLP types. That containerT
then transforms the values to use onlycommon::AttributeValue
type of values. This is the original comment on top of this template:I would like to extend this template later on, by moving
Properties
fromETW
exporter into common helper class that lives in API includes. That way we can support ANY type on API surface, and the helper would transform-convert the types into propercommon::AttributeValue
. It's a handy pattern that would be immensely helpful forbyte arrays
, forUUID
/GUID
, and practically for any other usefulValueType
. As long as container provides a transform. For example, that container may transformGUID
to string. Orbyte array
tobase64 string
. Or converttime_t
or any sort of othertimespec
orticks
structure touint64_t
, for example. Devs may follow this pattern to bridge / shim other SDKs and APIs to normalized view within the confines of OpenTelemetry typing system.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.
This should be safe. The actual contract is captured in the signature of
ForEachKeyValue
.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.
It's a long name, but let's use
NullSpanContextKeyValueIterable
. To be consistent withSpanContextKeyValueIterable
.NullSpanContext
is ambiguous.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.
Anyway, to avoid an additional class, one could also do this:
using SpanContextKeyValueIterableInitializerList = SpanContextKeyValueIterableView<std::initializer_list< std::pair<SpanContext, std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>>>>>;
And then define your additional
StartSpan
method like this:Just to avoid a clutter of types that we also need to document (and that are error-prone, e. g. return
false
in case of success). We also haveNullKeyValueIterable
, however, it's not used anywhere ...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.
I can refactor this in a separate (unrelated PR) by moving these into separate helper header or something. That would also enable
NullTracerProvider
cases, unrelated to ETW per se. Right now it is more or less "internal" detail that I think we can rename / adjust before GA.