Documentation ¶
Index ¶
- Constants
- func NewEventsRequest(ctx context.Context, endpoint string, record *v1log.LogRecord, ...) (*http.Request, error)
- func NewMetricsRequest(ctx context.Context, endpoint string, metrics []ResourceMetrics, ...) (*http.Request, error)
- func ProcessEventsResponse(resp *http.Response) error
- func ProcessMetricResponse(resp *http.Response) (dropped int64, errs error)
- func WithDelimitedStrings[Tags ~[]string](delim string, tags Tags) func(m Map)
- func WithHistogramDataPointAttributes(attrs Map) func(HistogramDataPoint)
- func WithHistogramDataPointCumulativeBucketValues[Buckets ~map[Bound]int, Bound ~float64](buckets Buckets) func(HistogramDataPoint)
- func WithHistogramDataPointStatistics(values []float64) func(HistogramDataPoint)
- func WithInstrumentationScopeAttributes(attributes Map) func(InstrumentationScope)
- func WithNumberDataPointDoubleValue(value float64) func(NumberDataPoint)
- func WithNumberDataPointMap(m Map) func(NumberDataPoint)
- func WithNumberDatapointIntValue(value int64) func(NumberDataPoint)
- func WithResourceAttributes(opts ...func(Map)) func(Resource)
- func WithResourceMap(m Map) func(Resource)
- func WithStatsdDelimitedTags[Tags ~[]string](tags Tags) func(Map)
- func WithStatsdEventTags[Tags ~[]string](tags Tags) func(Map)
- type Converter
- type Gauge
- type Histogram
- type HistogramDataPoint
- type InstrumentationScope
- type KeyValue
- type Map
- func NewMap(opts ...func(Map)) Map
- func SplitEventTagsByKeysAndConvert[S ~[]string](tags S, keys S) (matched, unmatched Map)
- func SplitMetricTagsByKeysAndConvert[S ~[]string](tags S, keys S) (matched, unmatched Map)
- func SplitTagsByKeysAndConvert[S ~[]string](tags S, keys S, converter Converter[S]) (matched, unmatched Map)
- type Metric
- type NumberDataPoint
- type OtlpEvent
- type Resource
- type ResourceMetrics
- type ScopeMetrics
- type Sum
Constants ¶
const (
RequestContentTypeProtobuf = "application/x-protobuf"
)
Variables ¶
This section is empty.
Functions ¶
func NewEventsRequest ¶
func NewMetricsRequest ¶
func ProcessEventsResponse ¶
func ProcessMetricResponse ¶
func WithDelimitedStrings ¶
WithDelimtedStrings splits each value based on the delim passed, if there is no delim present, then the entire string is added to the key and uses an empty string as the value
func WithHistogramDataPointAttributes ¶
func WithHistogramDataPointAttributes(attrs Map) func(HistogramDataPoint)
func WithHistogramDataPointCumulativeBucketValues ¶
func WithHistogramDataPointCumulativeBucketValues[Buckets ~map[Bound]int, Bound ~float64](buckets Buckets) func(HistogramDataPoint)
func WithHistogramDataPointStatistics ¶
func WithHistogramDataPointStatistics(values []float64) func(HistogramDataPoint)
func WithInstrumentationScopeAttributes ¶
func WithInstrumentationScopeAttributes(attributes Map) func(InstrumentationScope)
func WithNumberDataPointDoubleValue ¶
func WithNumberDataPointDoubleValue(value float64) func(NumberDataPoint)
func WithNumberDataPointMap ¶
func WithNumberDataPointMap(m Map) func(NumberDataPoint)
func WithNumberDatapointIntValue ¶
func WithNumberDatapointIntValue(value int64) func(NumberDataPoint)
func WithResourceAttributes ¶
func WithResourceMap ¶
func WithStatsdDelimitedTags ¶
func WithStatsdEventTags ¶
Types ¶
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
func NewGauge ¶
func NewGauge(datapoints ...NumberDataPoint) Gauge
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
func NewHistogram ¶
func NewHistogram(datapoints ...HistogramDataPoint) Histogram
type HistogramDataPoint ¶
type HistogramDataPoint struct {
// contains filtered or unexported fields
}
func NewHistogramDataPoint ¶
func NewHistogramDataPoint(timestamp uint64, opts ...func(HistogramDataPoint)) HistogramDataPoint
type InstrumentationScope ¶
type InstrumentationScope struct {
// contains filtered or unexported fields
}
func NewInstrumentationScope ¶
func NewInstrumentationScope(name string, version string, opts ...func(InstrumentationScope)) InstrumentationScope
NewInstrumentationScope is used for denote how the data was generated, this will always be set to `gostatsd` as the name, and the deployed version. Additional attributes can be set that could be used for filtering later on.
func (InstrumentationScope) Attributes ¶
func (is InstrumentationScope) Attributes() Map
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
func (KeyValue) Compare ¶
Compare is used to determine order of a KeyValue within `Map` value, the keys are compared first and if they match, then values are compared. In the event that value types do not match, the `ArrayValue` takes priority of the `StringValue`.
func (KeyValue) InsertValue ¶
InsertValue will update the value to be an array value if values doesn't match the existing value, and the array values are ensured for their uniquiness.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
func NewMetric ¶
NewMetric creates a new metric wrapper and sets the metric value based on the provided function.
func (Metric) SetHistogram ¶
type NumberDataPoint ¶
type NumberDataPoint struct {
// contains filtered or unexported fields
}
func NewNumberDataPoint ¶
func NewNumberDataPoint(timestamp uint64, opts ...func(NumberDataPoint)) NumberDataPoint
NewNumberDataPoint applies options in order so the last value set wins
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
func NewResource ¶
func (Resource) Attributes ¶
type ResourceMetrics ¶
type ResourceMetrics struct {
// contains filtered or unexported fields
}
func NewResourceMetrics ¶
func NewResourceMetrics(resource Resource, scopeMetrics ...ScopeMetrics) ResourceMetrics
func (ResourceMetrics) AppendMetric ¶
func (rm ResourceMetrics) AppendMetric(is InstrumentationScope, m Metric)
func (ResourceMetrics) CountMetrics ¶
func (rm ResourceMetrics) CountMetrics() int
type ScopeMetrics ¶
type ScopeMetrics struct {
// contains filtered or unexported fields
}
func NewScopeMetrics ¶
func NewScopeMetrics(is InstrumentationScope, metrics ...Metric) ScopeMetrics