Skip to content

Commit

Permalink
Merge branch 'main' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IshwarKanse authored Dec 17, 2024
2 parents 928bfa5 + a29a921 commit d2584ae
Show file tree
Hide file tree
Showing 80 changed files with 192 additions and 279 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ Changes by Version

<!-- next version -->

## 0.14.2

### 🧰 Bug fixes 🧰

- `tempostack`: Use default Jaeger RED metrics namespace if field is unset (#1096)
Use the default Jaeger RED metrics namespace if `.spec.template.queryFrontend.jaegerQuery.monitorTab.redMetricsNamespace` is not set.
Before Jaeger 1.62 the default namespace was empty, since [Jaeger 1.62](https://github.com/jaegertracing/jaeger/releases/tag/v1.62.0) (shipped in Tempo Operator v0.14.0) the default namespace is "traces_span_metrics".
Before OpenTelemetry Collector v0.109.0 the default namespace of the spanmetrics connector was empty, since [OpenTelemetry Collector v0.109.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.109.0) the default namespace is "traces_span_metrics".


### Components
- Tempo: [v2.6.1](https://github.com/grafana/tempo/releases/tag/v2.6.1)

## 0.14.1

### 🧰 Bug fixes 🧰
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Current Operator version
OPERATOR_VERSION ?= 0.14.1
OPERATOR_VERSION ?= 0.14.2
TEMPO_VERSION ?= 2.6.1
JAEGER_QUERY_VERSION ?= 1.62.0
TEMPO_QUERY_VERSION ?= 2.6.1
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ A locally installed [CRC](https://github.com/crc-org/crc) cluster can be used fo
Note: The e2e tests require [opentelemetry-operator](https://github.com/open-telemetry/opentelemetry-operator) and cluster monitoring operator (`crc config set enable-cluster-monitoring true`).

```
kubectl create namespace tempo-operator-system
IMG_PREFIX=docker.io/your_username OPERATOR_VERSION=x.y.z BUNDLE_VARIANT=openshift make bundle docker-build docker-push bundle-build bundle-push olm-deploy
kubectl create namespace openshift-tempo-operator
IMG_PREFIX=docker.io/your_username OPERATOR_VERSION=x.y.z BUNDLE_VARIANT=openshift OPERATOR_NAMESPACE=openshift-tempo-operator make build docker-build docker-push bundle bundle-build bundle-push olm-deploy
make e2e e2e-openshift
```

Expand Down
4 changes: 1 addition & 3 deletions apis/tempo/v1alpha1/tempostack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,12 +690,10 @@ type JaegerQueryMonitor struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Prometheus endpoint"
PrometheusEndpoint string `json:"prometheusEndpoint"`
// REDMetricsNamespace defines the a prefix used retrieve span rate, error, and duration (RED) metrics.
// By default it is set to `traces.span.metrics` following the default namespace of the OpenTelemetry Collector since Version 0.109.0.
// +optional
// +kubebuilder:validation:Optional
// +kubebuilder:default:=traces.span.metrics
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="RED Metric Namespace"
REDMetricsNamespace string `json:"redMetricsNamespace"`
REDMetricsNamespace *string `json:"redMetricsNamespace,omitempty"`
}

// IngressSpec defines Jaeger Query Ingress options.
Expand Down
7 changes: 6 additions & 1 deletion apis/tempo/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ metadata:
]
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
createdAt: "2024-11-06T14:25:14Z"
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.2
createdAt: "2024-12-02T13:07:44Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand All @@ -83,7 +83,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/grafana/tempo-operator
support: Grafana Tempo Operator SIG
name: tempo-operator.v0.14.1
name: tempo-operator.v0.14.2
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1071,9 +1071,7 @@ spec:
displayName: Prometheus endpoint
path: template.queryFrontend.jaegerQuery.monitorTab.prometheusEndpoint
- description: REDMetricsNamespace defines the a prefix used retrieve span rate,
error, and duration (RED) metrics. By default it is set to `traces.span.metrics`
following the default namespace of the OpenTelemetry Collector since Version
0.109.0.
error, and duration (RED) metrics.
displayName: RED Metric Namespace
path: template.queryFrontend.jaegerQuery.monitorTab.redMetricsNamespace
- description: Resources defines resources for this component, this will override
Expand Down Expand Up @@ -1475,7 +1473,7 @@ spec:
value: quay.io/observatorium/opa-openshift:main-2024-10-09-7237863
- name: RELATED_IMAGE_OAUTH_PROXY
value: quay.io/openshift/origin-oauth-proxy:4.14
image: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
image: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.2
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -1625,7 +1623,7 @@ spec:
name: tempo-gateway-opa
- image: quay.io/openshift/origin-oauth-proxy:4.14
name: oauth-proxy
version: 0.14.1
version: 0.14.2
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
7 changes: 3 additions & 4 deletions bundle/community/manifests/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2471,10 +2471,9 @@ spec:
For instance on OpenShift this is set to https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
type: string
redMetricsNamespace:
default: traces.span.metrics
description: |-
REDMetricsNamespace defines the a prefix used retrieve span rate, error, and duration (RED) metrics.
By default it is set to `traces.span.metrics` following the default namespace of the OpenTelemetry Collector since Version 0.109.0.
description: REDMetricsNamespace defines the a prefix
used retrieve span rate, error, and duration (RED)
metrics.
type: string
type: object
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ metadata:
]
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
createdAt: "2024-11-06T14:25:12Z"
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.2
createdAt: "2024-12-02T13:07:42Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand All @@ -83,7 +83,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/grafana/tempo-operator
support: Grafana Tempo Operator SIG
name: tempo-operator.v0.14.1
name: tempo-operator.v0.14.2
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1071,9 +1071,7 @@ spec:
displayName: Prometheus endpoint
path: template.queryFrontend.jaegerQuery.monitorTab.prometheusEndpoint
- description: REDMetricsNamespace defines the a prefix used retrieve span rate,
error, and duration (RED) metrics. By default it is set to `traces.span.metrics`
following the default namespace of the OpenTelemetry Collector since Version
0.109.0.
error, and duration (RED) metrics.
displayName: RED Metric Namespace
path: template.queryFrontend.jaegerQuery.monitorTab.redMetricsNamespace
- description: Resources defines resources for this component, this will override
Expand Down Expand Up @@ -1485,7 +1483,7 @@ spec:
value: quay.io/observatorium/opa-openshift:main-2024-10-09-7237863
- name: RELATED_IMAGE_OAUTH_PROXY
value: quay.io/openshift/origin-oauth-proxy:4.14
image: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
image: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.2
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -1646,7 +1644,7 @@ spec:
name: tempo-gateway-opa
- image: quay.io/openshift/origin-oauth-proxy:4.14
name: oauth-proxy
version: 0.14.1
version: 0.14.2
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
7 changes: 3 additions & 4 deletions bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2471,10 +2471,9 @@ spec:
For instance on OpenShift this is set to https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
type: string
redMetricsNamespace:
default: traces.span.metrics
description: |-
REDMetricsNamespace defines the a prefix used retrieve span rate, error, and duration (RED) metrics.
By default it is set to `traces.span.metrics` following the default namespace of the OpenTelemetry Collector since Version 0.109.0.
description: REDMetricsNamespace defines the a prefix
used retrieve span rate, error, and duration (RED)
metrics.
type: string
type: object
resources:
Expand Down
7 changes: 3 additions & 4 deletions config/crd/bases/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2467,10 +2467,9 @@ spec:
For instance on OpenShift this is set to https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
type: string
redMetricsNamespace:
default: traces.span.metrics
description: |-
REDMetricsNamespace defines the a prefix used retrieve span rate, error, and duration (RED) metrics.
By default it is set to `traces.span.metrics` following the default namespace of the OpenTelemetry Collector since Version 0.109.0.
description: REDMetricsNamespace defines the a prefix
used retrieve span rate, error, and duration (RED)
metrics.
type: string
type: object
resources:
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/grafana/tempo-operator/tempo-operator
newTag: v0.14.1
newTag: v0.14.2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
alm-examples: '[]'
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.2
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -1000,9 +1000,7 @@ spec:
displayName: Prometheus endpoint
path: template.queryFrontend.jaegerQuery.monitorTab.prometheusEndpoint
- description: REDMetricsNamespace defines the a prefix used retrieve span rate,
error, and duration (RED) metrics. By default it is set to `traces.span.metrics`
following the default namespace of the OpenTelemetry Collector since Version
0.109.0.
error, and duration (RED) metrics.
displayName: RED Metric Namespace
path: template.queryFrontend.jaegerQuery.monitorTab.redMetricsNamespace
- description: Resources defines resources for this component, this will override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
alm-examples: '[]'
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.2
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -1000,9 +1000,7 @@ spec:
displayName: Prometheus endpoint
path: template.queryFrontend.jaegerQuery.monitorTab.prometheusEndpoint
- description: REDMetricsNamespace defines the a prefix used retrieve span rate,
error, and duration (RED) metrics. By default it is set to `traces.span.metrics`
following the default namespace of the OpenTelemetry Collector since Version
0.109.0.
error, and duration (RED) metrics.
displayName: RED Metric Namespace
path: template.queryFrontend.jaegerQuery.monitorTab.redMetricsNamespace
- description: Resources defines resources for this component, this will override
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ spec: # TempoStackSpec defines the desired st
monitorTab: # MonitorTab defines the monitor tab configuration.
enabled: false # Enabled enables the monitor tab in the Jaeger console. The PrometheusEndpoint must be configured to enable this feature.
prometheusEndpoint: "" # PrometheusEndpoint defines the endpoint to the Prometheus instance that contains the span rate, error, and duration (RED) metrics. For instance on OpenShift this is set to https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
redMetricsNamespace: "traces.span.metrics" # REDMetricsNamespace defines the a prefix used retrieve span rate, error, and duration (RED) metrics. By default it is set to `traces.span.metrics` following the default namespace of the OpenTelemetry Collector since Version 0.109.0.
redMetricsNamespace: "" # REDMetricsNamespace defines the a prefix used retrieve span rate, error, and duration (RED) metrics.
servicesQueryDuration: "" # ServicesQueryDuration defines how long the services will be available in the services list
tempoQuery: # TempoQuery defines options specific to the Tempoo Query component.
resources: # Resources defines resources for this component, this will override the calculated resources derived from total
Expand Down
14 changes: 9 additions & 5 deletions internal/manifests/queryfrontend/query_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,6 @@ func enableMonitoringTab(tempo v1alpha1.TempoStack, jaegerQueryContainer corev1.
// However, we do not intend to support them.
// --prometheus.query.normalize-calls
// --prometheus.query.normalize-duration
//
// NOTE: Jaeger 1.62 default namespace changed to "traces_span_metrics".
// We fallback to no namespace.
// See https://github.com/jaegertracing/jaeger/pull/6007.
fmt.Sprintf("--prometheus.query.namespace=%s", tempo.Spec.Template.QueryFrontend.JaegerQuery.MonitorTab.REDMetricsNamespace),
},
}
// If the endpoint matches Prometheus on OpenShift, configure TLS and token based auth
Expand All @@ -417,6 +412,15 @@ func enableMonitoringTab(tempo v1alpha1.TempoStack, jaegerQueryContainer corev1.
"--prometheus.tls.ca=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt")
}

if tempo.Spec.Template.QueryFrontend.JaegerQuery.MonitorTab.REDMetricsNamespace != nil {
// NOTE: Jaeger 1.62 default namespace changed to "traces_span_metrics".
// Set .spec.template.queryFrontend.jaegerQuery.monitorTab.redMetricsNamespace explicitly to "" to disable the namespace.
// See https://github.com/jaegertracing/jaeger/pull/6007.
container.Args = append(container.Args,
fmt.Sprintf("--prometheus.query.namespace=%s", *tempo.Spec.Template.QueryFrontend.JaegerQuery.MonitorTab.REDMetricsNamespace),
)
}

err := mergo.Merge(&jaegerQueryContainer, container, mergo.WithAppendSlice)
if err != nil {
return corev1.Container{}, err
Expand Down
44 changes: 42 additions & 2 deletions internal/manifests/queryfrontend/query_frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,26 @@ func TestBuildQueryFrontendWithJaegerMonitorTab(t *testing.T) {
},
{
name: "custom prometheus",
tempo: v1alpha1.TempoStack{
Spec: v1alpha1.TempoStackSpec{
Template: v1alpha1.TempoTemplateSpec{
QueryFrontend: v1alpha1.TempoQueryFrontendSpec{
JaegerQuery: v1alpha1.JaegerQuerySpec{
Enabled: true,
MonitorTab: v1alpha1.JaegerQueryMonitor{
Enabled: true,
PrometheusEndpoint: "http://prometheus:9091",
},
},
},
},
},
},
args: []string{"--query.base-path=/", "--span-storage.type=grpc", "--grpc-storage.server=localhost:7777", "--query.bearer-token-propagation=true"},
env: []corev1.EnvVar{{Name: "METRICS_STORAGE_TYPE", Value: "prometheus"}, {Name: "PROMETHEUS_SERVER_URL", Value: "http://prometheus:9091"}},
},
{
name: "custom RED metrics namespace",
tempo: v1alpha1.TempoStack{
Spec: v1alpha1.TempoStackSpec{
Template: v1alpha1.TempoTemplateSpec{
Expand All @@ -623,7 +643,7 @@ func TestBuildQueryFrontendWithJaegerMonitorTab(t *testing.T) {
MonitorTab: v1alpha1.JaegerQueryMonitor{
Enabled: true,
PrometheusEndpoint: "http://prometheus:9091",
REDMetricsNamespace: "test",
REDMetricsNamespace: ptr.To("test"),
},
},
},
Expand All @@ -633,6 +653,27 @@ func TestBuildQueryFrontendWithJaegerMonitorTab(t *testing.T) {
args: []string{"--query.base-path=/", "--span-storage.type=grpc", "--grpc-storage.server=localhost:7777", "--query.bearer-token-propagation=true", "--prometheus.query.namespace=test"},
env: []corev1.EnvVar{{Name: "METRICS_STORAGE_TYPE", Value: "prometheus"}, {Name: "PROMETHEUS_SERVER_URL", Value: "http://prometheus:9091"}},
},
{
name: "disable default RED metrics namespace",
tempo: v1alpha1.TempoStack{
Spec: v1alpha1.TempoStackSpec{
Template: v1alpha1.TempoTemplateSpec{
QueryFrontend: v1alpha1.TempoQueryFrontendSpec{
JaegerQuery: v1alpha1.JaegerQuerySpec{
Enabled: true,
MonitorTab: v1alpha1.JaegerQueryMonitor{
Enabled: true,
PrometheusEndpoint: "http://prometheus:9091",
REDMetricsNamespace: ptr.To(""),
},
},
},
},
},
},
args: []string{"--query.base-path=/", "--span-storage.type=grpc", "--grpc-storage.server=localhost:7777", "--query.bearer-token-propagation=true", "--prometheus.query.namespace="},
env: []corev1.EnvVar{{Name: "METRICS_STORAGE_TYPE", Value: "prometheus"}, {Name: "PROMETHEUS_SERVER_URL", Value: "http://prometheus:9091"}},
},
{
name: "OpenShift user-workload monitoring",
tempo: v1alpha1.TempoStack{
Expand All @@ -658,7 +699,6 @@ func TestBuildQueryFrontendWithJaegerMonitorTab(t *testing.T) {
"--span-storage.type=grpc",
"--grpc-storage.server=localhost:7777",
"--query.bearer-token-propagation=true",
"--prometheus.query.namespace=",
"--prometheus.tls.enabled=true",
"--prometheus.token-file=/var/run/secrets/kubernetes.io/serviceaccount/token",
"--prometheus.token-override-from-context=false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ kind: Job
metadata:
name: generate-traces
status:
conditions:
- status: "True"
type: Complete
succeeded: 1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ kind: Job
metadata:
name: verify-traces-jaeger
status:
conditions:
- status: "True"
type: Complete
succeeded: 1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ kind: Job
metadata:
name: verify-traces-grafana
status:
conditions:
- status: "True"
type: Complete
succeeded: 1
Loading

0 comments on commit d2584ae

Please sign in to comment.