From 5d02ccf4e1450e8f4c4c8811f6cff45774d8320f Mon Sep 17 00:00:00 2001 From: Ben Hartshorne Date: Thu, 8 Feb 2018 11:26:48 -0800 Subject: [PATCH 1/4] Add sample rate field to the spec Signed-off-by: Ben Hartshorne --- spec.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec.md b/spec.md index f369120a1..cad330d45 100644 --- a/spec.md +++ b/spec.md @@ -200,6 +200,7 @@ that contains both context and data). * If present, MUST adhere to the format specified in [RFC 3986](https://tools.ietf.org/html/rfc3986) +<<<<<<< HEAD ### content-type * Type: String per [RFC 2046](https://tools.ietf.org/html/rfc2046) * Description: Describe the data encoding format @@ -208,6 +209,17 @@ that contains both context and data). * If present, MUST adhere to the format specified in [RFC 2046](https://tools.ietf.org/html/rfc2046) * For Media Type examples see [IANA Media Types](http://www.iana.org/assignments/media-types/media-types.xhtml) +======= +### sampled-rate +* Type: Positive Integer +* Description: The rate at which this event has already been sampled. Represents + the denominator of a fraction: when `1/n` events are sent, this field should + hold `n`. +* Constraints: + * OPTIONAL + * If present, MUST be a positive integer + * When absent, may be assumed to be 1, meaning unsampled +>>>>>>> Add sample rate field to the spec ### extensions * Type: Map From b1eebf4c61949321c28972ea9705008208a161c1 Mon Sep 17 00:00:00 2001 From: Ben Hartshorne Date: Thu, 8 Feb 2018 14:06:20 -0800 Subject: [PATCH 2/4] avoid using reserved keywords in a way that aren't rfc-ish Signed-off-by: Ben Hartshorne --- spec.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spec.md b/spec.md index cad330d45..ca21e70dd 100644 --- a/spec.md +++ b/spec.md @@ -200,26 +200,24 @@ that contains both context and data). * If present, MUST adhere to the format specified in [RFC 3986](https://tools.ietf.org/html/rfc3986) -<<<<<<< HEAD ### content-type * Type: String per [RFC 2046](https://tools.ietf.org/html/rfc2046) -* Description: Describe the data encoding format +* Description: Describe the data encoding format * Constraints: * OPTIONAL * If present, MUST adhere to the format specified in [RFC 2046](https://tools.ietf.org/html/rfc2046) * For Media Type examples see [IANA Media Types](http://www.iana.org/assignments/media-types/media-types.xhtml) -======= + ### sampled-rate * Type: Positive Integer * Description: The rate at which this event has already been sampled. Represents - the denominator of a fraction: when `1/n` events are sent, this field should - hold `n`. + the denominator of a fraction: when `1/n` events are sent, this field holds + `n`. * Constraints: * OPTIONAL * If present, MUST be a positive integer - * When absent, may be assumed to be 1, meaning unsampled ->>>>>>> Add sample rate field to the spec + * When absent means that no sampling has yet been applied ### extensions * Type: Map @@ -237,7 +235,7 @@ that contains both context and data). ### data * Type: Arbitrary payload * Description: The event payload. The payload depends on the event-type, - schema-url and event-type-version, the pyload is encoded into a media format + schema-url and event-type-version, the pyload is encoded into a media format which is specified by the content-type attribute (e.g. application/json). * Constraints: * OPTIONAL From a8cf97d63a90d62b2501e3299d76989ccb59cb10 Mon Sep 17 00:00:00 2001 From: Ben Hartshorne Date: Wed, 21 Feb 2018 15:28:53 -0800 Subject: [PATCH 3/4] rewording based on PR feedback, adding example --- spec.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec.md b/spec.md index ca21e70dd..64e6d9d7a 100644 --- a/spec.md +++ b/spec.md @@ -202,7 +202,7 @@ that contains both context and data). ### content-type * Type: String per [RFC 2046](https://tools.ietf.org/html/rfc2046) -* Description: Describe the data encoding format +* Description: Describe the data encoding format * Constraints: * OPTIONAL * If present, MUST adhere to the format specified in @@ -212,12 +212,14 @@ that contains both context and data). ### sampled-rate * Type: Positive Integer * Description: The rate at which this event has already been sampled. Represents - the denominator of a fraction: when `1/n` events are sent, this field holds - `n`. + the number of similar events that happened but were not sent. * Constraints: * OPTIONAL * If present, MUST be a positive integer * When absent means that no sampling has yet been applied +* Examples: + * If a system sees 30 occurrences and emits a single event as a sample, + `sampled-rate` would be 30. ### extensions * Type: Map @@ -235,7 +237,7 @@ that contains both context and data). ### data * Type: Arbitrary payload * Description: The event payload. The payload depends on the event-type, - schema-url and event-type-version, the pyload is encoded into a media format + schema-url and event-type-version, the pyload is encoded into a media format which is specified by the content-type attribute (e.g. application/json). * Constraints: * OPTIONAL From fe5bb116271ababbfe0e5ea60e4b3eb3902b6c95 Mon Sep 17 00:00:00 2001 From: Ben Hartshorne Date: Sun, 25 Mar 2018 22:21:40 -0700 Subject: [PATCH 4/4] Feedback on the PR Signed-off-by: Ben Hartshorne --- spec.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec.md b/spec.md index 64e6d9d7a..1eef64a04 100644 --- a/spec.md +++ b/spec.md @@ -202,7 +202,7 @@ that contains both context and data). ### content-type * Type: String per [RFC 2046](https://tools.ietf.org/html/rfc2046) -* Description: Describe the data encoding format +* Description: Describe the data encoding format * Constraints: * OPTIONAL * If present, MUST adhere to the format specified in @@ -212,14 +212,14 @@ that contains both context and data). ### sampled-rate * Type: Positive Integer * Description: The rate at which this event has already been sampled. Represents - the number of similar events that happened but were not sent. + the number of similar events that happened but were not sent plus this event. * Constraints: * OPTIONAL * If present, MUST be a positive integer - * When absent means that no sampling has yet been applied + * When absent, a default value of 1 MAY be assumed, indicating no sampling * Examples: * If a system sees 30 occurrences and emits a single event as a sample, - `sampled-rate` would be 30. + `sampled-rate` would be 30 (29 not sent and 1 sent). ### extensions * Type: Map @@ -237,7 +237,7 @@ that contains both context and data). ### data * Type: Arbitrary payload * Description: The event payload. The payload depends on the event-type, - schema-url and event-type-version, the pyload is encoded into a media format + schema-url and event-type-version, the payload is encoded into a media format which is specified by the content-type attribute (e.g. application/json). * Constraints: * OPTIONAL