Skip to content

Conversation

cahartma
Copy link
Contributor

@cahartma cahartma commented Jul 13, 2024

Description

All app logs in cloudwatch had their stream_name set to default. This was caused by the del(.file) we are putting in each log_type filter. I've created ._internal.file to store the filename and modified the cloudwatch stream_name assignment.
Two small changes, then the remaining files are .toml files for testing.

note: No records are dropped if either of these fields (.file, .message) is not present. I am curious though, what other sinks could have been sending .file previously? other output types?

/cc @Clee2691 @vparfonov
/assign @jcantrill

Links

https://issues.redhat.com/browse/LOG-5807

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 13, 2024
@openshift-ci openshift-ci bot requested review from Clee2691 and vparfonov July 13, 2024 22:15
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 13, 2024

@cahartma: This pull request references LOG-5810 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set.

In response to this:

Description

All app logs in cloudwatch had their stream_name set to default. This was caused by the del(.file) we are putting in each log_type filter. I've created ._internal.file` to store the filename and modified the cloudwatch stream_name assignment.
Two small changes, then the remaining files are .toml files for testing.

note: No records are dropped if either of these fields (.file, .message) is not present. I am curious though, what other sinks could have been sending .file previously? other output types?

/cc @Clee2691 @vparfonov
/assign @jcantrill

Links

https://issues.redhat.com/browse/LOG-5807

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

openshift-ci bot commented Jul 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cahartma

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 Jul 13, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 14, 2024

@cahartma: This pull request references LOG-5810 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set.

In response to this:

Description

All app logs in cloudwatch had their stream_name set to default. This was caused by the del(.file) we are putting in each log_type filter. I've created ._internal.file to store the filename and modified the cloudwatch stream_name assignment.
Two small changes, then the remaining files are .toml files for testing.

note: No records are dropped if either of these fields (.file, .message) is not present. I am curious though, what other sinks could have been sending .file previously? other output types?

/cc @Clee2691 @vparfonov
/assign @jcantrill

Links

https://issues.redhat.com/browse/LOG-5807

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@jcantrill
Copy link
Contributor

jcantrill commented Jul 14, 2024

This is what we did previously and I'm not certain where "file" is needed other then "tag" comes from the source file. File or tag can be replaced by the combination of log_type and log_source.

  if ( .log_type == "application" ) {
   .group_name = ( "` + groupPrefix + `." + .log_type ) ?? "application"
  }
  if ( .log_type == "audit" ) {
   .group_name = "` + groupPrefix + `.audit"
   .stream_name = ( "${VECTOR_SELF_NODE_NAME}" + .tag ) ?? .stream_name
  }
  if ( .log_type == "infrastructure" ) {
   .group_name = "` + groupPrefix + `.infrastructure"
   .stream_name = ( .hostname + "." + .stream_name ) ?? .stream_name
  }

We need to reconsider what our defaults are and probably intialize them accordingly

@cahartma
Copy link
Contributor Author

There are a few lines above that, or you have different code than me:

.stream_name = "default"

if ( .file != null) {
 .stream_name = "kubernetes" + replace!(.file, "/", ".")
}

@jcantrill
Copy link
Contributor

/retest
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2024
@jcantrill
Copy link
Contributor

/refresh

Copy link
Contributor

openshift-ci bot commented Jul 15, 2024

@cahartma: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 7db42af into openshift:master Jul 15, 2024
@cahartma cahartma deleted the LOG-5810-fix-cloudwatch-stream-names branch November 18, 2024 16:29
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants