teleport/proto/prehog/v1/teleport.proto
Edoardo Spadolini c296b77734
usagereporter: on-prem dial home (#23916)
* Fix prehog protos package name

* sync prehog/v1alpha/teleport.proto from cloud

* AggregatingUsageReporter

* graceful stopping

* alerts WIP

* Split reporter and submitter

* batch_uuid

* Naming

* more naming

* Move backend stuff in a "service" object

* Return the correct err from gracefulstop

* Tweak alert link

* Better field comments

* payloadContext rather than a manual type assertion

* Rework reporter logic

* Close the base context at the end of run

* Use the count parameter in listUserActivityReports

* Use ttl parameter in createUserActivityReportsLock

* service tests

* submitter test

* reporter test

* Document GracefulStopper.GracefulStop

* Fix errorf/warnf that don't need formatting

* Add debug line on a successful report

* fix license

* sync prehog proto from cloud

* Only send non-nil events through test channel

This fixes a hang/data race, as we effectively "send" a nil event
whenever the ticker hits

* Docs and variable names

* Add some debug info to the lock and the alert

* Sync prehog protos from cloud

This includes a move to prehog.v1 for the new rpc and messages

* mechanical: rename imports of prehog/v1alpha

This renames imports of ".../prehog/v1alpha" from prehogv1a to prehogv1,
and imports of ".../prehog/v1alpha/prehogv1alphaconnect" from prehogv1c
to prehogv1ac, to avoid confusion with imports of the newly added
".../prehog/v1" and ".../prehog/v1/prehogv1connect".

* Merge remote-tracking branch 'origin/master' into espadolini/usagereporter-onprem
2023-04-05 19:24:32 +00:00

77 lines
2.4 KiB
Protocol Buffer

// Copyright 2023 Gravitational, 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 prehog.v1;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/gravitational/teleport/gen/proto/go/prehog/v1;prehogv1";
message UserActivityReport {
// randomly generated UUID for this specific report, 16 bytes (in string order)
bytes report_uuid = 1;
// anonymized, 32 bytes (HMAC-SHA-256)
bytes cluster_name = 2;
// anonymized, 32 bytes (HMAC-SHA-256)
bytes reporter_hostid = 3;
// beginning of the time window for this data; ending is not specified but is
// intended to be at most 15 minutes
google.protobuf.Timestamp start_time = 4;
repeated UserActivityRecord records = 5;
}
message UserActivityRecord {
// anonymized, 32 bytes (HMAC-SHA-256)
bytes user_name = 1;
// counter of user.login events
uint64 logins = 2;
// counter of session.start events (non-Kube)
uint64 ssh_sessions = 3;
// counter of app.session.start events (non-TCP)
uint64 app_sessions = 4;
// counter of session.start events (only Kube)
uint64 kube_sessions = 5;
// counter of db.session.start events
uint64 db_sessions = 6;
// counter of windows.desktop.session.start events
uint64 desktop_sessions = 7;
// counter of app.session.start events (only TCP)
uint64 app_tcp_sessions = 8;
// counter of port events
uint64 ssh_port_sessions = 9;
// counter of kube.request events
uint64 kube_requests = 10;
// counter of sftp events
uint64 sftp_events = 11;
}
message SubmitUsageReportsRequest {
// at most 10 in a single RPC, each shouldn't exceed 128KiB or so
repeated UserActivityReport user_activity = 1;
}
message SubmitUsageReportsResponse {
// randomly generated UUID for this specific batch, 16 bytes (in string order)
bytes batch_uuid = 1;
}
service TeleportReportingService {
rpc SubmitUsageReports(SubmitUsageReportsRequest) returns (SubmitUsageReportsResponse) {}
}