...

Source file src/github.com/datawire/ambassador/v2/pkg/api/getambassador.io/v3alpha1/crd_tracingservice.go

Documentation: github.com/datawire/ambassador/v2/pkg/api/getambassador.io/v3alpha1

     1  // Copyright 2020 Datawire.  All rights reserved
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  ///////////////////////////////////////////////////////////////////////////
    16  // Important: Run "make generate-fast" to regenerate code after modifying
    17  // this file.
    18  ///////////////////////////////////////////////////////////////////////////
    19  
    20  package v3alpha1
    21  
    22  import (
    23  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  )
    25  
    26  type TraceSampling struct {
    27  	Client  *int `json:"client,omitempty"`
    28  	Random  *int `json:"random,omitempty"`
    29  	Overall *int `json:"overall,omitempty"`
    30  }
    31  
    32  // +kubebuilder:validation:Enum=ENVOY;LIGHTSTEP;B3;TRACE_CONTEXT
    33  type PropagationMode string
    34  
    35  type TraceConfig struct {
    36  	AccessTokenFile   string `json:"access_token_file,omitempty"`
    37  	CollectorCluster  string `json:"collector_cluster,omitempty"`
    38  	CollectorEndpoint string `json:"collector_endpoint,omitempty"`
    39  	// +kubebuilder:validation:Enum=HTTP_JSON_V1;HTTP_JSON;HTTP_PROTO
    40  	CollectorEndpointVersion string            `json:"collector_endpoint_version,omitempty"`
    41  	CollectorHostname        string            `json:"collector_hostname,omitempty"`
    42  	PropagationModes         []PropagationMode `json:"propagation_modes,omitempty"`
    43  	TraceID128Bit            *bool             `json:"trace_id_128bit,omitempty"`
    44  	SharedSpanContext        *bool             `json:"shared_span_context,omitempty"`
    45  	ServiceName              string            `json:"service_name,omitempty"`
    46  }
    47  
    48  // TracingServiceSpec defines the desired state of TracingService
    49  type TracingServiceSpec struct {
    50  	AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
    51  
    52  	// +kubebuilder:validation:Enum={"lightstep","zipkin","datadog"}
    53  	// +kubebuilder:validation:Required
    54  	Driver string `json:"driver,omitempty"`
    55  	// +kubebuilder:validation:Required
    56  	Service    string         `json:"service,omitempty"`
    57  	Sampling   *TraceSampling `json:"sampling,omitempty"`
    58  	TagHeaders []string       `json:"tag_headers,omitempty"`
    59  	Config     *TraceConfig   `json:"config,omitempty"`
    60  	StatsName  string         `json:"stats_name,omitempty"`
    61  }
    62  
    63  // TracingService is the Schema for the tracingservices API
    64  //
    65  // +kubebuilder:object:root=true
    66  type TracingService struct {
    67  	metav1.TypeMeta   `json:""`
    68  	metav1.ObjectMeta `json:"metadata,omitempty"`
    69  
    70  	Spec TracingServiceSpec `json:"spec,omitempty"`
    71  }
    72  
    73  // TracingServiceList contains a list of TracingServices.
    74  //
    75  // +kubebuilder:object:root=true
    76  type TracingServiceList struct {
    77  	metav1.TypeMeta `json:""`
    78  	metav1.ListMeta `json:"metadata,omitempty"`
    79  	Items           []TracingService `json:"items"`
    80  }
    81  
    82  func init() {
    83  	SchemeBuilder.Register(&TracingService{}, &TracingServiceList{})
    84  }
    85  

View as plain text