You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
otel: add env variable to set agent.monitoring runtime (#11018) (#11148)
* otel: add env variables to enable beats receivers in container * remove ENABLE_BEATS_RECEIVERS, add AGENT_MONITORING_RUNTIME_EXPERIMENTAL * remove policy update from the test * changing test to use local config, read env when fetching default config * add tests for policy override * update test description * update docs (cherry picked from commit d4ec611) Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Copy file name to clipboardExpand all lines: docs/hybrid-agent-beats-receivers.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ https://github.com/elastic/kibana/issues/233186 is implemented. Before that chan
36
36
overrides API can be used to add `_runtime_experimental: "otel"` to the `agent.monitoring` section of the policy.
37
37
See https://support.elastic.dev/knowledge/view/06b69893 for details on the policy overrides API.
38
38
39
+
For the Elastic Agent container images, the `AGENT_MONITORING_RUNTIME_EXPERIMENTAL` environment variable can be set to either `process` or `otel` to override the default runtime used for agent monitoring.
40
+
39
41
Executing the `elastic-agent diagnostics` command in this mode will now produce an `otel-final.yml` file showing the generated
40
42
collector configuration used to run the Beat receivers.
// Monitoring components should use the expected runtime
555
+
assert.Equalf(t, tc.expectedRuntimeName, compRuntime, "expected correct runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
556
+
default:
557
+
// Non-monitoring components should use the default runtime
558
+
assert.Equalf(t, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
559
+
}
560
+
}
561
+
}, 1*time.Minute, 1*time.Second,
562
+
"components did not use expected runtime",
563
+
)
564
+
})
565
+
}
566
+
}
567
+
568
+
// TestContainerCMDAgentMonitoringRuntimeExperimentalPolicy tests that when
569
+
// AGENT_MONITORING_RUNTIME_EXPERIMENTAL is set, the agent.monitoring
570
+
// from the fleet policy takes precedence over the environment variable.
// Monitoring components should use the expected runtime
676
+
assert.Equalf(t, tc.expectedRuntimeName, compRuntime, "unexpected runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
677
+
default:
678
+
// Non-monitoring components should use the default runtime
679
+
assert.Equalf(t, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
0 commit comments