Add sampling extension.#243
Conversation
|
|
||
| ## Attributes | ||
|
|
||
| ### (self) |
There was a problem hiding this comment.
I wonder if using (self) is less clear than just putting the actual text here? I'd kind of prefer to just be explicit about it instead of having a level of indirection.
There was a problem hiding this comment.
Changed extensions.md to say that structured extensions' documentation will conventionally have an attributes section and scalar extensionsdocumentation will conventionally have avalue` section.
| ## Encoding | ||
|
|
||
| ### In-memory formats | ||
| The Sampling extension uses the key `sampledRate` for in-memory formats |
There was a problem hiding this comment.
Why do we mention this for this attribute but not others?
There was a problem hiding this comment.
What do you mean? The distributed tracing extension doc also says
The Distributed Tracing extension uses the key
distributedTracingfor in-memory formats
There was a problem hiding this comment.
Didn't realize it did, but I was thinking about the core properties. no biggie either way.
| the number of similar events that happened but were not sent plus this event. | ||
| For example, if a system sees 30 occurrences and emits a single event, `rate` | ||
| would be 30 (29 not sent and 1 sent). | ||
| Consumers SHOULD assume a value of `1` when the extension is omitted. |
There was a problem hiding this comment.
s/SHOULD/MUST/ - although, its kind of weird to have any constraints when the extension isn't used.
Would it be better to say:
A value of 1 is the equivalent of this extension not being used at all.
There was a problem hiding this comment.
I'm ambivalent. Taking the change.
| would be 30 (29 not sent and 1 sent). | ||
| Consumers SHOULD assume a value of `1` when the extension is omitted. | ||
| * Constraints | ||
| * The rate MUST be positive. |
There was a problem hiding this comment.
Perhaps "... MUST be greater than zero." ? Didn't want to get into the possible confusion around whether zero is positive or negative :-) so let's just be explicit.
There was a problem hiding this comment.
I'll change the prose rather than lecture everyone that zero is neither positive nor negative =p
|
@inlined some comments need attention |
This pull request supercedes cloudevents#76 and builds upon cloudevents#242. Per agreement at the f2f meeting 2018-06-15, this will be ratified as an extension but not currently as part of the core spec. The early inclusion of the spec and the ability for side-cars to impose sampling early in the pipeline make it reasonable to start with this as an extension. I know the original author hoped to make this a core feature, though there are two upsides: 1. Due to other decisions on 2018-06-15, this will have zero impact on JSON encoding (but will in Proto and may in SDKs) 2. Extensions now get a whole document. This lets us pitch sampling in more detail. Necessary additional changes: * Added `Integer` to our type system * Added convention for how scalar extensions should be documented. I'm not really excited about this proposal so others are welcome. Special thanks to @maplebed for kicking this effort off. Signed-off-by: Thomas Bouldin <inlined@google.com>
93b212e to
d0d3e0b
Compare
inlined
left a comment
There was a problem hiding this comment.
Added a bit more prose to the extensions.md to also warn about the danger of using custom transport-bindings. E.g. an MQTT -> HTTPS relay may drop custom transport bindings for extensions it is unaware.
|
|
||
| ## Attributes | ||
|
|
||
| ### (self) |
There was a problem hiding this comment.
Changed extensions.md to say that structured extensions' documentation will conventionally have an attributes section and scalar extensionsdocumentation will conventionally have avalue` section.
| the number of similar events that happened but were not sent plus this event. | ||
| For example, if a system sees 30 occurrences and emits a single event, `rate` | ||
| would be 30 (29 not sent and 1 sent). | ||
| Consumers SHOULD assume a value of `1` when the extension is omitted. |
There was a problem hiding this comment.
I'm ambivalent. Taking the change.
| would be 30 (29 not sent and 1 sent). | ||
| Consumers SHOULD assume a value of `1` when the extension is omitted. | ||
| * Constraints | ||
| * The rate MUST be positive. |
There was a problem hiding this comment.
I'll change the prose rather than lecture everyone that zero is neither positive nor negative =p
| ## Encoding | ||
|
|
||
| ### In-memory formats | ||
| The Sampling extension uses the key `sampledRate` for in-memory formats |
There was a problem hiding this comment.
What do you mean? The distributed tracing extension doc also says
The Distributed Tracing extension uses the key
distributedTracingfor in-memory formats
Signed-off-by: Thomas Bouldin <inlined@google.com>
d0d3e0b to
60ad09d
Compare
| # Sampling extension | ||
|
|
||
| There are many cases in an Event's life when a system (either the system | ||
| creating the event or a system transporting the event) may wish to only emit a |
There was a problem hiding this comment.
since this isn't a normative statement, its just exemplary
| There are many cases in an Event's life when a system (either the system | ||
| creating the event or a system transporting the event) may wish to only emit a | ||
| portion of the events that actually happened. In a high throughput system where | ||
| creating the event is costly, a system may wish to only create an event for |
There was a problem hiding this comment.
s/may/might/ since this isn't a normative statement
| creating the event is costly, a system may wish to only create an event for | ||
| 1/100 of the times that something happened. Additionally, during the | ||
| transmission of an event from the source to the eventual recipient, any step | ||
| along the way may choose to only pass along a fraction of the events it |
|
|
||
| In order for the system receiving the event to understand what is actually | ||
| happening in the system that generated the event, information about how many | ||
| similar events may have happened must be included in the event itself. This |
There was a problem hiding this comment.
s/may have happened must be/happened would need to be/
|
overall LGTM just a fit syntax things |
Signed-off-by: Thomas Bouldin <inlined@google.com>
|
still LGTM All - please review (and LGTM, or not) for next week's call |
|
LGTM |
| extension. | ||
|
|
||
| ## Documented Extensions | ||
| As a convention, extensions of scalar types (`String`, `Binary`, `URI`, |
There was a problem hiding this comment.
This PR added an Integer type. Should either list it here or add "e.g." to not list all of the scaler types.
Signed-off-by: Thomas Bouldin <inlined@google.com>
|
All, please review this one. I'm putting into the category of "easy/quick approval" for this week's call, so please speak up prior to the call if you see any issues. |
|
Approved on 8/16 call |
* Add sampling extension. This pull request supercedes cloudevents#76 and builds upon cloudevents#242. Per agreement at the f2f meeting 2018-06-15, this will be ratified as an extension but not currently as part of the core spec. The early inclusion of the spec and the ability for side-cars to impose sampling early in the pipeline make it reasonable to start with this as an extension. I know the original author hoped to make this a core feature, though there are two upsides: 1. Due to other decisions on 2018-06-15, this will have zero impact on JSON encoding (but will in Proto and may in SDKs) 2. Extensions now get a whole document. This lets us pitch sampling in more detail. Necessary additional changes: * Added `Integer` to our type system * Added convention for how scalar extensions should be documented. I'm not really excited about this proposal so others are welcome. Special thanks to @maplebed for kicking this effort off. Signed-off-by: Thomas Bouldin <inlined@google.com> * PR feedback; also add conttent to extensions.md Signed-off-by: Thomas Bouldin <inlined@google.com> * @douglin doesn't like the world 'may' 😉 Signed-off-by: Thomas Bouldin <inlined@google.com> * Add 'e.g.' to list of scalar types in conventions Signed-off-by: Thomas Bouldin <inlined@google.com>
This pull request supercedes #76 and builds upon #242.
Per agreement at the f2f meeting 2018-06-15, this will be ratified
as an extension but not currently as part of the core spec. The
early inclusion of the spec and the ability for side-cars to impose
sampling early in the pipeline make it reasonable to start with
this as an extension.
I know the original author hoped to make this a core feature, though
there are two upsides:
on JSON encoding (but will in Proto and may in SDKs)
in more detail.
Necessary additional changes:
Integerto our type systemI'm not really excited about this proposal so others are welcome.
Special thanks to @maplebed for kicking this effort off.
Closes #76