Skip to content
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

[Tracking] Context Propagation #1394

Closed
23 of 24 tasks
thisthat opened this issue May 10, 2023 · 1 comment
Closed
23 of 24 tasks

[Tracking] Context Propagation #1394

thisthat opened this issue May 10, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@thisthat
Copy link
Member

thisthat commented May 10, 2023

Goal

Propagate the W3C Trace Context and other metadata across promotion stages via KeptnApp CRDs.

Technical Details

I want to Propagate W3C trace-id across KeptnApp.
Propagate context through the deployment.
Any possible refactor: e.g., split KeptnApp release-matrix from pre-post tasks.

DoD

  • I have a KeptnApp deployed in prod, I want to trace it back from the version that was deployed in dev, passing through hardening.
  • I want to have pre-post tasks added after I started with an auto-discovered KeptnApp
  • I want to attach metadata to the deployment of a KeptnApp and also customize that per-workload. This metadata must be:
    • visible in the Spans as span/event attributes.
    • passed to KeptnTasks and KeptnEvaluations at both: pre/post App and Workload levels.

Example:

kind: KeptnAppContext
name: "my-awesome-app" # this has to be the same value of part-of label
spec:
  preDeploymentTasks:
      - task1
      - task2
  postDeploymentTasks:
      - task1
      - task2
  preDeploymentEvaluations:
      - eval1
      - eval2
  postDeploymentEvaluations:
      - eval1
      - eval2
  metadata:
      - key: value
      - ...
  traceLinks:
    - "w3c trace id1"
    - "w3c trace id2"
--- 
kind: Deployment
spec:
 template:
   annotations:
     traceparent: "w3c parent trace"
     keptn.sh/metadata: "myMetadataKey1=myValue1,myMetadata2=myvalue2,..."
     k8s.io/part-of: my-awesome-app
     keptn.sh/pre-task: mytask1

Problems:

  1. Having a CR with the context could create problems because of:
  • apply order: we could start taking care of a Workload before the Ctx CR is applied
  • different workloads might have different metadata: e.g. gitSHA could differ from each workload
  • Clean-up of old data is tricky since we would need to either edit the same ctx CR or track old versions
  1. Precedence of context between App and Workload

Possible solutions:

  1. Add metadata information to the Workload directly via annotations

    • metadata is customizable per-workload
    • each workload could get linked to a different parent trace if they are bumped individually across stages
    • we maintain 1 writer per-CR
  2. in the case of the same key, workload def wins

KEP

Tasks

  1. chore lifecycle-operator
    prakrit55
  2. geoffrey1330
  3. chore
    odubajDT
  4. lifecycle-operator
    geoffrey1330
  5. lifecycle-operator
    odubajDT
  6. RealAnna
  7. bacherfl
  8. odubajDT
  9. bacherfl
  10. documentation on hold
    thisthat
  11. documentation
    odubajDT
  12. documentation
    RealAnna
  13. documentation
    RealAnna
  14. documentation
    odubajDT
  15. documentation
    StackScribe
  16. documentation
    bacherfl
  17. documentation
    bacherfl
  18. documentation
    RealAnna
  19. documentation
    RealAnna
@thisthat thisthat added the epic label May 10, 2023
@thisthat thisthat added this to the 0.9 milestone May 10, 2023
@thisthat thisthat modified the milestones: 0.9, 0.10 Jun 1, 2023
@heckelmann
Copy link
Contributor

An additional thought on that:

If it would be possible to add an annotation to the deployment manifest like keptn.sh/metadata where I can store additional information (like a commit ID) which is propagated as an environment variable to the tasks, would enable me to use this information to send events to my observability platform and could also be used in the end-2-end trace.

@thisthat thisthat changed the title [Tracking] Context Propagation [Tracking] Context Propagation (wip) Sep 4, 2023
@mowies mowies changed the title [Tracking] Context Propagation (wip) [Tracking] Context Propagation Nov 28, 2023
@mowies mowies added the status: ready-for-refinement Issue is relevant for the next backlog refinment label Nov 28, 2023
@mowies mowies modified the milestones: 0.10, 0.11 Dec 6, 2023
@mowies mowies removed the status: ready-for-refinement Issue is relevant for the next backlog refinment label Dec 13, 2023
@mowies mowies modified the milestones: 0.11, 0.10 Jan 30, 2024
@mowies mowies closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants