Skip to content

Sidecar container terminates before the main container and this ends up timing out #4065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paolostancato opened this issue Jun 2, 2025 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@paolostancato
Copy link

Component(s)

collector

What happened?

Description

I have an application running in kubernetes that is instrumented with the otel sdk. I also created a sidecar OTLP collector using the operator, and annotated the deployments I want to be collected. Everything is working fine, only that every time a pod is terminated (usually due to autoscaling activity), the main container takes a couple of seconds to finish while the otc-container terminates almost immediately, which causes a timeout when the main app tries to send the last batch of metrics.

Steps to Reproduce

Deploy an application that takes a few seconds to shutdown, attach a sidecar OTLP collector and terminate the pod.

Expected Result

The otc-container terminates after the main container so this can send all the remaining metrics / spans.

In kubernetes versions newer than 1.29 the sidecar container could be deployed using the sidecar feature instead as a regular container within the pod

Actual Result

The otc-container terminates before the main container and the application times out while trying to send the last batch of metrics

Kubernetes Version

v1.32.5

Operator version

0.124.0

Collector version

0.124.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

Log output

Additional context

No response

@paolostancato paolostancato added bug Something isn't working needs triage labels Jun 2, 2025
@iblancasa
Copy link
Contributor

Adding a crosslink because you mentioned the new sidecar mode: #3356

Although very likely there is a way to fix this with the current sidecar mode (didn't check how but maybe).

@paolostancato
Copy link
Author

Definitely, maybe a configurable delay before shutting down would do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants