Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into update-tempo-to-v2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Oct 14, 2024
2 parents 1c5a71b + 5238c4c commit 8b4dea2
Show file tree
Hide file tree
Showing 70 changed files with 1,656 additions and 192 deletions.
16 changes: 16 additions & 0 deletions .chloggen/bump_jaeger-to-1.62.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
component: tempostack, tempomonolithic

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: bump jaeger to v1.62

# One or more tracking issues related to the change
issues: [1050]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
16 changes: 16 additions & 0 deletions .chloggen/fix-ingress-type-default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
component: tempostack

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: The default value for the IngressType type is now correctly "" (empty string). Previously, it was impossible to select it in tools like the OpenShift web console, what could cause some issues.

# One or more tracking issues related to the change
issues: [1054]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
16 changes: 16 additions & 0 deletions .chloggen/fix_jaeger-query-certs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
component: tempostack

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: grant jaeer-query access to pki certs

# One or more tracking issues related to the change
issues: [1051]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
21 changes: 21 additions & 0 deletions .chloggen/tempo-query-find-traces-jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
component: tempostack, tempomonolithic

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add tempo-query CRD option to speed up trace search.

# One or more tracking issues related to the change
issues: [1048]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Following CRD options were added to speed up trace search in Jaeger UI/API. The trace search first
searches for traceids and then it gets a full trace. With this configuration option the requests
to get the full trace can be run in parallel:
For `TempoStack` - `spec.template.queryFrontend.jaegerQuery.findTracesConcurrentRequests`
For `TempoMonolithic` - `spec.jaegerui.findTracesConcurrentRequests`
18 changes: 18 additions & 0 deletions .chloggen/timeout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
component: tempostack, tempomonolithic

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add unified timeout configuration. It changes the default to 30s.

# One or more tracking issues related to the change
issues: [1045]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Adding `spec.timeout` CRD option to configure timeout on all components and default it to 30s.
Before Tempo server was defaulting to 3m, gateway to 2m, OpenShift route to 30s (for query), oauth-proxy to 30s (for query).
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Current Operator version
OPERATOR_VERSION ?= 0.13.0
TEMPO_VERSION ?= 2.6.0
TEMPO_QUERY_VERSION ?= main-2999520
JAEGER_QUERY_VERSION ?= 1.60
JAEGER_QUERY_VERSION ?= 1.62.0
TEMPO_QUERY_VERSION ?= main-1de25ca
TEMPO_GATEWAY_VERSION ?= main-2024-08-05-11d0d94
TEMPO_GATEWAY_OPA_VERSION ?= main-2024-04-29-914c13f
OAUTH_PROXY_VERSION=4.12
OAUTH_PROXY_VERSION=4.14

MIN_KUBERNETES_VERSION ?= 1.25.0
MIN_OPENSHIFT_VERSION ?= 4.12
Expand Down
3 changes: 2 additions & 1 deletion apis/tempo/v1alpha1/ingress_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package v1alpha1

type (
// IngressType represents how a service should be exposed (ingress vs route).
// +kubebuilder:validation:Enum=ingress;route
// +kubebuilder:validation:Enum=ingress;route;""
// +kubebuilder:default=""
IngressType string
)

Expand Down
15 changes: 12 additions & 3 deletions apis/tempo/v1alpha1/tempomonolithic_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import (
)

var (
twoGBQuantity = resource.MustParse("2Gi")
tenGBQuantity = resource.MustParse("10Gi")
defaultServicesDuration = metav1.Duration{Duration: time.Hour * 24 * 3}
twoGBQuantity = resource.MustParse("2Gi")
tenGBQuantity = resource.MustParse("10Gi")
defaultServicesDuration = metav1.Duration{Duration: time.Hour * 24 * 3}
defaultTimeout = metav1.Duration{Duration: time.Second * 30}
defaultFindTracesConcurrentRequests = 2
)

