From 3efaaf92068632648c7f34fe47e8a200fa9faea8 Mon Sep 17 00:00:00 2001 From: Robert Lin Date: Thu, 28 Sep 2023 13:51:44 -0700 Subject: [PATCH] doc/telemetry: add exported events schema (#57106) This adds a generated markdown reference that can serve as a source-of-truth for exactly what data we do and don't export from Sourcegraph instances. Table output is a little funky, unless https://github.com/pseudomuto/protoc-gen-doc/pull/520 gets landed one day (for that new `br` template function) --------- Co-authored-by: William Bezuidenhout --- WORKSPACE | 28 +- deps.bzl | 255 ++++++------ dev/BUILD.bazel | 1 + dev/tools.go | 3 + doc/BUILD.bazel | 1 + .../telemetry/BUILD.bazel | 22 + .../background-information/telemetry/index.md | 4 + .../telemetry/protocol.md | 386 ++++++++++++++++++ go.mod | 36 +- go.sum | 71 ++-- internal/telemetrygateway/v1/BUILD.bazel | 9 + .../telemetrygateway/v1/protoc-gen-doc.tmpl | 111 +++++ 12 files changed, 742 insertions(+), 185 deletions(-) create mode 100644 doc/dev/background-information/telemetry/BUILD.bazel create mode 100644 doc/dev/background-information/telemetry/protocol.md create mode 100644 internal/telemetrygateway/v1/protoc-gen-doc.tmpl diff --git a/WORKSPACE b/WORKSPACE index 1de86271e1ac..9cc3a79626a9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -58,6 +58,13 @@ http_archive( ], ) +http_archive( + name = "rules_proto_grpc", + sha256 = "9ba7299c5eb6ec45b6b9a0ceb9916d0ab96789ac8218269322f0124c0c0d24e2", + strip_prefix = "rules_proto_grpc-4.5.0", + urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/releases/download/4.5.0/rules_proto_grpc-4.5.0.tar.gz"], +) + http_archive( name = "rules_buf", sha256 = "523a4e06f0746661e092d083757263a249fedca535bd6dd819a8c50de074731a", @@ -241,16 +248,15 @@ load("@webpack//:npm_repositories.bzl", webpack_npm_repositories = "npm_reposito webpack_npm_repositories() # Go toolchain setup +load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains") -load("@rules_buf//buf:repositories.bzl", "rules_buf_dependencies", "rules_buf_toolchains") - -rules_buf_dependencies() +rules_proto_grpc_toolchains() -rules_buf_toolchains(version = "v1.11.0") +rules_proto_grpc_repos() -load("@rules_buf//gazelle/buf:repositories.bzl", "gazelle_buf_dependencies") +load("@rules_proto_grpc//doc:repositories.bzl", rules_proto_grpc_doc_repos = "doc_repos") -gazelle_buf_dependencies() +rules_proto_grpc_doc_repos() load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") @@ -258,6 +264,16 @@ rules_proto_dependencies() rules_proto_toolchains() +load("@rules_buf//buf:repositories.bzl", "rules_buf_dependencies", "rules_buf_toolchains") + +rules_buf_dependencies() + +rules_buf_toolchains(version = "v1.11.0") + +load("@rules_buf//gazelle/buf:repositories.bzl", "gazelle_buf_dependencies") + +gazelle_buf_dependencies() + load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") load("//:linter_deps.bzl", "linter_dependencies") diff --git a/deps.bzl b/deps.bzl index 65d421ed1697..86ebcd2bc8db 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1132,6 +1132,7 @@ def go_dependencies(): sum = "h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=", version = "v1.0.0", ) + go_repository( name = "com_github_chzyer_logex", build_file_proto_mode = "disable_global", @@ -2004,8 +2005,8 @@ def go_dependencies(): name = "com_github_envoyproxy_protoc_gen_validate", build_file_proto_mode = "disable_global", importpath = "github.com/envoyproxy/protoc-gen-validate", - sum = "h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=", - version = "v0.10.1", + sum = "h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=", + version = "v1.0.2", ) go_repository( @@ -3256,6 +3257,7 @@ def go_dependencies(): sum = "h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA=", version = "v1.0.0", ) + go_repository( name = "com_github_googlecloudplatform_opentelemetry_operations_go_detectors_gcp", build_file_proto_mode = "disable_global", @@ -3845,8 +3847,8 @@ def go_dependencies(): name = "com_github_huandu_xstrings", build_file_proto_mode = "disable_global", importpath = "github.com/huandu/xstrings", - sum = "h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=", - version = "v1.3.2", + sum = "h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=", + version = "v1.4.0", ) go_repository( name = "com_github_hydrogen18_memlistener", @@ -3859,8 +3861,8 @@ def go_dependencies(): name = "com_github_iancoleman_orderedmap", build_file_proto_mode = "disable_global", importpath = "github.com/iancoleman/orderedmap", - sum = "h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=", - version = "v0.0.0-20190318233801-ac98e3ecb4b0", + sum = "h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA=", + version = "v0.2.0", ) go_repository( @@ -4592,8 +4594,8 @@ def go_dependencies(): name = "com_github_lyft_protoc_gen_star_v2", build_file_proto_mode = "disable_global", importpath = "github.com/lyft/protoc-gen-star/v2", - sum = "h1:keaAo8hRuAT0O3DfJ/wM3rufbAjGeJ1lAtWZHDjKGB0=", - version = "v2.0.1", + sum = "h1:/3+/2sWyXeMLzKd1bX+ixWKgEMsULrIivpDsuaF441o=", + version = "v2.0.3", ) go_repository( @@ -5780,8 +5782,8 @@ def go_dependencies(): name = "com_github_pseudomuto_protokit", build_file_proto_mode = "disable_global", importpath = "github.com/pseudomuto/protokit", - sum = "h1:hlnBDcy3YEDXH7kc9gV+NLaN0cDzhDvD1s7Y6FZ8RpM=", - version = "v0.2.0", + sum = "h1:kCYpE3thoR6Esm0CUvd5xbrDTOZPvQPTDeyXpZfrJdk=", + version = "v0.2.1", ) go_repository( name = "com_github_puerkitobio_goquery", @@ -7218,8 +7220,8 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go", - sum = "h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk=", - version = "v0.110.4", + sum = "h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME=", + version = "v0.110.8", ) go_repository( name = "com_google_cloud_go_accessapproval", @@ -7239,15 +7241,15 @@ def go_dependencies(): name = "com_google_cloud_go_aiplatform", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/aiplatform", - sum = "h1:FLTOQdXDqigyOPYrGGE5AiTpDyRROIZrPU1eXfKzKTY=", - version = "v1.45.0", + sum = "h1:J89aj+lqwtjn0qpQBMVaiOmDxBkKDEKUwl+GL19RRpc=", + version = "v1.50.0", ) go_repository( name = "com_google_cloud_go_analytics", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/analytics", - sum = "h1:T400N/hkELka6OsgK20JYoit0xvKnZtWoe36ft4wGBs=", - version = "v0.21.2", + sum = "h1:TFBC1ZAqX9/jL56GEXdLrVe5vT3I22bDVWyDwZX4IEg=", + version = "v0.21.3", ) go_repository( name = "com_google_cloud_go_apigateway", @@ -7317,22 +7319,22 @@ def go_dependencies(): name = "com_google_cloud_go_baremetalsolution", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/baremetalsolution", - sum = "h1:0Ge9PQAy6cZ1tRrkc44UVgYV15nw2TVnzJzYsMHXF+E=", - version = "v1.1.1", + sum = "h1:3zztyuQHjfU0C0qEsI9LkC3kf5/TQQ3jUJhbmetUoRA=", + version = "v1.2.0", ) go_repository( name = "com_google_cloud_go_batch", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/batch", - sum = "h1:uE0Q//W7FOGPjf7nuPiP0zoE8wOT3ngoIO2HIet0ilY=", - version = "v1.3.1", + sum = "h1:/4ADpZKoKH300HN2SB6aI7lXX/0hnnbR74wxjLHkyQo=", + version = "v1.4.1", ) go_repository( name = "com_google_cloud_go_beyondcorp", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/beyondcorp", - sum = "h1:doSatyJyIY1ffqsHuv5DiPSYoXZRIUrJYLArWLZqE/E=", - version = "v0.6.1", + sum = "h1:VPg+fZXULQjs8LiMeWdLaB5oe8G9sEoZ0I0j6IMiG1Q=", + version = "v1.0.0", ) go_repository( name = "com_google_cloud_go_bigquery", @@ -7341,22 +7343,22 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/bigquery", - sum = "h1:JKLNdxI0N+TIUWD6t9KN646X27N5dQWq9dZbbTWZ8hc=", - version = "v1.52.0", + sum = "h1:hs44Xxov3XLWQiCx2J8lK5U/ihLqnpm4RVVl5fdtLLI=", + version = "v1.55.0", ) go_repository( name = "com_google_cloud_go_billing", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/billing", - sum = "h1:1iktEAIZ2uA6KpebC235zi/rCXDdDYQ0bTXTNetSL80=", - version = "v1.16.0", + sum = "h1:CpagWXb/+QNye+vouomndbc4Gsr0uo+AGR24V16uk8Q=", + version = "v1.17.0", ) go_repository( name = "com_google_cloud_go_binaryauthorization", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/binaryauthorization", - sum = "h1:cAkOhf1ic92zEN4U1zRoSupTmwmxHfklcp1X7CCBKvE=", - version = "v1.6.1", + sum = "h1:7L6uUWo/xNCfdVNnnzh2M4x5YA732YPgqRdCG8aKVAU=", + version = "v1.7.0", ) go_repository( name = "com_google_cloud_go_certificatemanager", @@ -7369,36 +7371,36 @@ def go_dependencies(): name = "com_google_cloud_go_channel", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/channel", - sum = "h1:dqRkK2k7Ll/HHeYGxv18RrfhozNxuTJRkspW0iaFZoY=", - version = "v1.16.0", + sum = "h1:Hy2EaOiOB7BS1IJmg2lLilEo8uMfFWTy7RgjTzbUqjM=", + version = "v1.17.0", ) go_repository( name = "com_google_cloud_go_cloudbuild", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/cloudbuild", - sum = "h1:N6Tl7Xhi0+GWGdt0i2WwaLZKgKeGP4m9A/cERzZcU5k=", - version = "v1.10.1", + sum = "h1:YTMxmFra7eIjKFgnyQUxOwWNseNqeO38kGh7thy7v4s=", + version = "v1.14.0", ) go_repository( name = "com_google_cloud_go_clouddms", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/clouddms", - sum = "h1:rjR1nV6oVf2aNNB7B5uz1PDIlBjlOiBgR+q5n7bbB7M=", - version = "v1.6.1", + sum = "h1:vTcaFaFZTZZ11gXB6aZHdAx+zn30P8YJw4X/S3NC+VQ=", + version = "v1.7.0", ) go_repository( name = "com_google_cloud_go_cloudtasks", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/cloudtasks", - sum = "h1:zyF35LjQyVQQnWbglmVDbsgOHqkbkaxTeRDisEJsXtE=", - version = "v1.11.1", + sum = "h1:cMh9Q6dkvh+Ry5LAPbD/U2aw6KAqdiU6FttwhbTo69w=", + version = "v1.12.1", ) go_repository( name = "com_google_cloud_go_compute", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/compute", - sum = "h1:cB8R6FtUtT1TYGl5R3xuxnW6OUIc/DrT2aiR16TTG7Y=", - version = "v1.22.0", + sum = "h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=", + version = "v1.23.0", ) go_repository( name = "com_google_cloud_go_compute_metadata", @@ -7411,29 +7413,29 @@ def go_dependencies(): name = "com_google_cloud_go_contactcenterinsights", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/contactcenterinsights", - sum = "h1:hy4L0bc3fQNZZrhPjuoH62RiisD5B71/S1OZNunsTRk=", - version = "v1.9.1", + sum = "h1:YR2aPedGVQPpFBZXJnPkqRj8M//8veIZZH5ZvICoXnI=", + version = "v1.10.0", ) go_repository( name = "com_google_cloud_go_container", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/container", - sum = "h1:WKBegIfJJc+CL2PIgNpQuvLgGW/CoGJjge5Yjpc0YuU=", - version = "v1.22.1", + sum = "h1:SszQdI0qlyKsImz8/l26rpTZMyqvaH9yfua7rirDZvY=", + version = "v1.26.0", ) go_repository( name = "com_google_cloud_go_containeranalysis", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/containeranalysis", - sum = "h1:SM/ibWHWp4TYyJMwrILtcBtYKObyupwOVeceI9pNblw=", - version = "v0.10.1", + sum = "h1:/EsoP+UTIjvl4yqrLA4WgUG83kwQhqZmbXEfqirT2LM=", + version = "v0.11.0", ) go_repository( name = "com_google_cloud_go_datacatalog", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/datacatalog", - sum = "h1:cFPBt8V5V2T3mu/96tc4nhcMB+5cYcpwjBfn79bZDI8=", - version = "v1.14.1", + sum = "h1:qGWrlYvWtK+8jD1jhwq5BsGoSr7S4/LOroV7LwXi00g=", + version = "v1.17.1", ) go_repository( name = "com_google_cloud_go_dataflow", @@ -7467,16 +7469,17 @@ def go_dependencies(): name = "com_google_cloud_go_dataplex", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/dataplex", - sum = "h1:RvUH/k3Qi5AOXUAmQVsNCcND9qwJJq3biMSPngO0TQY=", - version = "v1.8.1", + sum = "h1:wqPAP1vRskOoWwNka1yey2wxxCrxRrcxJf78MyFvrbs=", + version = "v1.9.1", ) go_repository( - name = "com_google_cloud_go_dataproc", + name = "com_google_cloud_go_dataproc_v2", build_file_proto_mode = "disable_global", - importpath = "cloud.google.com/go/dataproc", - sum = "h1:W47qHL3W4BPkAIbk4SWmIERwsWBaNnWm0P2sdx3YgGU=", - version = "v1.12.0", + importpath = "cloud.google.com/go/dataproc/v2", + sum = "h1:jKijbdsERm2hy/5dFl/LeQN+7CNssLdGXQYBMvMH/M4=", + version = "v2.2.0", ) + go_repository( name = "com_google_cloud_go_dataqna", build_file_proto_mode = "disable_global", @@ -7488,29 +7491,29 @@ def go_dependencies(): name = "com_google_cloud_go_datastore", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/datastore", - sum = "h1:i8HMKsqg/Sl3ZlOTGl471Z8j2uKtbRDT9VXJUIVlMik=", - version = "v1.12.1", + sum = "h1:Mq0ApTRdLW3/dyiw+DkjTk0+iGIUvkbzaC8sfPwWTH4=", + version = "v1.14.0", ) go_repository( name = "com_google_cloud_go_datastream", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/datastream", - sum = "h1:BxAt9Tvi1hoEqI4fvyXh/Oc8vd7b5aCZb3bzewh8Dvg=", - version = "v1.9.1", + sum = "h1:ra/+jMv36zTAGPfi8TRne1hXme+UsKtdcK4j6bnqQiw=", + version = "v1.10.0", ) go_repository( name = "com_google_cloud_go_deploy", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/deploy", - sum = "h1:rp+Sf2bWuqJYBuygQl6diFAdvlR8kklhD+stDvyl1zM=", - version = "v1.11.0", + sum = "h1:A+w/xpWgz99EYzB6e31gMGAI/P5jTZ2UO7veQK5jQ8o=", + version = "v1.13.0", ) go_repository( name = "com_google_cloud_go_dialogflow", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/dialogflow", - sum = "h1:kP0t9SX0w3Fbs1q36mSZ3GQuyOgauVhdNXw0wK4cmOI=", - version = "v1.38.0", + sum = "h1:0hBV5ipVbhYNKCyiBoM47bUt+43Kd8eWXhBr+pwUSTw=", + version = "v1.43.0", ) go_repository( name = "com_google_cloud_go_dlp", @@ -7523,8 +7526,8 @@ def go_dependencies(): name = "com_google_cloud_go_documentai", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/documentai", - sum = "h1:DK9nDulPQgdy3pJIYjMIRrFSAe/Ch3TpfHVn83aV/Gk=", - version = "v1.20.0", + sum = "h1:cBndyac7kPWwSuhUcgdbnqzszfZ57HBEHfD33DIwsBM=", + version = "v1.22.1", ) go_repository( name = "com_google_cloud_go_domains", @@ -7559,8 +7562,8 @@ def go_dependencies(): name = "com_google_cloud_go_eventarc", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/eventarc", - sum = "h1:8ZAkv7MTnAhix5kSw+Cm/xVzG8+OhC+flZGL9iRdpQA=", - version = "v1.12.1", + sum = "h1:xIP3XZi0Xawx8DEfh++mE2lrIi5kQmCr/KcWhJ1q0J4=", + version = "v1.13.0", ) go_repository( name = "com_google_cloud_go_filestore", @@ -7573,8 +7576,8 @@ def go_dependencies(): name = "com_google_cloud_go_firestore", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/firestore", - sum = "h1:PPgtwcYUOXV2jFe1bV3nda3RCrOa8cvBjTOn2MQVfW8=", - version = "v1.11.0", + sum = "h1:/3S4RssUV4GO/kvgJZB+tayjhOfyAHs+KcpJgRVu/Qk=", + version = "v1.13.0", ) go_repository( @@ -7589,8 +7592,8 @@ def go_dependencies(): name = "com_google_cloud_go_gkebackup", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/gkebackup", - sum = "h1:lgyrpdhtJKV7l1GM15YFt+OCyHMxsQZuSydyNmS0Pxo=", - version = "v1.3.0", + sum = "h1:Kfha8SOF2tqsu4O4jVle66mk7qNdlJ2KhL3E2YyiNZc=", + version = "v1.3.1", ) go_repository( name = "com_google_cloud_go_gkeconnect", @@ -7610,8 +7613,8 @@ def go_dependencies(): name = "com_google_cloud_go_gkemulticloud", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/gkemulticloud", - sum = "h1:vg81EW3GQ4RO4PT1MdNHE8aF87EiohZp/WwMWfUTTR0=", - version = "v0.6.1", + sum = "h1:MluqhtPVZReoriP5+adGIw+ij/RIeRik8KApCW2WMTw=", + version = "v1.0.0", ) go_repository( @@ -7628,15 +7631,15 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/iam", - sum = "h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y=", - version = "v1.1.1", + sum = "h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4=", + version = "v1.1.2", ) go_repository( name = "com_google_cloud_go_iap", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/iap", - sum = "h1:X1tcp+EoJ/LGX6cUPt3W2D4H2Kbqq0pLAsldnsCjLlE=", - version = "v1.8.1", + sum = "h1:RNhVq/6OMI99/wjPVhqFxjlBxYOBRdaG6rLpBvyaqYY=", + version = "v1.9.0", ) go_repository( name = "com_google_cloud_go_ids", @@ -7659,15 +7662,15 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/kms", - sum = "h1:xZmZuwy2cwzsocmKDOPu4BL7umg8QXagQx6fKVmf45U=", - version = "v1.12.1", + sum = "h1:lh6qra6oC4AyWe5fUUUBe/S27k12OHAleOOOw6KakdE=", + version = "v1.15.2", ) go_repository( name = "com_google_cloud_go_language", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/language", - sum = "h1:3MXeGEv8AlX+O2LyV4pO4NGpodanc26AmXwOuipEym0=", - version = "v1.10.1", + sum = "h1:KnYolG0T5Oex722ZW/sP5QErhVAVNcqpJ16tVJd9RTw=", + version = "v1.11.0", ) go_repository( name = "com_google_cloud_go_lifesciences", @@ -7680,8 +7683,8 @@ def go_dependencies(): name = "com_google_cloud_go_logging", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/logging", - sum = "h1:CJYxlNNNNAMkHp9em/YEXcfJg+rPDg7YfwoRpMU+t5I=", - version = "v1.7.0", + sum = "h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU=", + version = "v1.8.1", ) go_repository( @@ -7702,8 +7705,8 @@ def go_dependencies(): name = "com_google_cloud_go_maps", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/maps", - sum = "h1:m4BlGu0qnPwuq5aToT3atcVckS+hf40jsRXveJhusJI=", - version = "v1.3.0", + sum = "h1:PdfgpBLhAoSzZrQXP+/zBc78fIPLZSJp5y8+qSMn2UU=", + version = "v1.4.0", ) go_repository( @@ -7724,8 +7727,8 @@ def go_dependencies(): name = "com_google_cloud_go_metastore", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/metastore", - sum = "h1:sF2yYgo2P4b3hJP2LlIZoafZixtabF/fnORDDMkFeqQ=", - version = "v1.11.1", + sum = "h1:+9DsxUOHvsqvC0ylrRc/JwzbXJaaBpfIK3tX0Lx8Tcc=", + version = "v1.12.0", ) go_repository( name = "com_google_cloud_go_monitoring", @@ -7740,22 +7743,22 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/monitoring", - sum = "h1:65JhLMd+JiYnXr6j5Z63dUYCuOg770p8a/VC+gil/58=", - version = "v1.15.1", + sum = "h1:rlndy4K8yknMY9JuGe2aK4SbCh21FXoCdX7SAGHmRgI=", + version = "v1.16.0", ) go_repository( name = "com_google_cloud_go_networkconnectivity", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/networkconnectivity", - sum = "h1:LnrYM6lBEeTq+9f2lR4DjBhv31EROSAQi/P5W4Q0AEc=", - version = "v1.12.1", + sum = "h1:kG2PX6URJ9Kvotfdm+hH8WIhrRY77sAKytUGOz+MgN0=", + version = "v1.13.0", ) go_repository( name = "com_google_cloud_go_networkmanagement", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/networkmanagement", - sum = "h1:/3xP37eMxnyvkfLrsm1nv1b2FbMMSAEAOlECTvoeCq4=", - version = "v1.8.0", + sum = "h1:aA6L8aioyM4S6nlPYzp2SvB88lBcByZmqMJM6ReafzU=", + version = "v1.9.0", ) go_repository( name = "com_google_cloud_go_networksecurity", @@ -7768,15 +7771,15 @@ def go_dependencies(): name = "com_google_cloud_go_notebooks", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/notebooks", - sum = "h1:CUqMNEtv4EHFnbogV+yGHQH5iAQLmijOx191innpOcs=", - version = "v1.9.1", + sum = "h1:6x2K1JAWv6RW2yQO6oa+xtKUGOpGQseCmT94vpOt1vc=", + version = "v1.10.0", ) go_repository( name = "com_google_cloud_go_optimization", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/optimization", - sum = "h1:pEwOAmO00mxdbesCRSsfj8Sd4rKY9kBrYW7Vd3Pq7cA=", - version = "v1.4.1", + sum = "h1:sGvPVtBJUKNYAwldhJvFmnM+EEdOXjDzjcly3g0n0Xg=", + version = "v1.5.0", ) go_repository( name = "com_google_cloud_go_orchestration", @@ -7817,8 +7820,8 @@ def go_dependencies(): name = "com_google_cloud_go_policytroubleshooter", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/policytroubleshooter", - sum = "h1:AZ2n6dw6OnYpDZAUk6WK1drupzTWNMRk/uatXEIDAsU=", - version = "v1.7.1", + sum = "h1:pT4qSiL5o0hBSWHDiOcmes/s301PeLLWEhAr/eMQB/g=", + version = "v1.9.0", ) go_repository( name = "com_google_cloud_go_privatecatalog", @@ -7842,8 +7845,8 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/pubsub", - sum = "h1:JOEkgEYBuUTHSyHS4TcqOFuWr+vD6qO/imsFqShUCp4=", - version = "v1.32.0", + sum = "h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g=", + version = "v1.33.0", ) go_repository( name = "com_google_cloud_go_pubsublite", @@ -7871,8 +7874,8 @@ def go_dependencies(): name = "com_google_cloud_go_recommender", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/recommender", - sum = "h1:UKp94UH5/Lv2WXSQe9+FttqV07x/2p1hFTMMYVFtilg=", - version = "v1.10.1", + sum = "h1:SuzbMJhDAiPro7tR9QP7EX97+TI31urjsIgNh9XQHl8=", + version = "v1.11.0", ) go_repository( name = "com_google_cloud_go_redis", @@ -7945,8 +7948,8 @@ def go_dependencies(): name = "com_google_cloud_go_servicedirectory", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/servicedirectory", - sum = "h1:J/0csas97yAQ+dcc7i8HqbaOA4KOfPu7BPhJdxYRhCk=", - version = "v1.10.1", + sum = "h1:pBWpjCFVGWkzVTkqN3TBBIqNSoSHY86/6RL0soSQ4z8=", + version = "v1.11.0", ) go_repository( @@ -7960,16 +7963,16 @@ def go_dependencies(): name = "com_google_cloud_go_spanner", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/spanner", - sum = "h1:aqiMP8dhsEXgn9K5EZBWxPG7dxIiyM2VaikqeU4iteg=", - version = "v1.47.0", + sum = "h1:+HY8C4uztU7XyLz3xMi/LCXdetLEOExhvRFJu2NiVXM=", + version = "v1.49.0", ) go_repository( name = "com_google_cloud_go_speech", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/speech", - sum = "h1:KIV99afoYTJqA2qi8Cjbl5DpjSRzvqFgKcptGXg6kxw=", - version = "v1.17.1", + sum = "h1:MCagaq8ObV2tr1kZJcJYgXYbIn8Ai5rp42tyGYw9rls=", + version = "v1.19.0", ) go_repository( name = "com_google_cloud_go_storage", @@ -8025,15 +8028,15 @@ def go_dependencies(): name = "com_google_cloud_go_translate", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/translate", - sum = "h1:7P75urEfnR/gU+7oYn5GuMsV9tJAiBGLJv06G10mM/E=", - version = "v1.8.1", + sum = "h1:0na4gC54Lu05ir00dmUSuMkLAojDe1ALq4hBTUkhwjE=", + version = "v1.9.0", ) go_repository( name = "com_google_cloud_go_video", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/video", - sum = "h1:gWi0caJILQb9VwZPq28R1Wrg5YMsoLIvtvKDSglcQL8=", - version = "v1.17.1", + sum = "h1:AkjXyJfQ7DtPyDOAbTMeiGcuKsO8/iKSb3fAmTUHYSg=", + version = "v1.20.0", ) go_repository( name = "com_google_cloud_go_videointelligence", @@ -8061,8 +8064,8 @@ def go_dependencies(): name = "com_google_cloud_go_vmwareengine", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/vmwareengine", - sum = "h1:roQrCAkaysVvXxFMuK26lORi+gablOY54htDtDDow0w=", - version = "v0.4.1", + sum = "h1:qsJ0CPlOQu/3MFBGklu752v3AkD+Pdu091UmXJ+EjTA=", + version = "v1.0.0", ) go_repository( @@ -8090,8 +8093,8 @@ def go_dependencies(): name = "com_google_cloud_go_workflows", build_file_proto_mode = "disable_global", importpath = "cloud.google.com/go/workflows", - sum = "h1:2akeQ/PgtRhrNuD/n1WvJd5zb7YyuDZrlOanBj2ihPg=", - version = "v1.11.1", + sum = "h1:cSUlx4PVV9O0vYCl+pHAUmu0996A7eN602d4wjjVHRs=", + version = "v1.12.0", ) go_repository( name = "com_jolheiser_go_hcaptcha", @@ -9128,15 +9131,15 @@ def go_dependencies(): ], build_file_proto_mode = "disable_global", importpath = "google.golang.org/genproto", - sum = "h1:+VoAg+OKmWaommL56xmZSE2sUK8A7m6SUO7X89F2tbw=", - version = "v0.0.0-20230717213848-3f92550aa753", + sum = "h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0=", + version = "v0.0.0-20230920204549-e6e6cdab5c13", ) go_repository( name = "org_golang_google_genproto_googleapis_api", build_file_proto_mode = "disable_global", importpath = "google.golang.org/genproto/googleapis/api", - sum = "h1:lCbbUxUDD+DiXx9Q6F/ttL0aAu7N2pz8XnmMm8ZW4NE=", - version = "v0.0.0-20230717213848-3f92550aa753", + sum = "h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE=", + version = "v0.0.0-20230920204549-e6e6cdab5c13", ) go_repository( name = "org_golang_google_genproto_googleapis_bytestream", @@ -9149,8 +9152,8 @@ def go_dependencies(): name = "org_golang_google_genproto_googleapis_rpc", build_file_proto_mode = "disable_global", importpath = "google.golang.org/genproto/googleapis/rpc", - sum = "h1:XUODHrpzJEUeWmVo/jfNTLj0YyVveOo28oE6vkFbkO4=", - version = "v0.0.0-20230717213848-3f92550aa753", + sum = "h1:tdhlmiMZNpc5p2W5qqKgRrOubaMZ3c85uG/GJtGgL98=", + version = "v0.0.0-20230920183334-c177e329c48b", ) go_repository( @@ -9173,8 +9176,8 @@ def go_dependencies(): name = "org_golang_x_crypto", build_file_proto_mode = "disable_global", importpath = "golang.org/x/crypto", - sum = "h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=", - version = "v0.12.0", + sum = "h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=", + version = "v0.13.0", ) go_repository( name = "org_golang_x_exp", @@ -9215,8 +9218,8 @@ def go_dependencies(): name = "org_golang_x_net", build_file_proto_mode = "disable_global", importpath = "golang.org/x/net", - sum = "h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=", - version = "v0.14.0", + sum = "h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=", + version = "v0.15.0", ) go_repository( name = "org_golang_x_oauth2", @@ -9244,8 +9247,8 @@ def go_dependencies(): name = "org_golang_x_term", build_file_proto_mode = "disable_global", importpath = "golang.org/x/term", - sum = "h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=", - version = "v0.11.0", + sum = "h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=", + version = "v0.12.0", ) go_repository( name = "org_golang_x_text", diff --git a/dev/BUILD.bazel b/dev/BUILD.bazel index 54c0bec983f5..eb05e7e0f950 100644 --- a/dev/BUILD.bazel +++ b/dev/BUILD.bazel @@ -15,6 +15,7 @@ write_source_files( "//doc/admin/observability:write_monitoring_docs", "//doc/cli/references:write_doc_files", "//doc/dev/background-information/sg:write_cli_reference_doc", + "//doc/dev/background-information/telemetry:write_telemetrygateway_doc", "//cmd/frontend/internal/guardrails/dotcom:write_genql_yaml", "//internal/batches/search/syntax:write_token_type", "//internal/rbac:write_generated", diff --git a/dev/tools.go b/dev/tools.go index 17d4576f8f40..55cb8b9b78c8 100644 --- a/dev/tools.go +++ b/dev/tools.go @@ -22,4 +22,7 @@ import ( // Used for cody-gateway to generate a GraphQL client _ "github.com/Khan/genqlient" + + // Used to generate schema + _ "github.com/pseudomuto/protoc-gen-doc" ) diff --git a/doc/BUILD.bazel b/doc/BUILD.bazel index 75859c975877..a71755f5b9cf 100644 --- a/doc/BUILD.bazel +++ b/doc/BUILD.bazel @@ -9,6 +9,7 @@ sh_test( "//doc/admin/observability:doc_files", "//doc/cli/references:doc_files", "//doc/dev/background-information/sg:doc_files", + "//doc/dev/background-information/telemetry:doc_files", ] + glob( ["**/*"], ["test.sh"], diff --git a/doc/dev/background-information/telemetry/BUILD.bazel b/doc/dev/background-information/telemetry/BUILD.bazel new file mode 100644 index 000000000000..08250341b28a --- /dev/null +++ b/doc/dev/background-information/telemetry/BUILD.bazel @@ -0,0 +1,22 @@ +load("//dev:write_generated_to_source_files.bzl", "write_generated_to_source_files") + +filegroup( + name = "doc_files", + srcs = glob( + ["**/*"], + [ + ".gitattributes", + ], + ), + visibility = ["//doc:__pkg__"], +) + +write_generated_to_source_files( + name = "write_telemetrygateway_doc", + src = "//internal/telemetrygateway/v1:protocol.md", + files = [ + "internal/telemetrygateway/v1/protocol.md/protocol.md", + ], + strip_prefix = "internal/telemetrygateway/v1/protocol.md/", + tags = ["go_generate"], +) diff --git a/doc/dev/background-information/telemetry/index.md b/doc/dev/background-information/telemetry/index.md index ba9280ae335f..ad21b1dfe852 100644 --- a/doc/dev/background-information/telemetry/index.md +++ b/doc/dev/background-information/telemetry/index.md @@ -94,6 +94,8 @@ There are two core attributes in events that are considered potentially sensitiv - Certain events may be allowlisted to have this field exported - this is defined in [`internal/telemetry/sensitiviemetadataallowlist`](https://github.com/sourcegraph/sourcegraph/blob/main/internal/telemetry/sensitivemetadataallowlist/sensitiviemetadataallowlist.go). Adding events to this list requires review and approval from Legal. - `marketingTracking`: this field tracks a lot of properties around URLs visited and marketing tracking that may contain sensitive data. This is only exported from the [Sourcegraph.com](https://sourcegraph.com/search) instance. +A detailed schema is available in [the Telemetry Gateway protocol documentation](./protocol.md), which also has more details about what kind of data gets exported and what components are generally pruned. + ### Exported event schema The full event schema is intentionally a significant superset from the shape of the [event-recording APIs](#recording-events). @@ -114,6 +116,8 @@ The full event schema that ends up getting exported is defined in [`telemetrygat } ``` +A detailed schema is available in [the Telemetry Gateway protocol documentation](./protocol.md), which also has more details about what kind of data gets exported and what components are generally pruned - also see [sensitive attributes](#sensitive-attributes) above. + > NOTE: In the Sourcegraph application, the new events being exported using `internal/telemetry` are sometimes loosely referred to as "V2", as it supersedes the existing mechanisms of writing directly to the `event_logs` database table. > The *Telemetry Gateway* schema, however, is `telemetrygateway/v1`, as it is the first iteration of the service's API. diff --git a/doc/dev/background-information/telemetry/protocol.md b/doc/dev/background-information/telemetry/protocol.md new file mode 100644 index 000000000000..25d1ce850063 --- /dev/null +++ b/doc/dev/background-information/telemetry/protocol.md @@ -0,0 +1,386 @@ +# Telemetry Gateway + + + + +This page contains generated documentation for telemetry event data that gets exported to Sourcegraph from individual Sourcegraph instances. + +## Table of Contents + +- [telemetrygateway/v1/telemetrygateway.proto](#telemetrygateway_v1_telemetrygateway-proto) + - [Event](#telemetrygateway-v1-Event) + - [EventBillingMetadata](#telemetrygateway-v1-EventBillingMetadata) + - [EventFeatureFlags](#telemetrygateway-v1-EventFeatureFlags) + - [EventFeatureFlags.FlagsEntry](#telemetrygateway-v1-EventFeatureFlags-FlagsEntry) + - [EventMarketingTracking](#telemetrygateway-v1-EventMarketingTracking) + - [EventParameters](#telemetrygateway-v1-EventParameters) + - [EventParameters.MetadataEntry](#telemetrygateway-v1-EventParameters-MetadataEntry) + - [EventSource](#telemetrygateway-v1-EventSource) + - [EventSource.Client](#telemetrygateway-v1-EventSource-Client) + - [EventSource.Server](#telemetrygateway-v1-EventSource-Server) + - [EventUser](#telemetrygateway-v1-EventUser) + - [Identifier](#telemetrygateway-v1-Identifier) + - [Identifier.LicensedInstanceIdentifier](#telemetrygateway-v1-Identifier-LicensedInstanceIdentifier) + - [Identifier.UnlicensedInstanceIdenfitier](#telemetrygateway-v1-Identifier-UnlicensedInstanceIdenfitier) + - [RecordEventsRequest](#telemetrygateway-v1-RecordEventsRequest) + - [RecordEventsRequest.EventsPayload](#telemetrygateway-v1-RecordEventsRequest-EventsPayload) + - [RecordEventsRequestMetadata](#telemetrygateway-v1-RecordEventsRequestMetadata) + - [RecordEventsResponse](#telemetrygateway-v1-RecordEventsResponse) + + - [TelemeteryGatewayService](#telemetrygateway-v1-TelemeteryGatewayService) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## telemetrygateway/v1/telemetrygateway.proto + + + + + +### Event + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | |

Generated ID of the event, currently expected to be UUID v4.

| +| timestamp | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | |

Timestamp of when the original event was recorded.

| +| feature | [string](#string) | |

Feature associated with the event in camelCase, e.g. 'myFeature'.

| +| action | [string](#string) | |

Action associated with the event in camelCase, e.g. 'pageView'.

| +| source | [EventSource](#telemetrygateway-v1-EventSource) | |

Source of the event.

| +| parameters | [EventParameters](#telemetrygateway-v1-EventParameters) | |

Parameters of the event.

| +| user | [EventUser](#telemetrygateway-v1-EventUser) | optional |

Optional user associated with the event.

This field should be hydrated by the Sourcegraph server, and not provided

by clients.

| +| feature_flags | [EventFeatureFlags](#telemetrygateway-v1-EventFeatureFlags) | optional |

Optional feature flags configured in the context of the event.

| +| marketing_tracking | [EventMarketingTracking](#telemetrygateway-v1-EventMarketingTracking) | optional |

Optional marketing campaign tracking parameters.

🚨 SECURITY: This metadata is NEVER exported from an instance, and is only

exported for events tracked in the public Sourcegraph.com instance.

| + + + + + + + + +### EventBillingMetadata + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| product | [string](#string) | |

Billing product ID associated with the event.

| +| category | [string](#string) | |

Billing category ID the event falls into.

| + + + + + + + + +### EventFeatureFlags + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| flags | [EventFeatureFlags.FlagsEntry](#telemetrygateway-v1-EventFeatureFlags-FlagsEntry) | repeated |

Evaluated feature flags. In Soucegraph we currently only support boolean

feature flags, but in the API we allow arbitrary string values for future

extensibility.

This field should be hydrated by the Sourcegraph server, and not provided

by clients.

| + + + + + + + + +### EventFeatureFlags.FlagsEntry + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | |

| +| value | [string](#string) | |

| + + + + + + + + +### EventMarketingTracking +Marketing campaign tracking metadata. + +🚨 SECURITY: This metadata is NEVER exported from private Sourcegraph +instances, and is only exported for events tracked in the public +Sourcegraph.com instance. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| url | [string](#string) | optional |

URL the event occurred on.

| +| first_source_url | [string](#string) | optional |

Initial URL the user landed on.

| +| cohort_id | [string](#string) | optional |

Cohort ID to identify the user as part of a specific A/B test.

| +| referrer | [string](#string) | optional |

Referrer URL that refers the user to Sourcegraph.

| +| last_source_url | [string](#string) | optional |

Last source URL visited by the user.

| +| device_session_id | [string](#string) | optional |

Device session ID to identify the user's session.

| +| session_referrer | [string](#string) | optional |

Session referrer URL for the user.

| +| session_first_url | [string](#string) | optional |

First URL the user visited in their current session.

| + + + + + + + + +### EventParameters + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [int32](#int32) | |

Version of the event parameters, used for indicating the "shape" of this

event's metadata, beginning at 0. Useful for denoting if the shape of

metadata has changed in any way.

| +| metadata | [EventParameters.MetadataEntry](#telemetrygateway-v1-EventParameters-MetadataEntry) | repeated |

Strictly typed metadata, restricted to integer values to avoid accidentally

exporting sensitive or private data.

| +| private_metadata | [google.protobuf.Struct](#google-protobuf-Struct) | optional |

Additional potentially sensitive metadata - i.e. not restricted to integer

values.

🚨 SECURITY: This metadata is NOT exported from instances by default, as it

can contain arbitrarily-shaped data that may accidentally contain sensitive

or private contents.

This metadata is only exported on an allowlist basis based on terms of

use agreements and combinations of event feature and action, alongside

careful audit of callsites.

| +| billing_metadata | [EventBillingMetadata](#telemetrygateway-v1-EventBillingMetadata) | optional |

Optional billing-related metadata.

| + + + + + + + + +### EventParameters.MetadataEntry + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | |

| +| value | [int64](#int64) | |

| + + + + + + + + +### EventSource + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| server | [EventSource.Server](#telemetrygateway-v1-EventSource-Server) | |

Information about the Sourcegraph instance that received the event.

| +| client | [EventSource.Client](#telemetrygateway-v1-EventSource-Client) | optional |

Information about the client that generated the event.

| + + + + + + + + +### EventSource.Client + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | |

Source client of the event.

| +| version | [string](#string) | optional |

Version of the cleint.

| + + + + + + + + +### EventSource.Server + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [string](#string) | |

Version of the Sourcegraph server.

| + + + + + + + + +### EventUser + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| user_id | [int64](#int64) | optional |

Database user ID of signed in user. User IDs are specific to a Sourcegraph

instance, and not universal.

We use an int64 as an ID because in Sourcegraph, database user IDs are

always integers.

| +| anonymous_user_id | [string](#string) | optional |

Randomized unique identifier for an actor (e.g. stored in localstorage in

web client).

| + + + + + + + + +### Identifier + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| licensed_instance | [Identifier.LicensedInstanceIdentifier](#telemetrygateway-v1-Identifier-LicensedInstanceIdentifier) | |

A licensed Sourcegraph instance.

| +| unlicensed_instance | [Identifier.UnlicensedInstanceIdenfitier](#telemetrygateway-v1-Identifier-UnlicensedInstanceIdenfitier) | |

An unlicensed Sourcegraph instance.

| + + + + + + + + +### Identifier.LicensedInstanceIdentifier + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| license_key | [string](#string) | |

License key configured in the Sourcegraph instance emitting the event.

| +| instance_id | [string](#string) | |

Self-reported Sourcegraph instance identifier.

| + + + + + + + + +### Identifier.UnlicensedInstanceIdenfitier + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| instance_id | [string](#string) | |

Self-reported Sourcegraph instance identifier.

| + + + + + + + + +### RecordEventsRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [RecordEventsRequestMetadata](#telemetrygateway-v1-RecordEventsRequestMetadata) | |

Metadata about the events being recorded.

| +| events | [RecordEventsRequest.EventsPayload](#telemetrygateway-v1-RecordEventsRequest-EventsPayload) | |

Batch of events to record in a single request. Clients should aim to

batch large event backlogs into a series of smaller requests in the

RecordEvents stream, being mindful of common limits in individual message

sizes: https://protobuf.dev/programming-guides/api/#bound-req-res-sizes

| + + + + + + + + +### RecordEventsRequest.EventsPayload + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| events | [Event](#telemetrygateway-v1-Event) | repeated |

| + + + + + + + + +### RecordEventsRequestMetadata + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| request_id | [string](#string) | |

Client-provided request identifier for diagnostics purposes.

| +| identifier | [Identifier](#telemetrygateway-v1-Identifier) | |

Telemetry source self-identification.

| + + + + + + + + +### RecordEventsResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| succeeded_events | [string](#string) | repeated |

IDs of all events that were successfully recorded in the request.

Note that if succeeded_events is a subset of events that were submitted,

then some events failed to record and should be retried.

| + + + + + + + + + + + + + + +### TelemeteryGatewayService + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| RecordEvents | [RecordEventsRequest](#telemetrygateway-v1-RecordEventsRequest) stream | [RecordEventsResponse](#telemetrygateway-v1-RecordEventsResponse) stream |

RecordEvents streams telemetry events in batches to the Telemetry Gateway

service. Events should only be considered delivered if recording is

acknowledged in RecordEventsResponse.

🚨 SECURITY: Callers should check the attributes of the Event type to ensure

that only the appropriate fields are exported, as some fields should only

be exported on an allowlist basis.

| + + + + + +## Scalar Value Types + +| .proto Type | Notes | +| ----------- | ----- | +| double | | +| float | | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | +| uint32 | Uses variable-length encoding. | +| uint64 | Uses variable-length encoding. | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | +| sfixed32 | Always four bytes. | +| sfixed64 | Always eight bytes. | +| bool | | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | +| bytes | May contain any arbitrary sequence of bytes. | + diff --git a/go.mod b/go.mod index e019401ba9f3..63008e20f6b4 100644 --- a/go.mod +++ b/go.mod @@ -58,11 +58,11 @@ replace ( ) require ( - cloud.google.com/go/bigquery v1.52.0 - cloud.google.com/go/kms v1.12.1 - cloud.google.com/go/monitoring v1.15.1 + cloud.google.com/go/bigquery v1.55.0 + cloud.google.com/go/kms v1.15.2 + cloud.google.com/go/monitoring v1.16.0 cloud.google.com/go/profiler v0.3.1 - cloud.google.com/go/pubsub v1.32.0 + cloud.google.com/go/pubsub v1.33.0 cloud.google.com/go/secretmanager v1.11.1 cloud.google.com/go/storage v1.30.1 github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.41.0 @@ -233,8 +233,8 @@ require ( go.uber.org/automaxprocs v1.5.2 go.uber.org/ratelimit v0.2.0 go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.12.0 - golang.org/x/net v0.14.0 + golang.org/x/crypto v0.13.0 + golang.org/x/net v0.15.0 golang.org/x/oauth2 v0.10.0 golang.org/x/sync v0.3.0 golang.org/x/sys v0.12.0 @@ -244,7 +244,7 @@ require ( golang.org/x/tools v0.10.0 gonum.org/v1/gonum v0.13.0 google.golang.org/api v0.132.0 - google.golang.org/genproto v0.0.0-20230717213848-3f92550aa753 // indirect + google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 // indirect google.golang.org/protobuf v1.31.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v2 v2.4.0 @@ -284,7 +284,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.81.0 go.opentelemetry.io/collector/config/configtls v0.81.0 go.opentelemetry.io/otel/exporters/prometheus v0.39.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230717213848-3f92550aa753 + google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 ) require ( @@ -327,7 +327,7 @@ require ( github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d // indirect - github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect + github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/jackc/pgproto3/v2 v2.3.0 // indirect github.com/klauspost/asmfmt v1.3.2 // indirect @@ -366,14 +366,14 @@ require ( go.opentelemetry.io/collector/processor v0.81.0 // indirect go.uber.org/goleak v1.2.1 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b // indirect ) require ( bitbucket.org/creachadair/shell v0.0.7 // indirect - cloud.google.com/go v0.110.4 // indirect - cloud.google.com/go/compute v1.22.0 // indirect - cloud.google.com/go/iam v1.1.1 // indirect + cloud.google.com/go v0.110.8 // indirect + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/iam v1.1.2 // indirect code.gitea.io/gitea v1.18.0 cuelang.org/go v0.4.3 github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect @@ -430,7 +430,7 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/elimity-com/scim v0.0.0-20220121082953-15165b1a61c8 github.com/emirpasic/gods v1.18.1 // indirect - github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect + github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect github.com/facebookgo/limitgroup v0.0.0-20150612190941-6abd8d71ec01 // indirect @@ -478,7 +478,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hexops/autogold/v2 v2.1.0 github.com/hexops/gotextdiff v1.0.3 - github.com/huandu/xstrings v1.3.2 // indirect + github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/gojq v0.12.11 // indirect @@ -539,8 +539,8 @@ require ( github.com/prometheus/client_model v0.4.0 github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/procfs v0.11.0 // indirect - github.com/pseudomuto/protoc-gen-doc v1.5.1 // indirect - github.com/pseudomuto/protokit v0.2.0 // indirect + github.com/pseudomuto/protoc-gen-doc v1.5.1 + github.com/pseudomuto/protokit v0.2.1 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.9.0 // indirect @@ -580,7 +580,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 golang.org/x/mod v0.12.0 - golang.org/x/term v0.11.0 // indirect + golang.org/x/term v0.12.0 // indirect golang.org/x/text v0.13.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 42d9784d31c8..89551a0040cc 100644 --- a/go.sum +++ b/go.sum @@ -34,47 +34,47 @@ cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2Z cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= -cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME= +cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.52.0 h1:JKLNdxI0N+TIUWD6t9KN646X27N5dQWq9dZbbTWZ8hc= -cloud.google.com/go/bigquery v1.52.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= +cloud.google.com/go/bigquery v1.55.0 h1:hs44Xxov3XLWQiCx2J8lK5U/ihLqnpm4RVVl5fdtLLI= +cloud.google.com/go/bigquery v1.55.0/go.mod h1:9Y5I3PN9kQWuid6183JFhOGOW3GcirA5LpsKCUn+2ec= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.22.0 h1:cB8R6FtUtT1TYGl5R3xuxnW6OUIc/DrT2aiR16TTG7Y= -cloud.google.com/go/compute v1.22.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRVqY1p2IJaBGStWMsQMpkAa83cPkCDLl80eOj0Rbz4= cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= -cloud.google.com/go/datacatalog v1.14.1 h1:cFPBt8V5V2T3mu/96tc4nhcMB+5cYcpwjBfn79bZDI8= +cloud.google.com/go/datacatalog v1.17.1 h1:qGWrlYvWtK+8jD1jhwq5BsGoSr7S4/LOroV7LwXi00g= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/kms v1.12.1 h1:xZmZuwy2cwzsocmKDOPu4BL7umg8QXagQx6fKVmf45U= -cloud.google.com/go/kms v1.12.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/logging v1.7.0 h1:CJYxlNNNNAMkHp9em/YEXcfJg+rPDg7YfwoRpMU+t5I= +cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= +cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/kms v1.15.2 h1:lh6qra6oC4AyWe5fUUUBe/S27k12OHAleOOOw6KakdE= +cloud.google.com/go/kms v1.15.2/go.mod h1:3hopT4+7ooWRCjc2DxgnpESFxhIraaI2IpAVUEhbT/w= +cloud.google.com/go/logging v1.8.1 h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU= cloud.google.com/go/longrunning v0.5.1 h1:Fr7TXftcqTudoyRJa113hyaqlGdiBQkp0Gq7tErFDWI= -cloud.google.com/go/monitoring v1.15.1 h1:65JhLMd+JiYnXr6j5Z63dUYCuOg770p8a/VC+gil/58= -cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= +cloud.google.com/go/monitoring v1.16.0 h1:rlndy4K8yknMY9JuGe2aK4SbCh21FXoCdX7SAGHmRgI= +cloud.google.com/go/monitoring v1.16.0/go.mod h1:Ptp15HgAyM1fNICAojDMoNc/wUmn67mLHQfyqbw+poY= cloud.google.com/go/profiler v0.3.1 h1:b5got9Be9Ia0HVvyt7PavWxXEht15B9lWnigdvHtxOc= cloud.google.com/go/profiler v0.3.1/go.mod h1:GsG14VnmcMFQ9b+kq71wh3EKMZr3WRMgLzNiFRpW7tE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.32.0 h1:JOEkgEYBuUTHSyHS4TcqOFuWr+vD6qO/imsFqShUCp4= -cloud.google.com/go/pubsub v1.32.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= +cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= +cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= cloud.google.com/go/secretmanager v1.11.1 h1:cLTCwAjFh9fKvU6F13Y4L9vPcx9yiWPyWXE4+zkuEQs= cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= @@ -712,8 +712,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= -github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= @@ -1328,10 +1328,11 @@ github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEF github.com/honeycombio/libhoney-go v1.15.8 h1:TECEltZ48K6J4NG1JVYqmi0vCJNnHYooFor83fgKesA= github.com/honeycombio/libhoney-go v1.15.8/go.mod h1:+tnL2etFnJmVx30yqmoUkVyQjp7uRJw0a2QGu48lSyY= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= +github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -1895,8 +1896,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc h1:gSVONBi2HWMFXCa9jFdYvYk7IwW/mTLxWOF7rXS4LO0= github.com/pseudomuto/protoc-gen-doc v1.5.1 h1:Ah259kcrio7Ix1Rhb6u8FCaOkzf9qRBqXnvAufg061w= github.com/pseudomuto/protoc-gen-doc v1.5.1/go.mod h1:XpMKYg6zkcpgfpCfQ8GcWBDRtRxOmMR5w7pz4Xo+dYM= -github.com/pseudomuto/protokit v0.2.0 h1:hlnBDcy3YEDXH7kc9gV+NLaN0cDzhDvD1s7Y6FZ8RpM= -github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= +github.com/pseudomuto/protokit v0.2.1 h1:kCYpE3thoR6Esm0CUvd5xbrDTOZPvQPTDeyXpZfrJdk= +github.com/pseudomuto/protokit v0.2.1/go.mod h1:gt7N5Rz2flBzYafvaxyIxMZC0TTF5jDZfRnw25hAAyo= github.com/qdrant/go-client v1.4.1 h1:kh5B4yWjrd5BcynJoA4014mZlI/j6++inCMMQoKUOtI= github.com/qdrant/go-client v1.4.1/go.mod h1:680gkxNAsVtre0Z8hAQmtPzJtz1xFAyCu2TUxULtnoE= github.com/qustavo/sqlhooks/v2 v2.1.0 h1:54yBemHnGHp/7xgT+pxwmIlMSDNYKx5JW5dfRAiCZi0= @@ -2467,8 +2468,8 @@ golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2608,8 +2609,8 @@ golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2822,8 +2823,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -3108,12 +3109,12 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20230717213848-3f92550aa753 h1:+VoAg+OKmWaommL56xmZSE2sUK8A7m6SUO7X89F2tbw= -google.golang.org/genproto v0.0.0-20230717213848-3f92550aa753/go.mod h1:iqkVr8IRpZ53gx1dEnWlCUIEwDWqWARWrbzpasaTNYM= -google.golang.org/genproto/googleapis/api v0.0.0-20230717213848-3f92550aa753 h1:lCbbUxUDD+DiXx9Q6F/ttL0aAu7N2pz8XnmMm8ZW4NE= -google.golang.org/genproto/googleapis/api v0.0.0-20230717213848-3f92550aa753/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 h1:XUODHrpzJEUeWmVo/jfNTLj0YyVveOo28oE6vkFbkO4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0= +google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:CCviP9RmpZ1mxVr8MUjCnSiY09IbAXZxhLE6EhHIdPU= +google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= +google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b h1:tdhlmiMZNpc5p2W5qqKgRrOubaMZ3c85uG/GJtGgL98= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= diff --git a/internal/telemetrygateway/v1/BUILD.bazel b/internal/telemetrygateway/v1/BUILD.bazel index a89452432f00..fc5ba0fda72d 100644 --- a/internal/telemetrygateway/v1/BUILD.bazel +++ b/internal/telemetrygateway/v1/BUILD.bazel @@ -95,3 +95,12 @@ go_test( "@org_golang_google_protobuf//types/known/timestamppb", ], ) + +load("@rules_proto_grpc//doc:defs.bzl", "doc_template_compile") + +doc_template_compile( + name = "protocol.md", + protos = [":v1_proto"], + template = "protoc-gen-doc.tmpl", + visibility = ["//doc/dev/background-information/telemetry:__pkg__"], +) diff --git a/internal/telemetrygateway/v1/protoc-gen-doc.tmpl b/internal/telemetrygateway/v1/protoc-gen-doc.tmpl new file mode 100644 index 000000000000..a06dedda0a3c --- /dev/null +++ b/internal/telemetrygateway/v1/protoc-gen-doc.tmpl @@ -0,0 +1,111 @@ +# Telemetry Gateway + + + + +This page contains generated documentation for telemetry event data that gets exported to Sourcegraph from individual Sourcegraph instances. + +## Table of Contents +{{range .Files}} +{{$file_name := .Name}}- [{{.Name}}](#{{.Name | anchor}}) + {{- if .Messages }} + {{range .Messages}} - [{{.LongName}}](#{{.FullName | anchor}}) + {{end}} + {{- end -}} + {{- if .Enums }} + {{range .Enums}} - [{{.LongName}}](#{{.FullName | anchor}}) + {{end}} + {{- end -}} + {{- if .Extensions }} + {{range .Extensions}} - [File-level Extensions](#{{$file_name | anchor}}-extensions) + {{end}} + {{- end -}} + {{- if .Services }} + {{range .Services}} - [{{.Name}}](#{{.FullName | anchor}}) + {{end}} + {{- end -}} +{{end}} +- [Scalar Value Types](#scalar-value-types) + +{{range .Files}} +{{$file_name := .Name}} + +

Top

+ +## {{.Name}} +{{.Description}} + +{{range .Messages}} + + +### {{.LongName}} +{{.Description}} + +{{if .HasFields}} +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +{{range .Fields -}} + | {{.Name}} | [{{.LongType}}](#{{.FullType | anchor}}) | {{.Label}} | {{if (index .Options "deprecated"|default false)}}**Deprecated.** {{end}}{{p .Description}}{{if .DefaultValue}}

Default: {{.DefaultValue}}{{end}} | +{{end}} +{{end}} + +{{if .HasExtensions}} +| Extension | Type | Base | Number | Description | +| --------- | ---- | ---- | ------ | ----------- | +{{range .Extensions -}} + | {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{p .Description}}{{if .DefaultValue}}

Default: {{.DefaultValue}}{{end}} | +{{end}} +{{end}} + +{{end}} + +{{range .Enums}} + + +### {{.LongName}} +{{.Description}} + +| Name | Number | Description | +| ---- | ------ | ----------- | +{{range .Values -}} + | {{.Name}} | {{.Number}} | {{p .Description}} | +{{end}} + +{{end}} + +{{if .HasExtensions}} + + +### File-level Extensions +| Extension | Type | Base | Number | Description | +| --------- | ---- | ---- | ------ | ----------- | +{{range .Extensions -}} + | {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{p .Description}}{{if .DefaultValue}}

Default: `{{.DefaultValue}}`{{end}} | +{{end}} +{{end}} + +{{range .Services}} + + +### {{.Name}} +{{.Description}} + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +{{range .Methods -}} + | {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType | anchor}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType | anchor}}){{if .ResponseStreaming}} stream{{end}} | {{p .Description}} | +{{end}} +{{end}} + +{{end}} + +## Scalar Value Types + +| .proto Type | Notes | +| ----------- | ----- | +{{range .Scalars -}} + | {{.ProtoType}} | {{.Notes}} | +{{end}}