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

Add name to reconciler logs. #1033

Merged
merged 1 commit into from May 8, 2023

Conversation

smuda
Copy link
Contributor

@smuda smuda commented May 4, 2023

Adds the reconciler log name to the log line.

Closes #1032

@smuda smuda force-pushed the feature/log-per-reconciler branch from b980e1c to 070d009 Compare May 4, 2023 07:25
@NissesSenap
Copy link
Collaborator

@smuda I don't have time to start the container right now.
Can you share an example output with the new vs the old log output.

@smuda
Copy link
Contributor Author

smuda commented May 8, 2023

This is two log lines, compile from master. It is possible to deduct from the content what reconciler is running, but hard to use for example grep to filter out one reconciler.

1.683527186881067e+09	INFO	running stage	{"controller": "grafana", "controllerGroup": "grafana.integreatly.org", "controllerKind": "Grafana", "Grafana": {"name":"grafana","namespace":"default"}, "namespace": "default", "name": "grafana", "reconcileID": "f31ac80d-82a7-4667-b247-cd2045916478", "stage": "admin user"}
1.683527186888025e+09	INFO	found matching Grafana instances for datasource	{"controller": "grafanadatasource", "controllerGroup": "grafana.integreatly.org", "controllerKind": "GrafanaDatasource", "GrafanaDatasource": {"name":"example-grafanadatasource","namespace":"default"}, "namespace": "default", "name": "example-grafanadatasource", "reconcileID": "4c468441-eb7a-4d79-9b73-531b076f2c38", "count": 1}

This is three log lines with the PR applied. Third column is always the name of the reconciler, which makes it easy to filter out with for example grep.

1.683527283574961e+09	INFO	GrafanaReconciler	running stage	{"controller": "grafana", "controllerGroup": "grafana.integreatly.org", "controllerKind": "Grafana", "Grafana": {"name":"grafana","namespace":"default"}, "namespace": "default", "name": "grafana", "reconcileID": "6830ca01-2132-4e33-81bf-d56ed3efe18f", "stage": "admin user"}
1.683527283581293e+09	INFO	GrafanaDashboardReconciler	found matching Grafana instances for dashboard	{"controller": "grafanadashboard", "controllerGroup": "grafana.integreatly.org", "controllerKind": "GrafanaDashboard", "GrafanaDashboard": {"name":"grafana","namespace":"default"}, "namespace": "default", "name": "grafana", "reconcileID": "411ddc9b-b6e8-4ab6-8d52-489ac3540958", "count": 1}
1.683527283581494e+09	INFO	GrafanaDatasourceReconciler	found matching Grafana instances for datasource	{"controller": "grafanadatasource", "controllerGroup": "grafana.integreatly.org", "controllerKind": "GrafanaDatasource", "GrafanaDatasource": {"name":"example-grafanadatasource","namespace":"default"}, "namespace": "default", "name": "example-grafanadatasource", "reconcileID": "c34426fd-03d7-48a8-893b-86abda1aba29", "count": 1}

@smuda smuda force-pushed the feature/log-per-reconciler branch from 070d009 to 8bd6bbb Compare May 8, 2023 06:34
Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

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

LGTM, i can only agree. Thank you

@NissesSenap NissesSenap merged commit 59de076 into grafana:master May 8, 2023
9 checks passed
@smuda smuda deleted the feature/log-per-reconciler branch May 8, 2023 08:24
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.

Specify which reconciler in log
2 participants