Documentation ¶
Index ¶
- Constants
- func GenerateMetrics(metricPairsFile string) ([]pmetric.Metrics, error)
- func GenerateResource(rscID PICTInputResource) pcommon.Resource
- func GenerateTraces(tracePairsFile string, spanPairsFile string) ([]ptrace.Traces, error)
- func MetricsFromCfg(cfg MetricsCfg) pmetric.Metrics
- type MetricsCfg
- type PICTInputAttributes
- type PICTInputInstrumentationLibrary
- type PICTInputKind
- type PICTInputParent
- type PICTInputResource
- type PICTInputSpanChild
- type PICTInputSpans
- type PICTInputStatus
- type PICTInputTracestate
- type PICTMetricInputs
- type PICTMetricType
- type PICTNumPtLabels
- type PICTNumPtsPerMetric
- type PICTNumResourceAttrs
- type PICTSpanInputs
- type PICTTracingInputs
Constants ¶
const ( TracesColumnResource = 0 TracesColumnInstrumentationLibrary = 1 TracesColumnSpans = 2 )
Input columns in pict_input_traces.txt
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 GenerateMetrics ¶
GenerateMetrics 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) pcommon.Resource
GenerateResource generates a PData Resource object with representative attributes for the underlying resource type specified by the rscID input parameter.
func GenerateTraces ¶
GenerateTraces 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 slice of ResourceSpans are returned. If an err is returned, the slice elements will be nil.
func MetricsFromCfg ¶
func MetricsFromCfg(cfg MetricsCfg) pmetric.Metrics
MetricsFromCfg produces pmetric.Metrics with the passed-in config.
Types ¶
type MetricsCfg ¶
type MetricsCfg struct { // The type of metric to generate MetricDescriptorType pmetric.MetricType // MetricValueType is the type of the numeric value: int or double. MetricValueType pmetric.NumberDataPointValueType // 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 }
MetricsCfg 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 MetricsFromCfg to generate metrics.
func DefaultCfg ¶
func DefaultCfg() MetricsCfg
DefaultCfg produces a MetricsCfg 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
PICTInputAttributes enum for the categories of representative attributes a generated span can be populated with.
const ( 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
PICTInputInstrumentationLibrary enum for 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
PICTInputKind enum for 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
PICTInputParent enum for the parent/child types of spans that can be generated.
const ( SpanParentRoot PICTInputParent = "Root" SpanParentChild PICTInputParent = "Child" )
type PICTInputResource ¶
type PICTInputResource string
PICTInputResource enum for the supported types of resource instances that can be generated.
const ( 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
PICTInputSpanChild enum for the categories of events and/or links a generated span can be populated with.
const ( SpanChildCountEmpty PICTInputSpanChild = "Empty" SpanChildCountOne PICTInputSpanChild = "One" SpanChildCountTwo PICTInputSpanChild = "Two" SpanChildCountEight PICTInputSpanChild = "Eight" )
type PICTInputSpans ¶
type PICTInputSpans string
PICTInputSpans enum for 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
PICTInputStatus enum for 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
PICTInputTracestate enum for the categories of tracestate values that can be generated for a span.
const ( TraceStateEmpty PICTInputTracestate = "Empty" TraceStateOne PICTInputTracestate = "One" TraceStateFour PICTInputTracestate = "Four" )
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 PICTMetricType // 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 PICTMetricType ¶ added in v0.61.0
type PICTMetricType string
PICTMetricType enumerates the types of metrics that can be generated.
const ( MetricTypeIntGauge PICTMetricType = "IntGauge" MetricTypeMonotonicIntSum PICTMetricType = "MonotonicIntSum" MetricTypeNonMonotonicIntSum PICTMetricType = "NonMonotonicIntSum" MetricTypeDoubleGauge PICTMetricType = "DoubleGauge" MetricTypeMonotonicDoubleSum PICTMetricType = "MonotonicDoubleSum" MetricTypeNonMonotonicDoubleSum PICTMetricType = "NonMonotonicDoubleSum" MetricTypeDoubleExemplarsHistogram PICTMetricType = "DoubleExemplarsHistogram" MetricTypeIntExemplarsHistogram PICTMetricType = "IntExemplarsHistogram" )
type PICTNumPtLabels ¶
type PICTNumPtLabels string
PICTNumPtLabels enumerates the number of labels on each datapoint.
const ( LabelsNone PICTNumPtLabels = "NoLabels" LabelsOne PICTNumPtLabels = "OneLabel" LabelsMany PICTNumPtLabels = "ManyLabels" )
type PICTNumPtsPerMetric ¶
type PICTNumPtsPerMetric string
PICTNumPtsPerMetric enum for the number of points on each metric.
const ( NumPtsPerMetricOne PICTNumPtsPerMetric = "OnePt" NumPtsPerMetricMany PICTNumPtsPerMetric = "ManyPts" )
type PICTNumResourceAttrs ¶
type PICTNumResourceAttrs string
PICTNumResourceAttrs enum for 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 ScopeSpans field with InstrumentationLibrary PICTInputInstrumentationLibrary // Specifies the relative number of spans to populate the ScopeSpans' Spans field with Spans PICTInputSpans }
PICTTracingInputs defines one pairwise combination of ResourceSpans variations