diff --git a/docs/upgrade-guide/_index.md b/docs/upgrade-guide/_index.md index fc8efaa023d4..ab65ac753e59 100644 --- a/docs/upgrade-guide/_index.md +++ b/docs/upgrade-guide/_index.md @@ -21,7 +21,8 @@ receiving all spans for a trace in the same agent to be processed, such as service graphs. As a consequence, `tail_sampling.load_balancing` has been deprecated in favor of -a `load_balancing` block. +a `load_balancing` block. Also, `port` has been renamed to `receiver_port` and +moved to the new `load_balancing` block. Example old config: @@ -29,6 +30,7 @@ Example old config: tail_sampling: policies: - always_sample: + port: 4318 load_balancing: exporter: insecure: true @@ -51,6 +53,7 @@ load_balancing: dns: hostname: agent port: 4318 + receiver_port: 4318 ``` ### Operator: Rename of Prometheus to Metrics (Breaking change) diff --git a/pkg/tempo/config.go b/pkg/tempo/config.go index 3b20fb5bd63c..3144999efce8 100644 --- a/pkg/tempo/config.go +++ b/pkg/tempo/config.go @@ -222,8 +222,6 @@ type tailSamplingConfig struct { Policies []map[string]interface{} `yaml:"policies"` // DecisionWait defines the time to wait for a complete trace before making a decision DecisionWait time.Duration `yaml:"decision_wait,omitempty"` - // Port is the port the instance will use to receive load balanced traces - Port string `yaml:"port"` } // loadBalancingConfig defines the configuration for load balancing spans between agent instances @@ -231,6 +229,8 @@ type tailSamplingConfig struct { type loadBalancingConfig struct { Exporter exporterConfig `yaml:"exporter"` Resolver map[string]interface{} `yaml:"resolver"` + // ReceiverPort is the port the instance will use to receive load balanced traces + ReceiverPort string `yaml:"receiver_port"` } // exporterConfig defined the config for a otlp exporter for load balancing @@ -544,8 +544,8 @@ func (c *InstanceConfig) otelConfig() (*config.Config, error) { exporters["loadbalancing"] = internalExporter receiverPort := defaultLoadBalancingPort - if c.TailSampling.Port != "" { - receiverPort = c.TailSampling.Port + if c.LoadBalancing.ReceiverPort != "" { + receiverPort = c.LoadBalancing.ReceiverPort } c.Receivers["otlp/lb"] = map[string]interface{}{ "protocols": map[string]interface{}{ @@ -557,7 +557,7 @@ func (c *InstanceConfig) otelConfig() (*config.Config, error) { } // Build Pipelines - splitPipeline := c.TailSampling != nil && c.LoadBalancing != nil + splitPipeline := c.LoadBalancing != nil orderedSplitProcessors := orderProcessors(processorNames, splitPipeline) if splitPipeline { // load balancing pipeline @@ -690,7 +690,8 @@ func orderProcessors(processors []string, splitPipelines bool) [][]string { foundAt := len(processors) for i, processor := range processors { if processor == "batch" || - processor == "tail_sampling" { + processor == "tail_sampling" || + processor == "automatic_logging" { foundAt = i break } diff --git a/pkg/tempo/config_test.go b/pkg/tempo/config_test.go index 6000e2c108a4..e20ca02a1d37 100644 --- a/pkg/tempo/config_test.go +++ b/pkg/tempo/config_test.go @@ -607,12 +607,13 @@ tail_sampling: - value1 - value2 load_balancing: + receiver_port: 8080 exporter: insecure: true resolver: dns: hostname: agent - port: 4318 + port: 8080 `, expectedConfig: ` receivers: @@ -622,7 +623,7 @@ receivers: otlp/lb: protocols: grpc: - endpoint: "0.0.0.0:4318" + endpoint: "0.0.0.0:8080" exporters: otlp/0: endpoint: example.com:12345 @@ -639,7 +640,7 @@ exporters: resolver: dns: hostname: agent - port: 4318 + port: 8080 processors: tail_sampling: decision_wait: 5s @@ -940,6 +941,54 @@ load_balancing: "metrics/spanmetrics": nil, }, }, + { + name: "load balancing without tail sampling", + cfg: ` +receivers: + jaeger: + protocols: + grpc: +remote_write: + - endpoint: example.com:12345 + headers: + x-some-header: Some value! +attributes: + actions: + - key: montgomery + value: forever + action: update +spanmetrics: + latency_histogram_buckets: [2ms, 6ms, 10ms, 100ms, 250ms] + dimensions: + - name: http.method + default: GET + - name: http.status_code + prom_instance: tempo +automatic_logging: + spans: true +batch: + timeout: 5s + send_batch_size: 100 +load_balancing: + exporter: + insecure: true + resolver: + dns: + hostname: agent + port: 4318 +`, + expectedProcessors: map[string][]config.ComponentID{ + "traces/0": { + config.NewID("attributes"), + config.NewID("spanmetrics"), + }, + "traces/1": { + config.NewID("automatic_logging"), + config.NewID("batch"), + }, + "metrics/spanmetrics": nil, + }, + }, } for _, tc := range tt {