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

Send GitLab host logs to CloudWatch (#3894) #5187

Merged

Conversation

achave11-ucsc
Copy link
Member

@achave11-ucsc achave11-ucsc commented May 5, 2023

Connected issues: #3894

Checklist

Author

  • PR is a draft
  • Target branch is develop
  • Name of PR branch matches issues/<GitHub handle of author>/<issue#>-<slug>
  • PR title references all connected issues
  • PR title matches1 that of a connected issue or comment in PR explains why they're different
  • For each connected issue, there is at least one commit whose title references that issue
  • PR is connected to all connected issues via ZenHub
  • PR description links to connected issues
  • Added partial label to PR or this PR completely resolves all connected issues

1 when the issue title describes a problem, the corresponding PR
title is Fix: followed by the issue title

Author (reindex, API changes)

  • Added r tag to commit title or this PR does not require reindexing
  • Added reindex label to PR or this PR does not require reindexing
  • Added a (compatible changes) or A (incompatible ones) tag to commit title or this PR does not modify the Azul service API
  • Added API label to connected issues or this PR does not modify the Azul service API

Author (chains)

  • This PR is blocked by previous PR in the chain or this PR is not chained to another PR
  • Added base label to the blocking PR or this PR is not chained to another PR
  • Added chained label to this PR or this PR is not chained to another PR

Author (upgrading)

  • Documented upgrading of deployments in UPGRADING.rst or this PR does not require upgrading
  • Added u tag to commit title or this PR does not require upgrading
  • Added upgrade label to PR or this PR does not require upgrading

Author (operator tasks)

  • Added checklist items for additional operator tasks or this PR does not require additional tasks

Author (hotfixes)

  • Added F tag to main commit title or this PR does not include permanent fix for a temporary hotfix
  • Reverted the temporary hotfixes for any connected issues or the prod branch has no temporary hotfixes for any connected issues

Author (before every review)

  • Rebased PR branch on develop, squashed old fixups
  • Ran make requirements_update or this PR does not touch requirements*.txt, common.mk, Makefile and Dockerfile
  • Added R tag to commit title or this PR does not touch requirements*.txt
  • Added reqs label to PR or this PR does not touch requirements*.txt
  • make integration_test passes in personal deployment or this PR does not touch functionality that could break the IT

Peer reviewer (after requesting changes)

Uncheck the Author (before every review) checklists.

Peer reviewer (after approval)

  • PR is not a draft
  • Ticket is in Review requested column
  • Requested review from primary reviewer
  • Assigned PR to primary reviewer

Primary reviewer (after requesting changes)

Uncheck the before every review checklists. Update the N reviews label.

Primary reviewer (after approval)

  • Actually approved the PR
  • Labeled connected issues as demo or no demo
  • Commented on connected issues about demo expectations or all connected issues are labeled no demo
  • Decided if PR can be labeled no sandbox
  • PR title is appropriate as title of merge commit
  • N reviews label is accurate
  • Moved ticket to Approved column
  • Assigned PR to current operator

Operator (before pushing merge the commit)

  • Checked reindex label and r commit title tag
  • Checked that demo expectations are clear or all connected issues are labeled no demo
  • Squashed PR branch and rebased onto develop
  • Sanity-checked history
  • Pushed PR branch to GitHub
  • Pushed PR branch to GitLab dev and added sandbox label or PR is labeled no sandbox
  • Pushed PR branch to GitLab anvildev or PR is labeled no sandbox
  • Build passes in sandbox deployment or PR is labeled no sandbox
  • Build passes in anvilbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in sandbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in anvilbox deployment or PR is labeled no sandbox
  • Deleted unreferenced indices in sandbox or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Deleted unreferenced indices in anvilbox or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Started reindex in sandbox or this PR does not require reindexing sandbox
  • Started reindex in anvilbox or this PR does not require reindexing sandbox
  • Checked for failures in sandbox or this PR does not require reindexing sandbox
  • Checked for failures in anvilbox or this PR does not require reindexing sandbox
  • Added PR reference to merge commit title
  • Collected commit title tags in merge commit title
  • Moved connected issues to Merged column in ZenHub
  • Pushed merge commit to GitHub

Operator (after pushing the merge commit)

  • Shortened the PR chain or this PR is not labeled base
  • Deployed the dev.gitlab component
  • Pushed merge commit to GitLab dev or PR is labeled no sandbox
  • Deployed the anvildev.gitlab component
  • Pushed merge commit to GitLab anvildev or PR is labeled no sandbox
  • Build passes on GitLab dev1
  • Reviewed build logs for anomalies on GitLab dev1
  • Build passes on GitLab anvildev1
  • Reviewed build logs for anomalies on GitLab anvildev1
  • Deleted PR branch from GitHub
  • Deleted PR branch from GitLab dev
  • Deleted PR branch from GitLab anvildev

1 When pushing the merge commit is skipped due to the PR being
labelled no sandbox, the next build triggered by a PR whose merge commit is
pushed determines this checklist item.

Operator (reindex)

  • Deleted unreferenced indices in dev or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Deleted unreferenced indices in anvildev or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Started reindex in dev or this PR does not require reindexing
  • Started reindex in anvildev or this PR does not require reindexing
  • Checked for and triaged indexing failures in dev or this PR does not require reindexing
  • Checked for and triaged indexing failures in anvildev or this PR does not require reindexing
  • Emptied fail queues in dev deployment or this PR does not require reindexing
  • Emptied fail queues in anvildev deployment or this PR does not require reindexing

Operator

  • Add checklist item to promotion PR 'Deployed the prod.gitlab component'
  • Unassigned PR

Shorthand for review comments

  • L line is too long
  • W line wrapping is wrong
  • Q bad quotes
  • F other formatting problem

@github-actions github-actions bot added the orange [process] Done by the Azul team label May 5, 2023
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch from b1dcea5 to c9f9d78 Compare May 8, 2023 15:49
@achave11-ucsc achave11-ucsc added the upgrade [process] PR includes commit requiring manual upgrade label May 8, 2023
@coveralls
Copy link

coveralls commented May 8, 2023

Coverage Status

Coverage: 84.435%. Remained the same when pulling 89fdaf4 on issues/achave11-ucsc/3894-forward-GL-logs-iCW into 7bbfd89 on develop.

@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Merging #5187 (89fdaf4) into develop (7bbfd89) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #5187   +/-   ##
========================================
  Coverage    84.41%   84.41%           
========================================
  Files          149      149           
  Lines        18305    18305           
========================================
  Hits         15452    15452           
  Misses        2853     2853           

Comment on lines 1593 to 1599
} for path in ['gitaly/gitaly_ruby_json.log',
'gitlab-shell/gitlab-shell.log',
'nginx/gitlab_access.log',
'nginx/gitlab_error.log',
'nginx/gitlab_registry_access.log',
'puma/puma_stderr.log',
'puma/puma_stdout.log']
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
} for path in ['gitaly/gitaly_ruby_json.log',
'gitlab-shell/gitlab-shell.log',
'nginx/gitlab_access.log',
'nginx/gitlab_error.log',
'nginx/gitlab_registry_access.log',
'puma/puma_stderr.log',
'puma/puma_stdout.log']
} for path in [
'gitaly/gitaly_ruby_json.log',
'gitlab-shell/gitlab-shell.log',
'nginx/gitlab_access.log',
'nginx/gitlab_error.log',
'nginx/gitlab_registry_access.log',
'puma/puma_stderr.log',
'puma/puma_stdout.log'
]

Copy link
Contributor

Choose a reason for hiding this comment

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

Also consider removing the .log extension from these entries and moving it to the f-strings above, e.g. "file_path": f'/mnt/gitlab/logs/{path}.log',

"file_path": f'/mnt/gitlab/logs/gitlab-rails/{path}',
"log_group_name": "/aws/cwagent/azul-gitlab",
"log_stream_name": f'/mnt/gitlab/logs/gitlab-rails/{path}'
} for path in ['api_json.log',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments as above

terraform/gitlab/gitlab.tf.json.template.py Fixed Show resolved Hide resolved
'cron',
'maillog',
'messages',
'secure']
Copy link
Contributor

Choose a reason for hiding this comment

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

Same wrapping issue as above

@nadove-ucsc nadove-ucsc removed their assignment May 9, 2023
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch 3 times, most recently from a1e706a to 5cb1176 Compare May 9, 2023 17:19
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch 3 times, most recently from e98ca13 to 40f1b05 Compare May 10, 2023 23:00
Copy link
Contributor

@nadove-ucsc nadove-ucsc left a comment

Choose a reason for hiding this comment

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

I can't find precedent for your solution in the codebase or the contributing guide, but I also can't come up with anything better since my previous suggestions didn't work. We should still be consistent though and there's one place where the line breaks are still inconsistent.

"file_path": f'/mnt/gitlab/logs/{path}.log',
"log_group_name": "/aws/cwagent/azul-gitlab",
"log_stream_name": f'/mnt/gitlab/logs/{path}.log'
} for path in
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency with the other sections

Suggested change
} for path in
}
for path in

@nadove-ucsc nadove-ucsc removed their assignment May 11, 2023
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch from c043736 to f60fcdc Compare May 11, 2023 18:15
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch 2 times, most recently from 0d10bdf to 56f48e8 Compare May 11, 2023 21:58
@achave11-ucsc achave11-ucsc requested a review from nadove-ucsc May 11, 2023 22:24
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch 2 times, most recently from 134180c to 051811d Compare May 24, 2023 21:28
@achave11-ucsc achave11-ucsc requested a review from hannes-ucsc May 25, 2023 17:35
terraform/gitlab/gitlab.tf.json.template.py Show resolved Hide resolved
terraform/gitlab/gitlab.tf.json.template.py Show resolved Hide resolved
Comment on lines 1637 to 1642
'-a', 'fetch-config',
'-m', 'ec2',
'-s',
'-c', 'file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json'
Copy link
Member

Choose a reason for hiding this comment

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

If these options have long versions (--foo) then we should use them here. Any options that aren't self-explanatory—and short ones (-x) usually aren't—should be explained in a short comment.

@hannes-ucsc hannes-ucsc added 3 reviews [process] Lead requested changes thrice and removed 2 reviews [process] Lead requested changes twice labels May 25, 2023
@hannes-ucsc hannes-ucsc removed their assignment May 25, 2023
@achave11-ucsc achave11-ucsc added 2 reviews [process] Lead requested changes twice and removed 3 reviews [process] Lead requested changes thrice labels May 26, 2023
@achave11-ucsc
Copy link
Member Author

@hannes-ucsc: "The de-bump review count because one of my comments was invalid."

@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch from 051811d to 65d3afb Compare May 26, 2023 23:06
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch 2 times, most recently from 29151a4 to c29c8c3 Compare May 26, 2023 23:31
@achave11-ucsc achave11-ucsc requested a review from hannes-ucsc May 27, 2023 00:34
@hannes-ucsc hannes-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch from c29c8c3 to 6bedce5 Compare May 27, 2023 05:06
@achave11-ucsc achave11-ucsc force-pushed the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch from 6bedce5 to 89fdaf4 Compare May 30, 2023 22:36
@achave11-ucsc achave11-ucsc added the sandbox [process] Resolution is being verified in sandbox deployment label May 30, 2023
@achave11-ucsc achave11-ucsc merged commit 0357f29 into develop May 30, 2023
@achave11-ucsc achave11-ucsc deleted the issues/achave11-ucsc/3894-forward-GL-logs-iCW branch May 31, 2023 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 reviews [process] Lead requested changes twice orange [process] Done by the Azul team sandbox [process] Resolution is being verified in sandbox deployment upgrade [process] PR includes commit requiring manual upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants