Skip to content

EDOT Collector doesn't shut down gracefully when receiving Unix signals #10956

@swiatekm

Description

@swiatekm

When you send SIGINT or SIGTERM to the edot collector, it terminates immediately instead of waiting for component shutdown.

Using the following sample configuration:

receivers:
  nop:
exporters:
  nop:
service:
  telemetry:
    metrics:
      level: none
  pipelines:
    logs:
      receivers: [nop]
      exporters: [nop]

Running

elastic-agent otel -c config.yaml

and then sending a SIGINT, gives the following output:

2025-10-31T14:32:49.919+0100    info    otelconftelemetry/metrics.go:24 Internal metrics telemetry disabled     {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}}
2025-10-31T14:32:49.920+0100    info    builders/extension.go:50        Development component. May change in the future.        {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}, "otelcol.component.id": "elastic_diagnostics", "otelcol.component.kind": "extension"}
2025-10-31T14:32:49.921+0100    info    [email protected]/service.go:222 Starting /opt/Elastic/Agent/elastic-agent...    {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}, "Version": "9.2.0", "NumCPU": 20}
2025-10-31T14:32:49.922+0100    info    extensions/extensions.go:41     Starting extensions...  {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}}
2025-10-31T14:32:49.922+0100    info    extensions/extensions.go:45     Extension is starting...        {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}, "otelcol.component.id": "elastic_diagnostics", "otelcol.component.kind": "extension"}
2025-10-31T14:32:49.923+0100    info    elastic_diagnostics     elasticdiagnostics/extension.go:93      Diagnostics extension started   {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}, "otelcol.component.id": "elastic_diagnostics", "otelcol.component.kind": "extension", "address": "/opt/Elastic/Agent/edot-diagnostics-extension.sock"}
2025-10-31T14:32:49.923+0100    info    extensions/extensions.go:62     Extension started.      {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}, "otelcol.component.id": "elastic_diagnostics", "otelcol.component.kind": "extension"}
2025-10-31T14:32:49.923+0100    info    [email protected]/service.go:245 Everything is ready. Begin running and processing data. {"resource": {"service.instance.id": "0ac77b6a-d737-4e81-8908-66130b40708c", "service.name": "/opt/Elastic/Agent/elastic-agent", "service.version": "9.2.0"}}
^C

What should happen instead, is that the components should shut down gracefully before the program exits. I believe this is because we only handle Windows signals here, and not Unix ones.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions