Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Add tracing IDs in the status API #3905

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

PetarTodorovv
Copy link
Collaborator

@PetarTodorovv PetarTodorovv commented Jun 5, 2024

Description
I noticed that in the status API we don't have tracing IDs(x-request-id, x-span-id, etc.). There is logic to load them from the context but seems we don't have the necessary middlewares which configure them. In the logs we have only formation-assignment-id and formation-id but they are extracted from the path parameters and added in the logs.

Example:

time="2024-05-30T10:43:55.671018513Z" level=info msg="Deleting formation assignment with ID: \"example-assignment-id\"" component="formationassignment/status_service.go:98:formationassignment.(*formationAssignmentStatusService).DeleteWithConstraints" formation-assignment-id=example-assignment-id formation-id=example-formation-id x-request-id=example-request-id
...
time="2024-05-30T10:43:55.757931815Z" level=debug msg="Executing DB query: DELETE FROM public.formation_assignments WHERE tenant_id = $1 AND id = $2" component="repo/delete.go:203:repo.(*universalDeleter).delete" formation-assignment-id=example-assignment-id formation-id=example-formation-id x-request-id=example-request-id

Changes proposed in this pull request:

  • Add middlewares to the status API router that configure tracing IDs in the context and in the logger.

Related issue(s)

  • ...

Pull Request status

  • Implementation
  • Unit tests
  • Integration tests
  • chart/compass/values.yaml is updated
  • Mocks are regenerated, using the automated script

@PetarTodorovv PetarTodorovv added the 👋 request review Review required label Jun 5, 2024
@PetarTodorovv PetarTodorovv self-assigned this Jun 5, 2024
@PetarTodorovv PetarTodorovv requested review from a team as code owners June 5, 2024 14:41
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 5, 2024
@kyma-bot kyma-bot added the lgtm Looks good to me! label Jun 6, 2024
@kyma-bot
Copy link

kyma-bot commented Jun 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ivantenevvasilev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kyma-bot kyma-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 6, 2024
@PetarTodorovv PetarTodorovv removed 👋 request review Review required do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jun 6, 2024
@ognyvrac ognyvrac added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jun 6, 2024
@kyma-bot kyma-bot merged commit 781f409 into main Jun 6, 2024
6 checks passed
@PetarTodorovv PetarTodorovv deleted the add-tracing-ids-in-status-api branch June 6, 2024 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Looks good to me! size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants