Skip to content

enhancements for sentry 8 #6

@visualphoenix

Description

@visualphoenix

Hello,

I'm enhancing the plugin for sentry 8.x support. Part of sentry8 support includes some protocol changes.

https://docs.getsentry.com/on-premise/clientdev/attributes

Some of these changes involve sending arrays and hashes. Upstream, fluentd record_transformer (for instance) converts all record values to strings.

Option 1:

<filter **>
    type record_transformer
    enable_ruby
    <record>
        fingerprint ${require 'json' ; ["{{ default }}", "http://example.com/my.url"].to_json}
    </record>
</filter>
def notify_sentry(tag, time, record)
...
    event.fingerprint = JSON.parse(record['fingerprint']) if record['fingerprint']
...

Option 2

<filter **>
    type record_transformer
    enable_ruby
    <record>
        fingerprint ${["{{ default }}", "http://example.com/my.url"]}
    </record>
</filter>

And then we do

def notify_sentry(tag, time, record)
...
    event.fingerprint = eval(record['fingerprint']) if record['fingerprint']
...

I prefer option 1 because eval is evil. But I am unsure if we should force json. Yaml would work too. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions