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

zapbrake include fields in the Airbrake notice #369

Open
davidoram opened this issue Feb 21, 2023 · 0 comments
Open

zapbrake include fields in the Airbrake notice #369

davidoram opened this issue Feb 21, 2023 · 0 comments

Comments

@davidoram
Copy link

davidoram commented Feb 21, 2023

I'm using the "github.com/airbrake/gobrake/v5/zap" package that allows me to send my zap logs to Airbrake and its working great.

When I call the zap logger, I'm typically passing through some fields like this example:

log.Error("error-msg",
   zap.Error(fmt.Errorf("Boom!")),
   zap.String("keyOne", "valueOne"),
   zap.Int32("keyTwo", 10))

When I look in airbrake thats being delivered with this context:

{
  "architecture": "arm64",
  "component": "<redacted>",
  "environment": "test",
  "gopath": "<redacted>",
  "hostname": "<redacted>",
  "language": "go1.20.1",
  "lastCheckout": {
    "email": "<redacted>",
    "revision": "cb7dbe5c549ca13e0cbbabe8d4400e09cf296bad",
    "time": "2023-02-16T13:40:16+13:00",
    "username": "<redacted>"
  },
  "messageParams": {
    "0": "error-msg"
  },
  "messagePattern": "{}",
  "notifier": {
    "name": "gobrake",
    "url": "https://github.com/airbrake/gobrake",
    "version": "5.6.1"
  },
  "os": "darwin",
  "remoteAddr": "<redacted>",
  "remoteCountry": "New Zealand",
  "remoteCountryCode": "NZ",
  "repository": "<redacted>",
  "revision": "f979edcda27bff4618dcdf6d5a09679973875a83",
  "rootDirectory": "<redacted>",
  "severity": "error"
}

I can see the error-msg coming through inside messageParams, but where is the other fields I sent in the log message, eg the error Boom! and the "keyOne": "valueOne" and "keyTwo": 10 values?

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

No branches or pull requests

1 participant