Skip to content
File

Blob: src/workerd/api/analytics-engine.capnp

2.4 KB
1# Copyright (c) 2017-2022 Cloudflare, Inc.
2# Licensed under the Apache 2.0 license found in the LICENSE file or at:
3# https://opensource.org/licenses/Apache-2.0
4 
5@0x8fe697b0d6269a23;
6 
7using Cxx = import "/capnp/c++.capnp";
8$Cxx.namespace("workerd::api");
9$Cxx.allowCancellation;
10 
11# ========================================================================================
12# DO NOT MODIFY BELOW THIS COMMENT -- except if copying from the authoritative version.
13#
14# This protocol belongs to the Data team. Any modifications must be made in the data/schemas
15# repo, and then copied here *after* it has been merged there. Any annotations relating to
16# languages other than C++ should be removed after copying.
17# ========================================================================================
18 
19struct AnalyticsEngineEvent {
20 # Canonical struct for sending events to Analytics Engine
21 
22 # Cloudflare numeric account ID.
23 accountId @0 :Int64;
24 
25 # Name of the dataset this belongs to.
26 # For instance, weather measurements or website visits.
27 dataset @1 :Data;
28 
29 # For tracking breaking changes to the schema
30 schemaVersion @2 :Int64;
31 
32 # Secondary piece of data by which to sample and index events.
33 # For example, Cloudflare zone ID or Waiting Room ID.
34 # Cannot be longer than 64 bytes.
35 # We anticipate allowing users to configure multiple data dimensions
36 # in future, requiring an `index2` and maybe `index3`, hence the name
37 # ending with `1`.
38 index1 @3 :Data;
39 
40 # Timestamp in nanoseconds
41 timestamp @4 :Int64;
42 
43 double1 @5 :Float64;
44 double2 @6 :Float64;
45 double3 @7 :Float64;
46 double4 @8 :Float64;
47 double5 @9 :Float64;
48 double6 @10 :Float64;
49 double7 @11 :Float64;
50 double8 @12 :Float64;
51 double9 @13 :Float64;
52 double10 @14 :Float64;
53 double11 @15 :Float64;
54 double12 @16 :Float64;
55 double13 @17 :Float64;
56 double14 @18 :Float64;
57 double15 @19 :Float64;
58 double16 @20 :Float64;
59 double17 @21 :Float64;
60 double18 @22 :Float64;
61 double19 @23 :Float64;
62 double20 @24 :Float64;
63 
64 # The total length of all blobs cannot exceed 256*20 = 5120 bytes.
65 blob1 @25 :Data;
66 blob2 @26 :Data;
67 blob3 @27 :Data;
68 blob4 @28 :Data;
69 blob5 @29 :Data;
70 blob6 @30 :Data;
71 blob7 @31 :Data;
72 blob8 @32 :Data;
73 blob9 @33 :Data;
74 blob10 @34 :Data;
75 blob11 @35 :Data;
76 blob12 @36 :Data;
77 blob13 @37 :Data;
78 blob14 @38 :Data;
79 blob15 @39 :Data;
80 blob16 @40 :Data;
81 blob17 @41 :Data;
82 blob18 @42 :Data;
83 blob19 @43 :Data;
84 blob20 @44 :Data;
85}