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

drtprod: emit audit logs for drt-chaos #126601

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

sudomateo
Copy link
Contributor

This patch updates the Fluent Bit configuration for DRT clusters to emit audit logs. This is only configured for the drt-chaos cluster for now, but can easily be expanded to other clusters in the future.

This patch also updates the way Fluent Bit sets the hostname on logs since Fluent Bit has not cut a release that contains the fix for fluent/fluent-bit#8971.

Finally, this patch also fixes an issue with the Datadog agent configuration removal throwing a shell error.

Epic: CLOUDOPS-9609

Release note: None

This patch updates the Fluent Bit configuration for DRT clusters to emit
audit logs. This is only configured for the `drt-chaos` cluster for now,
but can easily be expanded to other clusters in the future.

This patch also updates the way Fluent Bit sets the hostname on logs
since Fluent Bit has not cut a release that contains the fix for
fluent/fluent-bit#8971.

Finally, this patch also fixes an issue with the Datadog agent
configuration removal throwing a shell error.

Epic: CLOUDOPS-9609

Release note: None
@sudomateo sudomateo requested a review from a team as a code owner July 3, 2024 02:21
@sudomateo sudomateo requested review from DarrylWong and renatolabs and removed request for a team July 3, 2024 02:21
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -71,6 +70,7 @@ func Install(ctx context.Context, l *logger.Logger, c *install.SyncedCluster, co
DatadogSite: config.DatadogSite,
DatadogAPIKey: config.DatadogAPIKey,
DatadogService: config.DatadogService,
Hostname: vm.Name(c.Name, int(node)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

What will these hostnames look like? Hopefully globally unique?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The format is CLUSTER-HOST. For example drt-large-0001, drt-large-0002, etc. Technically not globally unique, but roachprod doesn't allow you to create multiple clusters of the same name.

apikey: ${dd_api_key}
dd_source: audit
dd_service: drt-cockroachdb
dd_tags: env:development,cluster:${cluster%:*},service:drt-cockroachdb,team:drt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remind me what ${...%:*} means in bash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It removes everything from : to the end of the string. For example, given cluster=drt-large:1 then ${cluster%:*} will evaluate to drt-large. Operators can pass entire clusters (e.g., drt-large) or specific hosts (e.g., drt-large:1) to roachprod commands. This just gives us a clean, but admittedly obscure, way to retrieve the cluster name regardless of how the commands are run.

Copy link
Collaborator

@jmcarp jmcarp left a comment

Choose a reason for hiding this comment

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

I have a few non-blocking questions for curiosity. LGTM.

@sudomateo
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 26, 2024

This PR was included in a batch that was canceled, it will be automatically retried

@craig craig bot merged commit b97a858 into cockroachdb:master Jul 26, 2024
22 checks passed
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.

3 participants