Skip to content

Commit

Permalink
Do not add tracing CLI args to opa-openshift container (#1081)
Browse files Browse the repository at this point in the history
The opa-openshift container does not support
`--internal.tracing.endpoint` and remains in a crashloop if
```
spec:
  observability:
    tracing:
      jaeger_agent_endpoint: ...
      sampling_fraction: "1"
```
is enabled.

Signed-off-by: Andreas Gerstmayr <[email protected]>
  • Loading branch information
andreasgerstmayr authored Nov 5, 2024
1 parent e5a8508 commit 474e106
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .chloggen/internal_tracing.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: Fix enabling `.spec.observability.tracing` with multi-tenancy on OpenShift

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

# (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:
7 changes: 5 additions & 2 deletions internal/manifests/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,11 @@ func patchTracing(tempo v1alpha1.TempoStack, pod corev1.PodTemplateSpec) (corev1
}

for i := range pod.Spec.Containers {
if err := mergo.Merge(&pod.Spec.Containers[i], container, mergo.WithAppendSlice); err != nil {
return corev1.PodTemplateSpec{}, err
// Only the observatorium-api container is instrumented with traces, not the opa-openshift container.
if pod.Spec.Containers[i].Name == containerNameTempoGateway {
if err := mergo.Merge(&pod.Spec.Containers[i], container, mergo.WithAppendSlice); err != nil {
return corev1.PodTemplateSpec{}, err
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/manifests/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func TestPatchTracing(t *testing.T) {
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "first",
Name: containerNameTempoGateway,
Args: []string{
"--abc",
},
Expand All @@ -316,7 +316,7 @@ func TestPatchTracing(t *testing.T) {
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "first",
Name: containerNameTempoGateway,
Args: []string{
"--abc",
"--internal.tracing.endpoint=agent:1234",
Expand Down

0 comments on commit 474e106

Please sign in to comment.