Skip to content

Conversation

@Horiodino
Copy link
Contributor

Description: Added additional status information fields for OpenTelemetryCollector sidecar injection.

Link to tracking Issue(s):

Change Type: Enhancement

Component: Collector

Testing: Added unit tests; E2E pending.

Documentation:

Signed-off-by: Praful Khanduri <holiodin@gmail.com>
Signed-off-by: Praful Khanduri <holiodin@gmail.com>
Signed-off-by: Praful Khanduri <holiodin@gmail.com>
@Horiodino
Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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 {
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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>
@Horiodino
Copy link
Contributor Author

Design Doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose status information for OpenTelemetryCollector in mode: sidecar

2 participants