Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove batchMetricsFast processor #260

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions manifests/charts/agent/files/aperture-agent-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ otel:
batch_postrollup:
timeout: {{ .Values.agent.batchPostrollup.timeout }}
send_batch_size: {{ .Values.agent.batchPostrollup.sendBatchSize }}
batch_metrics_fast:
timeout: {{ .Values.agent.batchMetricsFast.timeout }}
send_batch_size: {{ .Values.agent.batchMetricsFast.sendBatchSize }}
{{- end }}

log:
Expand Down
7 changes: 0 additions & 7 deletions manifests/charts/agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,6 @@ agent:
timeout: 1s
sendBatchSize: 10000

## @param agent.batchMetricsFast.timeout Timeout for batch metrics/fast processor.
## @param agent.batchMetricsFast.sendBatchSize Size of a batch in metrics/fast processor which after hit, will trigger it to be sent.
##
batchMetricsFast:
timeout: 1s
sendBatchSize: 1000

## @section Controller Parameters

## Agent Controller container
Expand Down
2 changes: 0 additions & 2 deletions manifests/charts/aperture-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ Aperture Operator
| `agent.batchPrerollup.sendBatchSize` | Size of a batch in prerollup processor which after hit, will trigger it to be sent. | `nil` |
| `agent.batchPostrollup.timeout` | Timeout for batch postrollup processor. | `nil` |
| `agent.batchPostrollup.sendBatchSize` | Size of a batch in postrollup processor which after hit, will trigger it to be sent. | `nil` |
| `agent.batchMetricsFast.timeout` | Timeout for batch metrics/fast processor. | `nil` |
| `agent.batchMetricsFast.sendBatchSize` | Size of a batch in metrics/fast processor which after hit, will trigger it to be sent. | `nil` |
| `agent.log.prettyConsole` | Additional log writer: pretty console (stdout) logging (not recommended for prod environments). Defaults to false. | `nil` |
| `agent.log.nonBlocking` | Use non-blocking log writer (can lose logs at high throughput). Defaults to True. | `nil` |
| `agent.log.level` | Log level. Keywords allowed - ["debug", "info", "warn", "fatal", "panic", "trace"]. Defaults to 'info'. | `nil` |
Expand Down
5 changes: 0 additions & 5 deletions manifests/charts/aperture-operator/templates/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ spec:
timeout: {{ .Values.agent.batchPostrollup.timeout }}
sendBatchSize: {{ .Values.agent.batchPostrollup.sendBatchSize }}
{{- end }}
{{- if or .Values.agent.batchMetricsFast.timeout .Values.agent.batchMetricsFast.sendBatchSize }}
batchMetricsFast:
timeout: {{ .Values.agent.batchMetricsFast.timeout }}
sendBatchSize: {{ .Values.agent.batchMetricsFast.sendBatchSize }}
{{- end }}
{{- if or .Values.agent.log.prettyConsole .Values.agent.log.nonBlocking .Values.agent.log.level .Values.agent.log.file }}
log: {{ .Values.agent.log | toYaml | nindent 4 }}
{{- end }}
Expand Down
6 changes: 0 additions & 6 deletions manifests/charts/aperture-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,6 @@ agent:
batchPostrollup:
timeout: ~
sendBatchSize: ~
## @param agent.batchMetricsFast.timeout Timeout for batch metrics/fast processor.
## @param agent.batchMetricsFast.sendBatchSize Size of a batch in metrics/fast processor which after hit, will trigger it to be sent.
##
batchMetricsFast:
timeout: ~
sendBatchSize: ~
## @param agent.log.prettyConsole Additional log writer: pretty console (stdout) logging (not recommended for prod environments). Defaults to false.
## @param agent.log.nonBlocking Use non-blocking log writer (can lose logs at high throughput). Defaults to True.
## @param agent.log.level Log level. Keywords allowed - ["debug", "info", "warn", "fatal", "panic", "trace"]. Defaults to 'info'.
Expand Down
5 changes: 0 additions & 5 deletions operator/api/v1alpha1/agent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ type AgentSpec struct {
//+kubebuilder:validation:Optional
//+kubebuilder:default:={timeout:"1s",sendBatchSize:10000}
BatchPostrollup Batch `json:"batchPostrollup"`

// Batch metrics/fast processor configuration.
//+kubebuilder:validation:Optional
//+kubebuilder:default:={timeout:"1s",sendBatchSize:1000}
BatchMetricsFast Batch `json:"batchMetricsFast"`
}

// AgentStatus defines the observed state of Agent.
Expand Down
1 change: 0 additions & 1 deletion operator/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions operator/controllers/agent_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ otel:
batch_postrollup:
timeout: {{ .BatchPostrollup.Timeout }}
send_batch_size: {{ .BatchPostrollup.SendBatchSize }}
batch_metrics_fast:
timeout: {{ .BatchMetricsFast.Timeout }}
send_batch_size: {{ .BatchMetricsFast.SendBatchSize }}
{{- end }}

log:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ otel:
batch_postrollup:
timeout: 1s
send_batch_size: 10000
batch_metrics_fast:
timeout: 1s
send_batch_size: 10000

log:
pretty_console: false
Expand Down
2 changes: 0 additions & 2 deletions operator/controllers/configmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func filledAgentConfig(instance *v1alpha1.Agent) (string, error) {
Ingestion v1alpha1.Ingestion `json:"ingestion"`
BatchPrerollup v1alpha1.Batch
BatchPostrollup v1alpha1.Batch
BatchMetricsFast v1alpha1.Batch
}{
ServerPort: instance.Spec.ServerPort,
DistributedCachePort: instance.Spec.DistributedCachePort,
Expand All @@ -66,7 +65,6 @@ func filledAgentConfig(instance *v1alpha1.Agent) (string, error) {
PrometheusAddress: checkPrometheusAddress(instance.Spec.Prometheus.Address, instance.GetName(), instance.GetNamespace()),
BatchPrerollup: instance.Spec.BatchPrerollup,
BatchPostrollup: instance.Spec.BatchPostrollup,
BatchMetricsFast: instance.Spec.BatchMetricsFast,
}

var config bytes.Buffer
Expand Down
4 changes: 0 additions & 4 deletions operator/controllers/configmaps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ var _ = Describe("ConfigMap for Agent", func() {
Timeout: "1s",
SendBatchSize: 10000,
},
BatchMetricsFast: v1alpha1.Batch{
Timeout: "1s",
SendBatchSize: 10000,
},
DistributedCachePort: 3320,
MemberListPort: 3322,
},
Expand Down
16 changes: 4 additions & 12 deletions pkg/otel/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package otel

import (
"fmt"
"time"

promapi "github.com/prometheus/client_golang/api"
"go.opentelemetry.io/collector/config/configgrpc"
Expand Down Expand Up @@ -34,9 +33,6 @@ const (
// ProcessorBatchPostrollup batches data after rolling up, as roll up process
// shrinks number of data points significantly.
ProcessorBatchPostrollup = "batch/postrollup"
// ProcessorBatchMetricsFast batches metrics in small and fast packages. Used
// in flow control policy.
ProcessorBatchMetricsFast = "batch/metrics-fast"
// ProcessorRollup rolls up data to decrease cardinality.
ProcessorRollup = "rollup"

Expand All @@ -52,10 +48,9 @@ type otelConfig struct {
// Addr is an address on which this app is serving metrics.
// TODO this should be inherited from the listener.Listener config, but it's
// not initialized at the provide state of app.
Addr string `json:"addr" validate:"hostname_port" default:":8080"`
BatchPrerollup Batch `json:"batch_prerollup"`
BatchPostrollup Batch `json:"batch_postrollup"`
BatchMetricsFast Batch `json:"batch_metrics_fast"`
Addr string `json:"addr" validate:"hostname_port" default:":8080"`
BatchPrerollup Batch `json:"batch_prerollup"`
BatchPostrollup Batch `json:"batch_postrollup"`
}

// Batch defines configuration for OTEL batch processor.
Expand Down Expand Up @@ -147,25 +142,22 @@ func addLogsAndTracesPipelines(config *otelcollector.OTELConfig, cfg otelConfig)
func addMetricsPipeline(config *otelcollector.OTELConfig, promClient promapi.Client, cfg otelConfig) {
addPrometheusReceiver(config, cfg)
config.AddProcessor(ProcessorEnrichment, nil)
config.AddBatchProcessor(ProcessorBatchMetricsFast, cfg.BatchMetricsFast.Timeout.Duration.AsDuration(), cfg.BatchMetricsFast.SendBatchSize)
addPrometheusRemoteWriteExporter(config, promClient)
config.Service.AddPipeline("metrics/fast", otelcollector.Pipeline{
Receivers: []string{ReceiverPrometheus},
Processors: []string{
ProcessorEnrichment,
ProcessorBatchMetricsFast,
},
Exporters: []string{ExporterPrometheusRemoteWrite},
})
}

func addControllerMetricsPipeline(config *otelcollector.OTELConfig, promClient promapi.Client, cfg otelConfig) {
addControllerPrometheusReceiver(config, cfg)
config.AddBatchProcessor(ProcessorBatchMetricsFast, 1*time.Second, 1000)
addPrometheusRemoteWriteExporter(config, promClient)
config.Service.AddPipeline("metrics/controller-fast", otelcollector.Pipeline{
Receivers: []string{ReceiverPrometheus},
Processors: []string{ProcessorBatchMetricsFast},
Processors: []string{},
Exporters: []string{ExporterPrometheusRemoteWrite},
})
}
Expand Down