// Copyright 2021 NSONE, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package bulkbeacon_v2; //// // The network location from which a measurement was taken. Pulsar stores data at Geo+ASN // granularity. If an IP address is specified we will use it to determine Geo+ASN. The full // IP address is not stored by our systems. message IPAddress { // IPv4 or IPv6 host address. string address = 1; } //// // The Geo+ASN location from which a measurement was taken. message GeoAsn { // ISO 3166-1 (alpha-2) country code. This value is REQUIRED. string geo_country = 1; // ISO 3166-2 subdivision code. This value is OPTIONAL. string geo_subdiv = 2; // ASN (network number). This value is OPTIONAL. int32 asn = 3; } //// // Unification of attributes that identify the source of a measurement and the NS1 customer // owning the data. message Attribution { // REQUIRED. Associated measurement will we discarded without this. string appid = 1; // REQUIRED. Associated measurement will we discarded without this. string jobid = 2; // REQUIRED. Where the measurement was taken, or the location it should be associated with. oneof location { IPAddress ip = 3; GeoAsn geo_asn = 4; } } //// // Metadata concerning "static" metrics. message StaticMetricMetadata { // Time-to-live value in seconds. This determines how long we will retain this data and thus // use it for making routing decisions. // This value is OPTIONAL but since all data points require a TTL if this value is not present // we will use the TTL value from associated Pulsar app/job. int32 ttl = 1; } //// // A simple, single latency value. Use this if your measurement process captures only end-to-end // timings of TTLB (time to last byte). message LatencyMetric { int32 value = 1; } //// // A single value of uninterpreted dimension. message PerformanceScoreMetric { double value = 1; StaticMetricMetadata meta = 2; } message AvailabilityMetric { // Final HTTP status code resulting from fetching this data. If you don't know // this value (or can't observe it) use 200 to indicate success and 650 to indicate failure. int32 status_code = 1; } message AvailabilityScoreMetric { // An availability "score" between 0 and 1.0 where 0 means totally unavailable and 1.0 mean // totally available. double value = 1; StaticMetricMetadata meta = 2; } message Payload { oneof metric { LatencyMetric latency = 1; PerformanceScoreMetric perf_score = 2; AvailabilityMetric avail = 3; AvailabilityScoreMetric avail_score = 4; } } message Metrics { // the Ability to send static beacons is set on the app/job level // Maybe TTL goes here? Attribution attribution = 1; repeated Payload payloads = 3; } message Beacons { Attribution default_attribution = 1; StaticMetricMetadata default_static_metadata = 2; repeated Metrics metrics = 3; } message IngestResult { uint32 processed = 1; uint32 failed = 2; } // Interface exported by the server. service PulsarDataIngestion { rpc Ingest (Beacons) returns (IngestResult) { } }