-
Notifications
You must be signed in to change notification settings - Fork 25
/
types.go
75 lines (66 loc) · 3.12 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// +kubebuilder:validation:Optional
package config
import (
"github.com/fluxninja/aperture/v2/pkg/config"
otelconfig "github.com/fluxninja/aperture/v2/pkg/otelcollector/config"
)
// swagger:operation POST /otel agent-configuration OTel
// ---
// x-fn-config-env: true
// parameters:
// - in: body
// schema:
// "$ref": "#/definitions/AgentOTelConfig"
// AgentOTelConfig is the configuration for Agent's OTel collector.
// +kubebuilder:object:generate=true
//
//swagger:model
type AgentOTelConfig struct {
// BatchPrerollup configures the OTel batch pre-processor.
BatchPrerollup BatchPrerollupConfig `json:"batch_prerollup"`
// BatchPostrollup configures the OTel batch post-processor.
BatchPostrollup BatchPostrollupConfig `json:"batch_postrollup"`
otelconfig.CommonOTelConfig `json:",inline"`
// DisableKubernetesScraper disables the default metrics collection for Kubernetes resources.
DisableKubernetesScraper bool `json:"disable_kubernetes_scraper" default:"false"`
// DisableKubeletScraper disables the default metrics collection for kubelet.
// Deprecated: kubelet scraper is removed entirely, so this flag makes no difference.
DisableKubeletScraper bool `json:"disable_kubelet_scraper" default:"false"`
// EnableHighCardinalityPlatformMetrics filters out high cardinality Aperture platform metrics from being
// published to Prometheus. Filtered out metrics are:
// * "grpc_server_handled_total.*"
// * "grpc_server_handling_seconds.*"
// * "grpc_server_handling_seconds_bucket.*"
// * "grpc_server_handling_seconds_count.*"
// * "grpc_server_handling_seconds_sum.*"
// * "grpc_server_msg_received_total.*"
// * "grpc_server_msg_sent_total.*"
// * "grpc_server_started_total.*"
EnableHighCardinalityPlatformMetrics bool `json:"enable_high_cardinality_platform_metrics" default:"false"`
}
// BatchPrerollupConfig defines pre-rollup configuration for OTel batch processor.
// +kubebuilder:object:generate=true
//
//swagger:model
type BatchPrerollupConfig struct {
// Timeout sets the time after which a batch will be sent regardless of size.
Timeout config.Duration `json:"timeout" validate:"gt=0" default:"10s"`
// SendBatchSize is the number of metrics to send in a batch.
SendBatchSize uint32 `json:"send_batch_size" validate:"gt=0" default:"10000"`
// SendBatchMaxSize is the upper limit of the batch size. Bigger batches will be split
// into smaller units.
SendBatchMaxSize uint32 `json:"send_batch_max_size" validate:"gte=0" default:"10000"`
}
// BatchPostrollupConfig defines post-rollup configuration for OTel batch processor.
// +kubebuilder:object:generate=true
//
//swagger:model
type BatchPostrollupConfig struct {
// Timeout sets the time after which a batch will be sent regardless of size.
Timeout config.Duration `json:"timeout" validate:"gt=0" default:"1s"`
// SendBatchSize is the number of metrics to send in a batch.
SendBatchSize uint32 `json:"send_batch_size" validate:"gt=0" default:"100"`
// SendBatchMaxSize is the upper limit of the batch size. Bigger batches will be split
// into smaller units.
SendBatchMaxSize uint32 `json:"send_batch_max_size" validate:"gte=0" default:"100"`
}