Skip to content

Sentry Structured Logging for Go #1000

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

Closed
AbhiPrasad opened this issue Apr 22, 2025 · 4 comments · Fixed by #1010
Closed

Sentry Structured Logging for Go #1000

AbhiPrasad opened this issue Apr 22, 2025 · 4 comments · Fixed by #1010
Assignees
Labels
Feature Issue type Go SDK

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Apr 22, 2025

https://develop.sentry.dev/sdk/telemetry/logs/

Sentry is adding support for structured logging. Let's add it to the Go SDK!

  1. Define the logs protocol and log envelope item in the SDK
  2. Add the Public API (SDK options and methods) as per the docs
  3. Add SDK behavior as per docs
  4. Attach default attributes to the SDK as per docs
  5. Instrument popular logging libraries to send logs to Sentry. For Go we should aim to support the libraries we already have docs for:
    a) https://pkg.go.dev/log/slog / https://docs.sentry.io/platforms/go/guides/slog/
    b) https://pkg.go.dev/github.com/sirupsen/logrus / https://docs.sentry.io/platforms/go/guides/logrus/
    c) https://pkg.go.dev/github.com/rs/zerolog / https://docs.sentry.io/platforms/go/guides/zerolog/
  6. Create a GH discussion that contains instructions for setting up the SDK in your repo. Eventually this will be moved into the primary docs. See the JS SDK's GH discussion for inspiration.
@aldy505
Copy link
Contributor

aldy505 commented Apr 23, 2025

One nit: the logging capability should support the io.Writer interface. Since most libraries with logging capabilities only ask that. It should be defaults to INFO or DEBUG level.

@AbhiPrasad
Copy link
Member Author

Can we create follow up issues for logging library support?

We don’t have to work on them now, we can prioritize based on user feedback.

@cleptric
Copy link
Member

@giortzisg called it 😬

@giortzisg
Copy link
Contributor

Opened #1015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue type Go SDK
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants