Documentation ¶
Index ¶
- Constants
- func IntegrationPopulator(config *IntegrationPopulateConfig) (bool, []error)
- func K8sMetricSetTypeGuesser(groupLabel string) (string, error)
- type EntityIDGeneratorFunc
- type EntityTypeGeneratorFunc
- type FetchFunc
- type FetchedValue
- type FetchedValues
- type FilterFunc
- type FilteredValue
- type GuessFunc
- type IntegrationPopulateConfig
- type NamespaceGetterFunc
- type RawGroups
- type RawMetrics
- type RawValue
- type Spec
- type SpecGroup
- type SpecGroups
- type TransformFunc
Constants ¶
const NamespaceFilteredLabel = "nrFiltered"
const NamespaceGroup = "namespace"
Variables ¶
This section is empty.
Functions ¶
func IntegrationPopulator ¶
func IntegrationPopulator(config *IntegrationPopulateConfig) (bool, []error)
IntegrationPopulator populates an integration with the given metrics and definition.
func K8sMetricSetTypeGuesser ¶ added in v3.6.0
K8sMetricSetTypeGuesser is the metric set type guesser for k8s integrations. It composes the 'event_type' value using the group label defined in the corresponding specs.
Types ¶
type EntityIDGeneratorFunc ¶
EntityIDGeneratorFunc generates an entity ID.
type EntityTypeGeneratorFunc ¶
type EntityTypeGeneratorFunc func(groupLabel, rawEntityID string, g RawGroups, prefix string) (string, error)
EntityTypeGeneratorFunc generates an entity type.
type FetchFunc ¶
type FetchFunc func(groupLabel, entityID string, groups RawGroups) (FetchedValue, error)
FetchFunc fetches values or values from raw metric groups. Return FetchedValues if you want to prototype metrics.
func Transform ¶
func Transform(fetchFunc FetchFunc, transformFunc TransformFunc) FetchFunc
Transform return a new FetchFunc that applies the transformFunc to the result of the fetchFunc passed as argument
func TransformAndFilter ¶ added in v3.15.3
func TransformAndFilter(fetchFunc FetchFunc, transformFunc TransformFunc, filterFunc FilterFunc) FetchFunc
TransformAndFilter return a new FetchFunc that first applies a TransformFunc to the result of the fetchFunc passed as argument. It then applies the FilterFunc to the result of the TransformFunc if the transform was successfully applied.
type FetchedValue ¶
type FetchedValue interface{}
FetchedValue is just any value from an already fetched metric.
type FetchedValues ¶
type FetchedValues map[string]FetchedValue
FetchedValues is a map of FetchedValue indexed by metric name.
type FilterFunc ¶ added in v3.15.3
type FilterFunc func(value FetchedValue, groupLabel, entityID string, groups RawGroups) (FilteredValue, error)
FilterFunc applies a filtering function on the raw fetchedValue. Return FilteredValue if the filter was successfully applied or error otherwise.
type FilteredValue ¶ added in v3.15.3
type FilteredValue interface{}
FilteredValue is the filtered value of an already fetched metric.
type IntegrationPopulateConfig ¶
type IntegrationPopulateConfig struct { Integration *integration.Integration ClusterName string K8sVersion fmt.Stringer MsTypeGuesser GuessFunc Groups RawGroups Specs SpecGroups Filterer discovery.NamespaceFilterer }
type NamespaceGetterFunc ¶ added in v3.3.0
type NamespaceGetterFunc func(metrics RawMetrics) string
NamespaceGetterFunc gets the namespace.
type RawGroups ¶
type RawGroups map[string]map[string]RawMetrics
RawGroups are grouped raw metrics. map[entityType][entityName][metricName]metricValue as interface{}
type RawMetrics ¶
RawMetrics is a map of RawValue indexed by metric name.
type Spec ¶
type Spec struct { Name string ValueFunc FetchFunc Type metric.SourceType Optional bool }
Spec is a metric specification.
type SpecGroup ¶
type SpecGroup struct { IDGenerator EntityIDGeneratorFunc TypeGenerator EntityTypeGeneratorFunc NamespaceGetter NamespaceGetterFunc MsTypeGuesser GuessFunc Specs []Spec }
SpecGroup represents a bunch of specs that share logic.
type SpecGroups ¶
SpecGroups is a map of groups indexed by group name.
type TransformFunc ¶
type TransformFunc func(FetchedValue) (FetchedValue, error)
TransformFunc transforms a FetchedValue.