Documentation

Index

Constants

View Source
const (
	TracesColumnResource               = 0
	TracesColumnInstrumentationLibrary = 1
	TracesColumnSpans                  = 2
)

    Input columns in pict_input_traces.txt

    View Source
    const (
    	SpansColumnParent     = 0
    	SpansColumnTracestate = 1
    	SpansColumnKind       = 2
    	SpansColumnAttributes = 3
    	SpansColumnEvents     = 4
    	SpansColumnLinks      = 5
    	SpansColumnStatus     = 6
    )

      Input columns in pict_input_spans.txt

      Variables

      This section is empty.

      Functions

      func DefaultMetricData

      func DefaultMetricData() pdata.Metrics

        DefaultMetricData produces MetricData with a default config.

        func GenerateMetricDatas

        func GenerateMetricDatas(metricPairsFile string) ([]pdata.Metrics, error)

          GenerateMetricDatas takes the filename of a PICT-generated file, walks through all of the rows in the PICT file and for each row, generates a MetricData object, collecting them and returning them to the caller.

          func GenerateResource

          func GenerateResource(rscID PICTInputResource) otlpresource.Resource

            GenerateResource generates a OTLP Resource object with representative attributes for the underlying resource type specified by the rscID input parameter.

            func GenerateResourceSpan

            func GenerateResourceSpan(tracingInputs *PICTTracingInputs, spanPairsFile string,
            	random io.Reader) (*otlptrace.ResourceSpans, error)

              GenerateResourceSpan generates a single OTLP ResourceSpans populated based on the provided inputs. They are:

              tracingInputs - the pairwise combination of field value variations for this ResourceSpans
              spanPairsFile - the file with the PICT-generated parameter combinations to generate spans for
              random - the random number generator to use in generating ID values
              

              The generated resource spans. If err is not nil, some or all of the resource spans fields will be nil.

              func GenerateResourceSpans

              func GenerateResourceSpans(tracePairsFile string, spanPairsFile string,
              	random io.Reader) ([]*otlptrace.ResourceSpans, error)

                GenerateResourceSpans generates a slice of OTLP ResourceSpans objects based on the PICT-generated pairwise parameters defined in the parameters file specified by the tracePairsFile parameter. The pairs to generate spans for for defined in the file specified by the spanPairsFile parameter. The random parameter injects the random number generator to use in generating IDs and other random values. The slice of ResourceSpans are returned. If an err is returned, the slice elements will be nil.

                func GenerateSpan

                func GenerateSpan(traceID data.TraceID, parentID data.SpanID, spanName string, spanInputs *PICTSpanInputs,
                	random io.Reader) *otlptrace.Span

                  GenerateSpan generates a single OTLP Span based on the input values provided. They are:

                  traceID - the trace ID to use, should not be nil
                  parentID - the parent span ID or nil if it is a root span
                  spanName - the span name, should not be blank
                  spanInputs - the pairwise combination of field value variations for this span
                  random - the random number generator to use in generating ID values
                  

                  The generated span is returned.

                  func GenerateSpans

                  func GenerateSpans(count int, startPos int, pictFile string, random io.Reader) ([]*otlptrace.Span, int, error)

                    GenerateSpans generates a slice of OTLP Span objects with the number of spans specified by the count input parameter. The startPos parameter specifies the line in the PICT tool-generated, test parameter combination records file specified by the pictFile parameter to start reading from. When the end record is reached it loops back to the first record. The random parameter injects the random number generator to use in generating IDs and other random values. Using a random number generator with the same seed value enables reproducible tests.

                    The return values are the slice with the generated spans, the starting position for the next generation run and the error which caused the spans generation to fail. If err is not nil, the spans slice will have nil values.

                    func MetricDataFromCfg

                    func MetricDataFromCfg(cfg MetricCfg) pdata.Metrics

                      MetricDataFromCfg produces MetricData with the passed-in config.

                      Types

                      type MetricCfg

                      type MetricCfg struct {
                      	// The type of metric to generate
                      	MetricDescriptorType pdata.MetricDataType
                      	// If MetricDescriptorType is one of the Sum, this describes if the sum is monotonic or not.
                      	IsMonotonicSum bool
                      	// A prefix for every metric name
                      	MetricNamePrefix string
                      	// The number of instrumentation library metrics per resource
                      	NumILMPerResource int
                      	// The size of the MetricSlice and number of Metrics
                      	NumMetricsPerILM int
                      	// The number of labels on the LabelsMap associated with each point
                      	NumPtLabels int
                      	// The number of points to generate per Metric
                      	NumPtsPerMetric int
                      	// The number of Attributes to insert into each Resource's AttributesMap
                      	NumResourceAttrs int
                      	// The number of ResourceMetrics for the single MetricData generated
                      	NumResourceMetrics int
                      	// The base value for each point
                      	PtVal int
                      	// The start time for each point
                      	StartTime uint64
                      	// The duration of the steps between each generated point starting at StartTime
                      	StepSize uint64
                      }

                        MetricCfg holds parameters for generating dummy metrics for testing. Set values on this struct to generate metrics with the corresponding number/type of attributes and pass into MetricDataFromCfg to generate metrics.

                        func DefaultCfg

                        func DefaultCfg() MetricCfg

                          DefaultCfg produces a MetricCfg with default values. These should be good enough to produce sane (but boring) metrics, and can be used as a starting point for making alterations.

                          type PICTInputAttributes

                          type PICTInputAttributes string

                            Enumerates the categories of representative attributes a generated span can be populated with.

                            const (
                            	SpanAttrNil               PICTInputAttributes = "Nil"
                            	SpanAttrEmpty             PICTInputAttributes = "Empty"
                            	SpanAttrDatabaseSQL       PICTInputAttributes = "DatabaseSQL"
                            	SpanAttrDatabaseNoSQL     PICTInputAttributes = "DatabaseNoSQL"
                            	SpanAttrFaaSDatasource    PICTInputAttributes = "FaaSDatasource"
                            	SpanAttrFaaSHTTP          PICTInputAttributes = "FaaSHTTP"
                            	SpanAttrFaaSPubSub        PICTInputAttributes = "FaaSPubSub"
                            	SpanAttrFaaSTimer         PICTInputAttributes = "FaaSTimer"
                            	SpanAttrFaaSOther         PICTInputAttributes = "FaaSOther"
                            	SpanAttrHTTPClient        PICTInputAttributes = "HTTPClient"
                            	SpanAttrHTTPServer        PICTInputAttributes = "HTTPServer"
                            	SpanAttrMessagingProducer PICTInputAttributes = "MessagingProducer"
                            	SpanAttrMessagingConsumer PICTInputAttributes = "MessagingConsumer"
                            	SpanAttrGRPCClient        PICTInputAttributes = "gRPCClient"
                            	SpanAttrGRPCServer        PICTInputAttributes = "gRPCServer"
                            	SpanAttrInternal          PICTInputAttributes = "Internal"
                            	SpanAttrMaxCount          PICTInputAttributes = "MaxCount"
                            )

                            type PICTInputInstrumentationLibrary

                            type PICTInputInstrumentationLibrary string

                              Enumerates the number and kind of instrumentation library instances that can be generated.

                              const (
                              	LibraryNone PICTInputInstrumentationLibrary = "None"
                              	LibraryOne  PICTInputInstrumentationLibrary = "One"
                              	LibraryTwo  PICTInputInstrumentationLibrary = "Two"
                              )

                              type PICTInputKind

                              type PICTInputKind string

                                Enumerates the span kind values that can be set for a span.

                                const (
                                	SpanKindUnspecified PICTInputKind = "Unspecified"
                                	SpanKindInternal    PICTInputKind = "Internal"
                                	SpanKindServer      PICTInputKind = "Server"
                                	SpanKindClient      PICTInputKind = "Client"
                                	SpanKindProducer    PICTInputKind = "Producer"
                                	SpanKindConsumer    PICTInputKind = "Consumer"
                                )

                                type PICTInputParent

                                type PICTInputParent string

                                  Enumerates the parent/child types of spans that can be generated.

                                  const (
                                  	SpanParentRoot  PICTInputParent = "Root"
                                  	SpanParentChild PICTInputParent = "Child"
                                  )

                                  type PICTInputResource

                                  type PICTInputResource string

                                    Enumerates the supported types of resource instances that can be generated.

                                    const (
                                    	ResourceNil       PICTInputResource = "Nil"
                                    	ResourceEmpty     PICTInputResource = "Empty"
                                    	ResourceVMOnPrem  PICTInputResource = "VMOnPrem"
                                    	ResourceVMCloud   PICTInputResource = "VMCloud"
                                    	ResourceK8sOnPrem PICTInputResource = "K8sOnPrem"
                                    	ResourceK8sCloud  PICTInputResource = "K8sCloud"
                                    	ResourceFaas      PICTInputResource = "Faas"
                                    	ResourceExec      PICTInputResource = "Exec"
                                    )

                                    type PICTInputSpanChild

                                    type PICTInputSpanChild string

                                      Enumerates the categories of events and/or links a generated span can be populated with.

                                      const (
                                      	SpanChildCountNil   PICTInputSpanChild = "Nil"
                                      	SpanChildCountEmpty PICTInputSpanChild = "Empty"
                                      	SpanChildCountOne   PICTInputSpanChild = "One"
                                      	SpanChildCountTwo   PICTInputSpanChild = "Two"
                                      	SpanChildCountEight PICTInputSpanChild = "Eight"
                                      )

                                      type PICTInputSpans

                                      type PICTInputSpans string

                                        Enumerates the relative sizes of tracing spans that can be attached to an instrumentation library span instance.

                                        const (
                                        	LibrarySpansNone    PICTInputSpans = "None"
                                        	LibrarySpansOne     PICTInputSpans = "One"
                                        	LibrarySpansSeveral PICTInputSpans = "Several"
                                        	LibrarySpansAll     PICTInputSpans = "All"
                                        )

                                        type PICTInputStatus

                                        type PICTInputStatus string

                                          Enumerates the status values a generated span can be populated with.

                                          const (
                                          	SpanStatusUnset PICTInputStatus = "Unset"
                                          	SpanStatusOk    PICTInputStatus = "Ok"
                                          	SpanStatusError PICTInputStatus = "Error"
                                          )

                                          type PICTInputTracestate

                                          type PICTInputTracestate string

                                            Enumerates the categories of tracestate values that can be generated for a span.

                                            const (
                                            	TraceStateEmpty PICTInputTracestate = "Empty"
                                            	TraceStateOne   PICTInputTracestate = "One"
                                            	TraceStateFour  PICTInputTracestate = "Four"
                                            )

                                            type PICTMetricDataType

                                            type PICTMetricDataType string

                                              Enumerates the types of metrics that can be generated.

                                              const (
                                              	MetricTypeIntGauge              PICTMetricDataType = "IntGauge"
                                              	MetricTypeMonotonicIntSum       PICTMetricDataType = "MonotonicIntSum"
                                              	MetricTypeNonMonotonicIntSum    PICTMetricDataType = "NonMonotonicIntSum"
                                              	MetricTypeDoubleGauge           PICTMetricDataType = "DoubleGauge"
                                              	MetricTypeMonotonicDoubleSum    PICTMetricDataType = "MonotonicDoubleSum"
                                              	MetricTypeNonMonotonicDoubleSum PICTMetricDataType = "NonMonotonicDoubleSum"
                                              	MetricTypeIntHistogram          PICTMetricDataType = "IntHistogram"
                                              	MetricTypeDoubleHistogram       PICTMetricDataType = "DoubleHistogram"
                                              )

                                              type PICTMetricInputs

                                              type PICTMetricInputs struct {
                                              	// Specifies the number of points on each metric.
                                              	NumPtsPerMetric PICTNumPtsPerMetric
                                              	// Specifies the types of metrics that can be generated.
                                              	MetricType PICTMetricDataType
                                              	// Specifies the number of labels on each datapoint.
                                              	NumPtLabels PICTNumPtLabels
                                              	// Specifies the number of attributes on each resource.
                                              	NumResourceAttrs PICTNumResourceAttrs
                                              }

                                                PICTMetricInputs defines one pairwise combination of MetricData variations

                                                type PICTNumPtLabels

                                                type PICTNumPtLabels string

                                                  Enumerates the number of labels on each datapoint.

                                                  const (
                                                  	LabelsNone PICTNumPtLabels = "NoLabels"
                                                  	LabelsOne  PICTNumPtLabels = "OneLabel"
                                                  	LabelsMany PICTNumPtLabels = "ManyLabels"
                                                  )

                                                  type PICTNumPtsPerMetric

                                                  type PICTNumPtsPerMetric string

                                                    Enumerates the number of points on each metric.

                                                    const (
                                                    	NumPtsPerMetricOne  PICTNumPtsPerMetric = "OnePt"
                                                    	NumPtsPerMetricMany PICTNumPtsPerMetric = "ManyPts"
                                                    )

                                                    type PICTNumResourceAttrs

                                                    type PICTNumResourceAttrs string

                                                      Enumerates the number of attributes on each resource.

                                                      const (
                                                      	AttrsNone PICTNumResourceAttrs = "NoAttrs"
                                                      	AttrsOne  PICTNumResourceAttrs = "OneAttr"
                                                      	AttrsTwo  PICTNumResourceAttrs = "TwoAttrs"
                                                      )

                                                      type PICTSpanInputs

                                                      type PICTSpanInputs struct {
                                                      	// Specifies whether the ParentSpanId field should be populated or not
                                                      	Parent PICTInputParent
                                                      	// Specifies the category of contents to populate the TraceState field with
                                                      	Tracestate PICTInputTracestate
                                                      	// Specifies the value to populate the Kind field with
                                                      	Kind PICTInputKind
                                                      	// Specifies the category of values to populate the Attributes field with
                                                      	Attributes PICTInputAttributes
                                                      	// Specifies the category of contents to populate the Events field with
                                                      	Events PICTInputSpanChild
                                                      	// Specifies the category of contents to populate the Links field with
                                                      	Links PICTInputSpanChild
                                                      	// Specifies the value to populate the Status field with
                                                      	Status PICTInputStatus
                                                      }

                                                        PICTSpanInputs defines one pairwise combination of Span variations

                                                        type PICTTracingInputs

                                                        type PICTTracingInputs struct {
                                                        	// Specifies the category of attributes to populate the Resource field with
                                                        	Resource PICTInputResource
                                                        	// Specifies the number and library categories to populte the InstrumentationLibrarySpans field with
                                                        	InstrumentationLibrary PICTInputInstrumentationLibrary
                                                        	// Specifies the relative number of spans to populate the InstrumentationLibrarySpans' Spans field with
                                                        	Spans PICTInputSpans
                                                        }

                                                          PICTTracingInputs defines one pairwise combination of ResourceSpans variations