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

e2e: debug logs for enable/disable, drpc and placement #1814

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

parikshithb
Copy link
Member

@parikshithb parikshithb commented Feb 7, 2025

  • updated logs in EnableProtection and DisableProtection for managed and discovered apps
  • Added debug logs for drpc related function
  • Added debug logs for mcsb and placement related function
  • Replaced zapcore.AddSync with zapcore.Lock to ensure safe concurrent writes to logfile

before/after logs.

Issue #1808

@parikshithb parikshithb marked this pull request as draft February 7, 2025 12:07
@parikshithb parikshithb force-pushed the e2e_enable_disable_log branch from b3ebbcc to 4c3a439 Compare February 7, 2025 16:20
@parikshithb parikshithb changed the title e2e: updated logs for enable/disable actions e2e: debug logs for enable/disable, drpc and placement Feb 7, 2025
@parikshithb parikshithb requested a review from nirs February 7, 2025 16:52
Copy link
Member

@nirs nirs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to log always after the operation was done, but it is better to do incremental change as you did here, so lets focus on:

  • change info level to debug
  • use Debugf for formatting logs
  • use namespace/name to refer to resources
  • log changes e.g. annotation added/removed

When we finish with all logs, we can consider moving logs after the operation.

e2e/dractions/actions.go Outdated Show resolved Hide resolved
e2e/dractions/actions.go Outdated Show resolved Hide resolved
e2e/dractions/actions.go Outdated Show resolved Hide resolved
e2e/dractions/actions.go Outdated Show resolved Hide resolved
e2e/dractions/retry.go Outdated Show resolved Hide resolved
e2e/dractions/retry.go Outdated Show resolved Hide resolved
e2e/dractions/retry.go Outdated Show resolved Hide resolved
e2e/dractions/retry.go Outdated Show resolved Hide resolved
e2e/dractions/retry.go Outdated Show resolved Hide resolved
e2e/deployers/crud.go Outdated Show resolved Hide resolved
Copy link
Member

@nirs nirs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good!

e2e/dractions/actions.go Outdated Show resolved Hide resolved
e2e/deployers/crud.go Show resolved Hide resolved
e2e/dractions/actions.go Show resolved Hide resolved
e2e/dractions/crud.go Outdated Show resolved Hide resolved
e2e/dractions/crud.go Outdated Show resolved Hide resolved
@parikshithb parikshithb force-pushed the e2e_enable_disable_log branch from f9f05ad to 771e8e9 Compare February 13, 2025 08:48
e2e/dractions/crud.go Outdated Show resolved Hide resolved
e2e/dractions/crud.go Outdated Show resolved Hide resolved
e2e/dractions/crud.go Outdated Show resolved Hide resolved
Move/update info logs to debug in EnableProtection DisableProtection for managed
and discovered apps

Signed-off-by: Parikshith <[email protected]>
Add debug logs for Create and delete ManagedClusterSetBinding,
createPlacementManagedByRamen, CreatePlacement and DeletePlacement

Signed-off-by: Parikshith <[email protected]>
@parikshithb parikshithb force-pushed the e2e_enable_disable_log branch from 771e8e9 to 6a668f2 Compare February 13, 2025 17:50
Copy link
Member

@nirs nirs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, but we are missing "Deleted" log for the drpc.

e2e/dractions/crud.go Show resolved Hide resolved
Add debug logs in create, delete, generate and wait drpc funcs

Signed-off-by: Parikshith <[email protected]>
Replace zapcore.AddSync with zapcore.Lock for safe concurrent writes to logfile and console.

Signed-off-by: Parikshith <[email protected]>
@parikshithb parikshithb force-pushed the e2e_enable_disable_log branch from 6a668f2 to f837bbd Compare February 14, 2025 08:29
@parikshithb
Copy link
Member Author

parikshithb commented Feb 14, 2025

After log changes

INFO Level Logs

2025-02-14T14:15:45.204+0530	INFO	appset-deploy-rbd-busybox		Deploying applicationset in namespace "argocd"
2025-02-14T14:15:45.671+0530	INFO	appset-deploy-rbd-busybox		Protecting workload in app namespace "e2e-appset-deploy-rbd-busybox", management namespace: "argocd"
2025-02-14T14:17:56.417+0530	INFO	appset-deploy-rbd-busybox		Failing over workload from cluster "dr1" to cluster "dr2"
2025-02-14T14:21:30.864+0530	INFO	appset-deploy-rbd-busybox		Relocating workload from cluster "dr2" to cluster "dr1"
2025-02-14T14:26:26.962+0530	INFO	appset-deploy-rbd-busybox		Unprotecting workload in app namespace "e2e-appset-deploy-rbd-busybox", management namespace: "argocd"
2025-02-14T14:27:57.242+0530	INFO	appset-deploy-rbd-busybox		Undeploying applicationset in namespace "argocd"

DEBUG Level Logs

2025-02-14T14:15:45.527+0530	DEBUG	appset-deploy-rbd-busybox	deployers/crud.go:62	Created ManagedClusterSetBinding "argocd/default"
2025-02-14T14:15:45.540+0530	DEBUG	appset-deploy-rbd-busybox	deployers/crud.go:118	Created placement "argocd/appset-deploy-rbd-busybox"
2025-02-14T14:15:50.797+0530	DEBUG	appset-deploy-rbd-busybox	dractions/actions.go:50	Workload running on cluster "dr1"
2025-02-14T14:15:50.817+0530	DEBUG	appset-deploy-rbd-busybox	dractions/actions.go:68	Annotated placement "argocd/appset-deploy-rbd-busybox" with "cluster.open-cluster-management.io/experimental-scheduling-disable: true"
2025-02-14T14:15:50.839+0530	DEBUG	appset-deploy-rbd-busybox	dractions/crud.go:67	Created drpc "argocd/appset-deploy-rbd-busybox" with spec:
drPolicyRef:
  name: dr-policy
placementRef:
  kind: placement
  name: appset-deploy-rbd-busybox
preferredCluster: dr1
pvcSelector:
  matchLabels:
    appname: busybox

2025-02-14T14:15:50.952+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:53	Waiting until drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:17:56.378+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:65	drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:17:56.417+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:53	Waiting until drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:17:56.425+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:65	drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:17:56.458+0530	DEBUG	appset-deploy-rbd-busybox	dractions/actions.go:234	Updated drpc "argocd/appset-deploy-rbd-busybox" with action "Failover" to target cluster "dr2"
2025-02-14T14:17:56.458+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:89	Waiting until drpc "argocd/appset-deploy-rbd-busybox" reach phase "FailedOver"
2025-02-14T14:18:26.725+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:99	drpc "argocd/appset-deploy-rbd-busybox" phase is "FailedOver"
2025-02-14T14:18:26.725+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:53	Waiting until drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:21:30.642+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:65	drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:21:30.864+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:53	Waiting until drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:21:30.881+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:65	drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:21:30.992+0530	DEBUG	appset-deploy-rbd-busybox	dractions/actions.go:234	Updated drpc "argocd/appset-deploy-rbd-busybox" with action "Relocate" to target cluster "dr1"
2025-02-14T14:21:30.992+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:89	Waiting until drpc "argocd/appset-deploy-rbd-busybox" reach phase "Relocated"
2025-02-14T14:26:26.935+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:99	drpc "argocd/appset-deploy-rbd-busybox" phase is "Relocated"
2025-02-14T14:26:26.936+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:53	Waiting until drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:26:26.962+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:65	drpc "argocd/appset-deploy-rbd-busybox" is ready
2025-02-14T14:26:27.005+0530	DEBUG	appset-deploy-rbd-busybox	dractions/crud.go:97	Deleted drpc "argocd/appset-deploy-rbd-busybox"
2025-02-14T14:26:27.005+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:150	Waiting until drpc "argocd/appset-deploy-rbd-busybox" is deleted
2025-02-14T14:27:57.242+0530	DEBUG	appset-deploy-rbd-busybox	dractions/retry.go:156	drpc "argocd/appset-deploy-rbd-busybox" is deleted
2025-02-14T14:27:57.302+0530	DEBUG	appset-deploy-rbd-busybox	deployers/crud.go:141	Deleted placement "argocd/appset-deploy-rbd-busybox"
2025-02-14T14:27:57.347+0530	DEBUG	appset-deploy-rbd-busybox	deployers/crud.go:85	Deleted ManagedClusterSetBinding "argocd/default"

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.

2 participants