#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttributePath {
#[prost(string, repeated, tag = "1")]
pub path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogTarget {
#[prost(message, repeated, tag = "1")]
pub r#match: ::prost::alloc::vec::Vec<LogMatcher>,
#[prost(string, tag = "2")]
pub keep: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub transform: ::core::option::Option<LogTransform>,
#[prost(message, optional, tag = "4")]
pub sample_key: ::core::option::Option<LogSampleKey>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogSampleKey {
#[prost(oneof = "log_sample_key::Field", tags = "1, 2, 3, 4")]
pub field: ::core::option::Option<log_sample_key::Field>,
}
pub mod log_sample_key {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::LogField", tag = "1")]
LogField(i32),
#[prost(message, tag = "2")]
LogAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogMatcher {
#[prost(bool, tag = "20")]
pub negate: bool,
#[prost(bool, tag = "21")]
pub case_insensitive: bool,
#[prost(oneof = "log_matcher::Field", tags = "1, 2, 3, 4")]
pub field: ::core::option::Option<log_matcher::Field>,
#[prost(oneof = "log_matcher::Match", tags = "10, 11, 12, 13, 14, 15")]
pub r#match: ::core::option::Option<log_matcher::Match>,
}
pub mod log_matcher {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::LogField", tag = "1")]
LogField(i32),
#[prost(message, tag = "2")]
LogAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Match {
#[prost(string, tag = "10")]
Exact(::prost::alloc::string::String),
#[prost(string, tag = "11")]
Regex(::prost::alloc::string::String),
#[prost(bool, tag = "12")]
Exists(bool),
#[prost(string, tag = "13")]
StartsWith(::prost::alloc::string::String),
#[prost(string, tag = "14")]
EndsWith(::prost::alloc::string::String),
#[prost(string, tag = "15")]
Contains(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogTransform {
#[prost(message, repeated, tag = "1")]
pub remove: ::prost::alloc::vec::Vec<LogRemove>,
#[prost(message, repeated, tag = "2")]
pub redact: ::prost::alloc::vec::Vec<LogRedact>,
#[prost(message, repeated, tag = "3")]
pub rename: ::prost::alloc::vec::Vec<LogRename>,
#[prost(message, repeated, tag = "4")]
pub add: ::prost::alloc::vec::Vec<LogAdd>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogRemove {
#[prost(oneof = "log_remove::Field", tags = "1, 2, 3, 4")]
pub field: ::core::option::Option<log_remove::Field>,
}
pub mod log_remove {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::LogField", tag = "1")]
LogField(i32),
#[prost(message, tag = "2")]
LogAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogRedact {
#[prost(string, tag = "10")]
pub replacement: ::prost::alloc::string::String,
#[prost(string, optional, tag = "11")]
pub regex: ::core::option::Option<::prost::alloc::string::String>,
#[prost(oneof = "log_redact::Field", tags = "1, 2, 3, 4")]
pub field: ::core::option::Option<log_redact::Field>,
}
pub mod log_redact {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::LogField", tag = "1")]
LogField(i32),
#[prost(message, tag = "2")]
LogAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogRename {
#[prost(string, tag = "10")]
pub to: ::prost::alloc::string::String,
#[prost(bool, tag = "11")]
pub upsert: bool,
#[prost(oneof = "log_rename::From", tags = "1, 2, 3, 4")]
pub from: ::core::option::Option<log_rename::From>,
}
pub mod log_rename {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum From {
#[prost(enumeration = "super::LogField", tag = "1")]
FromLogField(i32),
#[prost(message, tag = "2")]
FromLogAttribute(super::AttributePath),
#[prost(message, tag = "3")]
FromResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
FromScopeAttribute(super::AttributePath),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogAdd {
#[prost(string, tag = "10")]
pub value: ::prost::alloc::string::String,
#[prost(bool, tag = "11")]
pub upsert: bool,
#[prost(oneof = "log_add::Field", tags = "1, 2, 3, 4")]
pub field: ::core::option::Option<log_add::Field>,
}
pub mod log_add {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::LogField", tag = "1")]
LogField(i32),
#[prost(message, tag = "2")]
LogAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LogField {
Unspecified = 0,
Body = 1,
SeverityText = 2,
TraceId = 3,
SpanId = 4,
EventName = 5,
ResourceSchemaUrl = 10,
ScopeSchemaUrl = 11,
}
impl LogField {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "LOG_FIELD_UNSPECIFIED",
Self::Body => "LOG_FIELD_BODY",
Self::SeverityText => "LOG_FIELD_SEVERITY_TEXT",
Self::TraceId => "LOG_FIELD_TRACE_ID",
Self::SpanId => "LOG_FIELD_SPAN_ID",
Self::EventName => "LOG_FIELD_EVENT_NAME",
Self::ResourceSchemaUrl => "LOG_FIELD_RESOURCE_SCHEMA_URL",
Self::ScopeSchemaUrl => "LOG_FIELD_SCOPE_SCHEMA_URL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LOG_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
"LOG_FIELD_BODY" => Some(Self::Body),
"LOG_FIELD_SEVERITY_TEXT" => Some(Self::SeverityText),
"LOG_FIELD_TRACE_ID" => Some(Self::TraceId),
"LOG_FIELD_SPAN_ID" => Some(Self::SpanId),
"LOG_FIELD_EVENT_NAME" => Some(Self::EventName),
"LOG_FIELD_RESOURCE_SCHEMA_URL" => Some(Self::ResourceSchemaUrl),
"LOG_FIELD_SCOPE_SCHEMA_URL" => Some(Self::ScopeSchemaUrl),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetricTarget {
#[prost(message, repeated, tag = "1")]
pub r#match: ::prost::alloc::vec::Vec<MetricMatcher>,
#[prost(bool, tag = "2")]
pub keep: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetricMatcher {
#[prost(bool, tag = "20")]
pub negate: bool,
#[prost(bool, tag = "21")]
pub case_insensitive: bool,
#[prost(oneof = "metric_matcher::Field", tags = "1, 2, 3, 4, 5, 6")]
pub field: ::core::option::Option<metric_matcher::Field>,
#[prost(oneof = "metric_matcher::Match", tags = "10, 11, 12, 13, 14, 15")]
pub r#match: ::core::option::Option<metric_matcher::Match>,
}
pub mod metric_matcher {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::MetricField", tag = "1")]
MetricField(i32),
#[prost(message, tag = "2")]
DatapointAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
#[prost(enumeration = "super::MetricType", tag = "5")]
MetricType(i32),
#[prost(enumeration = "super::AggregationTemporality", tag = "6")]
AggregationTemporality(i32),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Match {
#[prost(string, tag = "10")]
Exact(::prost::alloc::string::String),
#[prost(string, tag = "11")]
Regex(::prost::alloc::string::String),
#[prost(bool, tag = "12")]
Exists(bool),
#[prost(string, tag = "13")]
StartsWith(::prost::alloc::string::String),
#[prost(string, tag = "14")]
EndsWith(::prost::alloc::string::String),
#[prost(string, tag = "15")]
Contains(::prost::alloc::string::String),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetricField {
Unspecified = 0,
Name = 1,
Description = 2,
Unit = 3,
ResourceSchemaUrl = 10,
ScopeSchemaUrl = 11,
ScopeName = 12,
ScopeVersion = 13,
}
impl MetricField {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "METRIC_FIELD_UNSPECIFIED",
Self::Name => "METRIC_FIELD_NAME",
Self::Description => "METRIC_FIELD_DESCRIPTION",
Self::Unit => "METRIC_FIELD_UNIT",
Self::ResourceSchemaUrl => "METRIC_FIELD_RESOURCE_SCHEMA_URL",
Self::ScopeSchemaUrl => "METRIC_FIELD_SCOPE_SCHEMA_URL",
Self::ScopeName => "METRIC_FIELD_SCOPE_NAME",
Self::ScopeVersion => "METRIC_FIELD_SCOPE_VERSION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"METRIC_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
"METRIC_FIELD_NAME" => Some(Self::Name),
"METRIC_FIELD_DESCRIPTION" => Some(Self::Description),
"METRIC_FIELD_UNIT" => Some(Self::Unit),
"METRIC_FIELD_RESOURCE_SCHEMA_URL" => Some(Self::ResourceSchemaUrl),
"METRIC_FIELD_SCOPE_SCHEMA_URL" => Some(Self::ScopeSchemaUrl),
"METRIC_FIELD_SCOPE_NAME" => Some(Self::ScopeName),
"METRIC_FIELD_SCOPE_VERSION" => Some(Self::ScopeVersion),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetricType {
Unspecified = 0,
Gauge = 1,
Sum = 2,
Histogram = 3,
ExponentialHistogram = 4,
Summary = 5,
}
impl MetricType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "METRIC_TYPE_UNSPECIFIED",
Self::Gauge => "METRIC_TYPE_GAUGE",
Self::Sum => "METRIC_TYPE_SUM",
Self::Histogram => "METRIC_TYPE_HISTOGRAM",
Self::ExponentialHistogram => "METRIC_TYPE_EXPONENTIAL_HISTOGRAM",
Self::Summary => "METRIC_TYPE_SUMMARY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"METRIC_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"METRIC_TYPE_GAUGE" => Some(Self::Gauge),
"METRIC_TYPE_SUM" => Some(Self::Sum),
"METRIC_TYPE_HISTOGRAM" => Some(Self::Histogram),
"METRIC_TYPE_EXPONENTIAL_HISTOGRAM" => Some(Self::ExponentialHistogram),
"METRIC_TYPE_SUMMARY" => Some(Self::Summary),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AggregationTemporality {
Unspecified = 0,
Delta = 1,
Cumulative = 2,
}
impl AggregationTemporality {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "AGGREGATION_TEMPORALITY_UNSPECIFIED",
Self::Delta => "AGGREGATION_TEMPORALITY_DELTA",
Self::Cumulative => "AGGREGATION_TEMPORALITY_CUMULATIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AGGREGATION_TEMPORALITY_UNSPECIFIED" => Some(Self::Unspecified),
"AGGREGATION_TEMPORALITY_DELTA" => Some(Self::Delta),
"AGGREGATION_TEMPORALITY_CUMULATIVE" => Some(Self::Cumulative),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TraceTarget {
#[prost(message, repeated, tag = "1")]
pub r#match: ::prost::alloc::vec::Vec<TraceMatcher>,
#[prost(message, optional, tag = "2")]
pub keep: ::core::option::Option<TraceSamplingConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TraceMatcher {
#[prost(bool, tag = "20")]
pub negate: bool,
#[prost(bool, tag = "21")]
pub case_insensitive: bool,
#[prost(oneof = "trace_matcher::Field", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
pub field: ::core::option::Option<trace_matcher::Field>,
#[prost(oneof = "trace_matcher::Match", tags = "10, 11, 12, 13, 14, 15")]
pub r#match: ::core::option::Option<trace_matcher::Match>,
}
pub mod trace_matcher {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Field {
#[prost(enumeration = "super::TraceField", tag = "1")]
TraceField(i32),
#[prost(message, tag = "2")]
SpanAttribute(super::AttributePath),
#[prost(message, tag = "3")]
ResourceAttribute(super::AttributePath),
#[prost(message, tag = "4")]
ScopeAttribute(super::AttributePath),
#[prost(enumeration = "super::SpanKind", tag = "5")]
SpanKind(i32),
#[prost(enumeration = "super::SpanStatusCode", tag = "6")]
SpanStatus(i32),
#[prost(string, tag = "7")]
EventName(::prost::alloc::string::String),
#[prost(message, tag = "8")]
EventAttribute(super::AttributePath),
#[prost(string, tag = "9")]
LinkTraceId(::prost::alloc::string::String),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Match {
#[prost(string, tag = "10")]
Exact(::prost::alloc::string::String),
#[prost(string, tag = "11")]
Regex(::prost::alloc::string::String),
#[prost(bool, tag = "12")]
Exists(bool),
#[prost(string, tag = "13")]
StartsWith(::prost::alloc::string::String),
#[prost(string, tag = "14")]
EndsWith(::prost::alloc::string::String),
#[prost(string, tag = "15")]
Contains(::prost::alloc::string::String),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TraceSamplingConfig {
#[prost(float, tag = "1")]
pub percentage: f32,
#[prost(enumeration = "SamplingMode", optional, tag = "2")]
pub mode: ::core::option::Option<i32>,
#[prost(uint32, optional, tag = "3")]
pub sampling_precision: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub hash_seed: ::core::option::Option<u32>,
#[prost(bool, optional, tag = "5")]
pub fail_closed: ::core::option::Option<bool>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TraceField {
Unspecified = 0,
Name = 1,
TraceId = 2,
SpanId = 3,
ParentSpanId = 4,
TraceState = 5,
ResourceSchemaUrl = 10,
ScopeSchemaUrl = 11,
ScopeName = 12,
ScopeVersion = 13,
}
impl TraceField {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "TRACE_FIELD_UNSPECIFIED",
Self::Name => "TRACE_FIELD_NAME",
Self::TraceId => "TRACE_FIELD_TRACE_ID",
Self::SpanId => "TRACE_FIELD_SPAN_ID",
Self::ParentSpanId => "TRACE_FIELD_PARENT_SPAN_ID",
Self::TraceState => "TRACE_FIELD_TRACE_STATE",
Self::ResourceSchemaUrl => "TRACE_FIELD_RESOURCE_SCHEMA_URL",
Self::ScopeSchemaUrl => "TRACE_FIELD_SCOPE_SCHEMA_URL",
Self::ScopeName => "TRACE_FIELD_SCOPE_NAME",
Self::ScopeVersion => "TRACE_FIELD_SCOPE_VERSION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRACE_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
"TRACE_FIELD_NAME" => Some(Self::Name),
"TRACE_FIELD_TRACE_ID" => Some(Self::TraceId),
"TRACE_FIELD_SPAN_ID" => Some(Self::SpanId),
"TRACE_FIELD_PARENT_SPAN_ID" => Some(Self::ParentSpanId),
"TRACE_FIELD_TRACE_STATE" => Some(Self::TraceState),
"TRACE_FIELD_RESOURCE_SCHEMA_URL" => Some(Self::ResourceSchemaUrl),
"TRACE_FIELD_SCOPE_SCHEMA_URL" => Some(Self::ScopeSchemaUrl),
"TRACE_FIELD_SCOPE_NAME" => Some(Self::ScopeName),
"TRACE_FIELD_SCOPE_VERSION" => Some(Self::ScopeVersion),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpanKind {
Unspecified = 0,
Internal = 1,
Server = 2,
Client = 3,
Producer = 4,
Consumer = 5,
}
impl SpanKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SPAN_KIND_UNSPECIFIED",
Self::Internal => "SPAN_KIND_INTERNAL",
Self::Server => "SPAN_KIND_SERVER",
Self::Client => "SPAN_KIND_CLIENT",
Self::Producer => "SPAN_KIND_PRODUCER",
Self::Consumer => "SPAN_KIND_CONSUMER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPAN_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"SPAN_KIND_INTERNAL" => Some(Self::Internal),
"SPAN_KIND_SERVER" => Some(Self::Server),
"SPAN_KIND_CLIENT" => Some(Self::Client),
"SPAN_KIND_PRODUCER" => Some(Self::Producer),
"SPAN_KIND_CONSUMER" => Some(Self::Consumer),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpanStatusCode {
Unspecified = 0,
Ok = 1,
Error = 2,
}
impl SpanStatusCode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SPAN_STATUS_CODE_UNSPECIFIED",
Self::Ok => "SPAN_STATUS_CODE_OK",
Self::Error => "SPAN_STATUS_CODE_ERROR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPAN_STATUS_CODE_UNSPECIFIED" => Some(Self::Unspecified),
"SPAN_STATUS_CODE_OK" => Some(Self::Ok),
"SPAN_STATUS_CODE_ERROR" => Some(Self::Error),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SamplingMode {
Unspecified = 0,
HashSeed = 1,
Proportional = 2,
Equalizing = 3,
}
impl SamplingMode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SAMPLING_MODE_UNSPECIFIED",
Self::HashSeed => "SAMPLING_MODE_HASH_SEED",
Self::Proportional => "SAMPLING_MODE_PROPORTIONAL",
Self::Equalizing => "SAMPLING_MODE_EQUALIZING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SAMPLING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"SAMPLING_MODE_HASH_SEED" => Some(Self::HashSeed),
"SAMPLING_MODE_PROPORTIONAL" => Some(Self::Proportional),
"SAMPLING_MODE_EQUALIZING" => Some(Self::Equalizing),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Policy {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub enabled: bool,
#[prost(fixed64, tag = "5")]
pub created_at_unix_nano: u64,
#[prost(fixed64, tag = "6")]
pub modified_at_unix_nano: u64,
#[prost(message, repeated, tag = "7")]
pub labels: ::prost::alloc::vec::Vec<
super::super::super::opentelemetry::proto::common::v1::KeyValue,
>,
#[prost(oneof = "policy::Target", tags = "10, 11, 12")]
pub target: ::core::option::Option<policy::Target>,
}
pub mod policy {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(message, tag = "10")]
Log(super::LogTarget),
#[prost(message, tag = "11")]
Metric(super::MetricTarget),
#[prost(message, tag = "12")]
Trace(super::TraceTarget),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientMetadata {
#[prost(enumeration = "PolicyStage", repeated, tag = "1")]
pub supported_policy_stages: ::prost::alloc::vec::Vec<i32>,
#[prost(message, repeated, tag = "2")]
pub labels: ::prost::alloc::vec::Vec<
super::super::super::opentelemetry::proto::common::v1::KeyValue,
>,
#[prost(message, repeated, tag = "3")]
pub resource_attributes: ::prost::alloc::vec::Vec<
super::super::super::opentelemetry::proto::common::v1::KeyValue,
>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TransformStageStatus {
#[prost(int64, tag = "1")]
pub hits: i64,
#[prost(int64, tag = "2")]
pub misses: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PolicySyncStatus {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub match_hits: i64,
#[prost(int64, tag = "3")]
pub match_misses: i64,
#[prost(string, repeated, tag = "4")]
pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub remove: ::core::option::Option<TransformStageStatus>,
#[prost(message, optional, tag = "11")]
pub redact: ::core::option::Option<TransformStageStatus>,
#[prost(message, optional, tag = "12")]
pub rename: ::core::option::Option<TransformStageStatus>,
#[prost(message, optional, tag = "13")]
pub add: ::core::option::Option<TransformStageStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncRequest {
#[prost(message, optional, tag = "1")]
pub client_metadata: ::core::option::Option<ClientMetadata>,
#[prost(bool, tag = "2")]
pub full_sync: bool,
#[prost(fixed64, tag = "3")]
pub last_sync_timestamp_unix_nano: u64,
#[prost(string, tag = "4")]
pub last_successful_hash: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub policy_statuses: ::prost::alloc::vec::Vec<PolicySyncStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncResponse {
#[prost(message, repeated, tag = "1")]
pub policies: ::prost::alloc::vec::Vec<Policy>,
#[prost(string, tag = "2")]
pub hash: ::prost::alloc::string::String,
#[prost(fixed64, tag = "3")]
pub sync_timestamp_unix_nano: u64,
#[prost(uint32, tag = "4")]
pub recommended_sync_interval_seconds: u32,
#[prost(enumeration = "SyncType", tag = "5")]
pub sync_type: i32,
#[prost(string, tag = "6")]
pub error_message: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PolicyStage {
Unspecified = 0,
LogFilter = 1,
LogTransform = 2,
MetricFilter = 3,
TraceSampling = 4,
}
impl PolicyStage {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "POLICY_STAGE_UNSPECIFIED",
Self::LogFilter => "POLICY_STAGE_LOG_FILTER",
Self::LogTransform => "POLICY_STAGE_LOG_TRANSFORM",
Self::MetricFilter => "POLICY_STAGE_METRIC_FILTER",
Self::TraceSampling => "POLICY_STAGE_TRACE_SAMPLING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POLICY_STAGE_UNSPECIFIED" => Some(Self::Unspecified),
"POLICY_STAGE_LOG_FILTER" => Some(Self::LogFilter),
"POLICY_STAGE_LOG_TRANSFORM" => Some(Self::LogTransform),
"POLICY_STAGE_METRIC_FILTER" => Some(Self::MetricFilter),
"POLICY_STAGE_TRACE_SAMPLING" => Some(Self::TraceSampling),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SyncType {
Unspecified = 0,
Full = 1,
}
impl SyncType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SYNC_TYPE_UNSPECIFIED",
Self::Full => "SYNC_TYPE_FULL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SYNC_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SYNC_TYPE_FULL" => Some(Self::Full),
_ => None,
}
}
}
#[cfg(feature = "grpc")]
pub mod policy_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct PolicyServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PolicyServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PolicyServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PolicyServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
PolicyServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn sync(
&mut self,
request: impl tonic::IntoRequest<super::SyncRequest>,
) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/tero.policy.v1.PolicyService/Sync",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("tero.policy.v1.PolicyService", "Sync"));
self.inner.unary(req, path, codec).await
}
}
}