-
Notifications
You must be signed in to change notification settings - Fork 588
Expose addtional status for open telemetry collector #4479
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
base: main
Are you sure you want to change the base?
Expose addtional status for open telemetry collector #4479
Conversation
Signed-off-by: Praful Khanduri <holiodin@gmail.com>
Signed-off-by: Praful Khanduri <holiodin@gmail.com>
Signed-off-by: Praful Khanduri <holiodin@gmail.com>
|
I’ve added some Todos and could use some help. Are any fields missing, or are all the necessary ones included? I’m happy to hear any suggestions. |
| - `LastInjectionTime`: Timestamp of the last successful sidecar injection | ||
| - `LastInjectionError`: Error message from the last failed sidecar injection | ||
| - `InjectionStatus`: Status of the sidecar injection process | ||
| - `ObservedGeneration`: Last observed generation of the OpenTelemetryCollector resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this already included somewhere in the CR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specifically for the sidecar for the spec fields , are you refering that injection-related fields LastInjectionTime, LastInjectionError, InjectionStatus probably be expressed through the Conditions? Or Redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @pavolloffay, when you get a moment, could you please take a look at this.
| } | ||
|
|
||
| // updateSidecarStatus gathers information about sidecar injection and updates the status fields. | ||
| func updateSidecarStatus(ctx context.Context, cli client.Client, otelcol *v1beta1.OpenTelemetryCollector) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe at a high level how the status is set?
It seems that the impl is getting a list of pods from the NS of the otelcol CR. I have two observations:
- the sidecar can be injected in a namespace that does not contain any otelcol CR
- is the reconciliation triggered when the pod is deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the reconciliation triggered when the pod is deleted?
Oops i missed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe at a high level how the status is set?
It seems that the impl is getting a list of pods from the NS of the otelcol CR. I have two observations:
* the sidecar can be injected in a namespace that does not contain any otelcol CR * is the reconciliation triggered when the pod is deleted?
The operator now updates the sidecar status by watching all pod events.
During each reconciliation, it lists every pod in the cluster (controller specific) , looks for pods that request a sidecar, and checks three things for each one:
did the pod ask for a sidecar?
does it actually have the injected container, and
did any error occur during injection?
Based on this, it fills status fields like how many pods got the sidecar, whether injection succeeded or failed....
Signed-off-by: Praful Khanduri <holiodin@gmail.com> updated bundle & docs Signed-off-by: Praful Khanduri <holiodin@gmail.com>
Description: Added additional status information fields for OpenTelemetryCollector sidecar injection.
Link to tracking Issue(s):
OpenTelemetryCollectorinmode: sidecar#4313Change Type: Enhancement
Component: Collector
Testing: Added unit tests; E2E pending.
Documentation: