Skip to content

Commit

Permalink
Merge pull request #7 from mocyuto/fix-worker-record
Browse files Browse the repository at this point in the history
Fix for some unnessesary records
  • Loading branch information
mocyuto authored Jun 14, 2023
2 parents 0c579ce + 9ce50c8 commit 3eaddda
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Test
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby: ["2.5", "2.6", "2.7", "3.0"]
ruby: ["2.6", "2.7", "3.0", "3.1"]
os:
- ubuntu-latest
- windows-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If `tag` is specified as bufferd chunk key, it send as tag for sentry.

### record keys

- `message`: message body for sentry as events.
- `message` (required): message body for sentry as events.
- `level`: log level for sentry as events.


Expand Down
9 changes: 6 additions & 3 deletions lib/fluent/plugin/out_raven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RavenOutput < Output
helpers :inject

config_param :dsn, :string, default: nil
config_param :environment, :string, default: nil
config_param :environment, :string, default: 'development'
config_param :logger_level, :string, default: 'info'
config_param :default_level, :string, default: 'error'

Expand All @@ -47,12 +47,15 @@ def start

def write(chunk)
tag = chunk.metadata.tag
chunk.each do |_time, record|
chunk
.each do |_time, record|
next if record['message'].nil?

Sentry.capture_message record['message'],
level: record['level'] || @default_level,
tags: {
logger: 'fluent-sentry-logger',
worker: record['worker'],
worker: record['worker'] || Socket.gethostname,
tag: tag
}
end
Expand Down

0 comments on commit 3eaddda

Please sign in to comment.