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

make str log fields consistent #3247

Merged
merged 8 commits into from
Feb 9, 2024

Conversation

juliaElastic
Copy link
Contributor

What is the problem this PR solves?

// Please do not just reference an issue. Explain WHAT the problem this PR solves here.

Making log fields consistent to make it easier to check the logs.

How does this PR solve the problem?

// Explain HOW you solved the problem in your code. It is possible that during PR reviews this changes and then this section should be updated.

How to test this PR locally

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

Closes #3239

@juliaElastic juliaElastic self-assigned this Jan 31, 2024
@juliaElastic juliaElastic requested a review from a team as a code owner January 31, 2024 16:00
@michel-laterman
Copy link
Contributor

thanks for getting a start on this!

@@ -431,7 +431,7 @@ func runCoordinatorOutput(ctx context.Context, cord Coordinator, bulker bulk.Bul
if err != nil {
s.Err(err).Msg("Policy coordinator failed to add a new policy revision")
} else {
s.Info().Int64("revision_id", p.RevisionIdx).Msg("Policy coordinator added a new policy revision")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed redundant log field (already there in line 429)

@@ -765,8 +766,8 @@ func processPolicy(ctx context.Context, zlog zerolog.Logger, bulker bulk.Bulk, a
defer span.End()
zlog = zlog.With().
Str("fleet.ctx", "processPolicy").
Int64("fleet.policyRevision", pp.Policy.RevisionIdx).
Int64("fleet.policyCoordinator", pp.Policy.CoordinatorIdx).
Int64(dl.FieldRevisionIdx, pp.Policy.RevisionIdx).
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we define these as constants in logger/ecs.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@juliaElastic juliaElastic requested a review from a team February 8, 2024 08:45
@juliaElastic juliaElastic enabled auto-merge (squash) February 9, 2024 08:02
Copy link

@juliaElastic juliaElastic merged commit 144facb into elastic:main Feb 9, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logs consistency
2 participants