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

logging: use kind-prefixed fields instead of string-formatting #1705

Merged

Conversation

stevekuznetsov
Copy link
Contributor

Signed-off-by: Steve Kuznetsov skuznets@redhat.com

Part of #1694
/assign @sttts

Using the resource instead of the kind would be cool but I don't know that there's any lightweight way to figure that out.

@@ -40,6 +40,8 @@ const (
NamespaceKey = "namespace"
// NameKey is used to specify a name when a log is related to an object.
NameKey = "name"
// APIVersionKey is used to specify an API version when a log is related to an object.
APIVersionKey = "apiVersion"
Copy link
Member

@sttts sttts Aug 8, 2022

Choose a reason for hiding this comment

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

I think we should find short keys for the common ones. ws, ns, v

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I generally disagree ;)

pkg/logging/constants.go Outdated Show resolved Hide resolved
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
@stevekuznetsov
Copy link
Contributor Author

@sttts updated - re: short-names ... any UI (even the CLI ones) for filtering structured logs do autocomplete for you, and I prefer the readability and explicitness of longer names, for variables, flags, etc. If we find ourselves manually typing something a lot I'd investigate why, then maybe fix that, then look into shorter names. We furthermore have the ability to map names to shorter things if we're developing a viewing layer on top anyway.

@sttts
Copy link
Member

sttts commented Aug 9, 2022

Let's merge and learn whether this is what we want.

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 9, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 9, 2022
@stevekuznetsov
Copy link
Contributor Author

wow. unit test flake

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants