blob: e0247f407328f5e8f2f67f0a7d7c1c69c408a4c1 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
option java_outer_classname = "TraceLogProtos";
option java_package = "org.chromium.components.metrics";
package metrics;
// The trace data is collected by Chrome tracing infrastructure to obtain a
// timeline model of events occurring in all Chrome processes and threads.
// Chrome uploads data as a serialized perfetto trace message. The proto format
// is defined in perfetto tracing library in
// //src/third_party/perfetto/protos/perfetto/trace/trace.proto
// Wrapper for the uploaded trace data, and parsed trace as stored in the logs.
message TraceLog {
// Client uploads the trace data as a byte buffer.
optional bytes raw_data = 1;
// Metadata related to the trace log, like trigger for the upload, etc.
optional TraceMetadata metadata = 3;
}
// This field contains metadata associated with the trace.
message TraceMetadata {
// Information about a trigger rule defined in the experiment config.
message TriggerRule {
enum TriggerType {
UNKNOWN = 0;
// Traces are triggered by specific range of values of an UMA histogram.
MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1;
// Traces are triggered by specific named events in chromium codebase,
// like "second-update-failure".
MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2;
}
optional TriggerType trigger_type = 1;
// Configuration of histogram trigger.
message HistogramRule {
// UMA histogram name hash, same as HistogramEventProto.name_hash.
optional fixed64 histogram_name_hash = 1;
// Range of values of the histogram that activates trigger.
optional int64 histogram_min_trigger = 2;
optional int64 histogram_max_trigger = 3;
}
optional HistogramRule histogram_rule = 2;
// Configuration of named trigger.
message NamedRule {
enum EventType {
INVALID = 0;
SESSION_RESTORE = 1;
NAVIGATION = 2;
}
optional EventType event_type = 1;
}
optional NamedRule named_rule = 3;
}
// Specifies the rule that caused the trace to be uploaded.
optional TriggerRule triggered_rule = 1;
// List of all active triggers in current session, when trace was triggered.
repeated TriggerRule active_rules = 2;
}