// Default sets all default values in a central place, instead of setting it at every place where the value is accessed.
Expand Down Expand Up @@ -87,5 +89,12 @@ func (r *TempoMonolithic) Default(ctrlConfig configv1alpha1.ProjectConfig) {
if r.Spec.JaegerUI.ServicesQueryDuration == nil {
r.Spec.JaegerUI.ServicesQueryDuration = &defaultServicesDuration
}
if r.Spec.JaegerUI.FindTracesConcurrentRequests == 0 {
r.Spec.JaegerUI.FindTracesConcurrentRequests = defaultFindTracesConcurrentRequests
}
}

if r.Spec.Timeout.Duration == 0 {
r.Spec.Timeout = defaultTimeout
}
}
31 changes: 24 additions & 7 deletions apis/tempo/v1alpha1/tempomonolithic_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

configv1alpha1 "github.com/grafana/tempo-operator/apis/config/v1alpha1"
Expand Down Expand Up @@ -46,6 +47,7 @@ func TestMonolithicDefault(t *testing.T) {
},
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
Expand Down Expand Up @@ -79,6 +81,7 @@ func TestMonolithicDefault(t *testing.T) {
},
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
Expand All @@ -104,6 +107,7 @@ func TestMonolithicDefault(t *testing.T) {
},
},
Management: "Unmanaged",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
expected: &TempoMonolithic{
Expand All @@ -125,6 +129,7 @@ func TestMonolithicDefault(t *testing.T) {
},
},
Management: "Unmanaged",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
Expand Down Expand Up @@ -191,9 +196,11 @@ func TestMonolithicDefault(t *testing.T) {
Enabled: true,
SAR: "{\"namespace\": \"testns\", \"resource\": \"pods\", \"verb\": \"get\"}",
},
ServicesQueryDuration: &defaultServicesDuration,
ServicesQueryDuration: &defaultServicesDuration,
FindTracesConcurrentRequests: 2,
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
Expand Down Expand Up @@ -263,9 +270,11 @@ func TestMonolithicDefault(t *testing.T) {
Enabled: false,
SAR: "{\"namespace\": \"testns\", \"resource\": \"pods\", \"verb\": \"get\"}",
},
ServicesQueryDuration: &defaultServicesDuration,
ServicesQueryDuration: &defaultServicesDuration,
FindTracesConcurrentRequests: 2,
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
Expand Down Expand Up @@ -327,9 +336,11 @@ func TestMonolithicDefault(t *testing.T) {
Enabled: true,
SAR: "{\"namespace\": \"testns\", \"resource\": \"pods\", \"verb\": \"get\"}",
},
ServicesQueryDuration: &defaultServicesDuration,
ServicesQueryDuration: &defaultServicesDuration,
FindTracesConcurrentRequests: 2,
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
Expand Down Expand Up @@ -390,14 +401,16 @@ func TestMonolithicDefault(t *testing.T) {
Enabled: false,
SAR: "{\"namespace\": \"testns\", \"resource\": \"pods\", \"verb\": \"get\"}",
},
ServicesQueryDuration: &defaultServicesDuration,
ServicesQueryDuration: &defaultServicesDuration,
FindTracesConcurrentRequests: 2,
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Second * 30},
},
},
},
{
name: "define custom duration for services list",
name: "define custom duration for services list, timeout and find traces",
input: &TempoMonolithic{
ObjectMeta: v1.ObjectMeta{
Name: "test",
Expand All @@ -415,8 +428,10 @@ func TestMonolithicDefault(t *testing.T) {
Route: &MonolithicJaegerUIRouteSpec{
Enabled: true,
},
ServicesQueryDuration: &v1.Duration{Duration: time.Duration(100 * 100)},
ServicesQueryDuration: &v1.Duration{Duration: time.Duration(100 * 100)},
FindTracesConcurrentRequests: 40,
},
Timeout: metav1.Duration{Duration: time.Hour},
},
},
expected: &TempoMonolithic{
Expand Down Expand Up @@ -451,9 +466,11 @@ func TestMonolithicDefault(t *testing.T) {
Enabled: false,
SAR: "{\"namespace\": \"testns\", \"resource\": \"pods\", \"verb\": \"get\"}",
},
ServicesQueryDuration: &v1.Duration{Duration: time.Duration(100 * 100)},
ServicesQueryDuration: &v1.Duration{Duration: time.Duration(100 * 100)},
FindTracesConcurrentRequests: 40,
},
Management: "Managed",
Timeout: metav1.Duration{Duration: time.Hour},
},
},
},
Expand Down
18 changes: 18 additions & 0 deletions apis/tempo/v1alpha1/tempomonolithic_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ type TempoMonolithicSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resources",order=5,xDescriptors="urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

// Timeout configures the same timeout on all components starting at ingress down to the ingestor/querier.
// Timeout configuration on a specific component has a higher precedence.
// Default is 30 seconds.
Timeout metav1.Duration `json:"timeout,omitempty"`

// ServiceAccount defines the Service Account to use for all Tempo components.
//
// +kubebuilder:validation:Optional
Expand Down Expand Up @@ -256,6 +261,19 @@ type MonolithicJaegerUISpec struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ServicesQueryDuration",xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced"
ServicesQueryDuration *metav1.Duration `json:"servicesQueryDuration,omitempty"`

// FindTracesConcurrentRequests defines how many concurrent request a single trace search can submit (defaults 2).
// The search for traces in Jaeger submits limit+1 requests. First requests finds trace IDs and then it fetches
// entire traces by ID. This property allows Jaeger to fetch traces in parallel.
// Note that by default a single Tempo querier can process 20 concurrent search jobs.
// Increasing this property might require scaling up querier instances, especially on error "job queue full"
// See also Tempo's extraConfig:
// querier.max_concurrent_queries (20 default)
// query_frontend.max_outstanding_per_tenant: (2000 default). Increase if the query-frontend returns 429
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="FindTracesConcurrentRequests",xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced"
FindTracesConcurrentRequests int `json:"findTracesConcurrentRequests,omitempty"`
}

// MonolithicJaegerUIIngressSpec defines the settings for the Jaeger UI ingress.
Expand Down
20 changes: 19 additions & 1 deletion apis/tempo/v1alpha1/tempostack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ type TempoStackSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Ingestion and Querying Ratelimiting"
LimitSpec LimitSpec `json:"limits,omitempty"`

// Timeout configures the same timeout on all components starting at ingress down to the ingestor/querier.
// Timeout configuration on a specific component has a higher precedence.
// Defaults to 30 seconds.
Timeout metav1.Duration `json:"timeout,omitempty"`

// StorageClassName for PVCs used by ingester. Defaults to nil (default storage class in the cluster).
//
// +optional
Expand Down Expand Up @@ -103,7 +108,7 @@ type TempoStackSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Tempo Component Templates"
Template TempoTemplateSpec `json:"template,omitempty"`

// ReplicationFactor is used to define how many component replicas should exist.
// The replication factor is a configuration setting that determines how many ingesters need to acknowledge the data from the distributors before accepting a span.
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Replication Factor"
Expand Down Expand Up @@ -613,6 +618,19 @@ type JaegerQuerySpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ServicesQueryDuration"
ServicesQueryDuration *metav1.Duration `json:"servicesQueryDuration,omitempty"`

// FindTracesConcurrentRequests defines how many concurrent request a single trace search can submit (defaults querier.replicas*2).
// The search for traces in Jaeger submits limit+1 requests. First requests finds trace IDs and then it fetches
// entire traces by ID. This property allows Jaeger to fetch traces in parallel.
// Note that by default a single Tempo querier can process 20 concurrent search jobs.
// Increasing this property might require scaling up querier instances, especially on error "job queue full"
// See also Tempo's extraConfig:
// querier.max_concurrent_queries (20 default)
// query_frontend.max_outstanding_per_tenant: (2000 default). Increase if the query-frontend returns 429
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="FindTracesConcurrentRequests",xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced"
FindTracesConcurrentRequests int `json:"findTracesConcurrentRequests,omitempty"`

// Authentication defines the options for the oauth proxy used to protect jaeger UI
//
// +optional
Expand Down
2 changes: 2 additions & 0 deletions apis/tempo/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 8b4dea2

Please sign in to comment.