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

feat(new sink): Initial papertrail sink #1835

Merged
merged 4 commits into from
Mar 12, 2020
Merged

Conversation

LucioFranco
Copy link
Contributor

This implements a basic papertrail sink that sends logs via syslog rfc3164.

Closes #1509

Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
}
}

fn encode_event(mut event: crate::Event, pid: u32, encoding: &Encoding) -> Option<Bytes> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems very reasonable for this to return a Result no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since our sinks don't return errors we are forced to handle errors within the sink. I have yet to see an encoding panic in any of our sinks and we use this option trick.

@Hoverbear
Copy link
Contributor

Do you have a test account I can use, or should I make one? :)

@LucioFranco
Copy link
Contributor Author

@Hoverbear you probably want to make one

Copy link
Contributor

@Hoverbear Hoverbear left a comment

Choose a reason for hiding this comment

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

Other than the broken Encoding::Text option it seems functional and documented. :)

@Hoverbear
Copy link
Contributor

Text works fine actually, seems it was just that I missed it.

.meta/sinks/papertrail.toml Show resolved Hide resolved
.meta/sinks/papertrail.toml Show resolved Hide resolved
.meta/sinks/papertrail.toml Show resolved Hide resolved
.meta/sinks/papertrail.toml Outdated Show resolved Hide resolved
examples = ["logs.papertrailapp.com:12345"]
description = "The endpoint to stream logs to."

[sinks.papertrail.options.encoding]
Copy link
Contributor

Choose a reason for hiding this comment

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

This should default to json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not following the reason to make this a default?

Copy link
Contributor

Choose a reason for hiding this comment

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

In #1915 we removed defaults where there was more than one option according to advice from @binarylogic

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be a case by case basis. Clearly Honeycomb should receive structured data. It doesn’t even have full text searching capabilities...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't honeycomb? To me here it totally makes sense to let the user choose since papertrail doesn't takes advantage of the message field in syslog.

According to @Hoverbear we are no longer settings defaults? #1832 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ha, I'm losing my mind. Sure, I think for papertrail it makes sense to require it. For Honeycomb not so much.

.meta/sinks/papertrail.toml Outdated Show resolved Hide resolved
@Hoverbear
Copy link
Contributor

@LucioFranco This PR desires your attention. :)

Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
Copy link
Contributor

@binarylogic binarylogic left a comment

Choose a reason for hiding this comment

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

Nice work! :shipit:

@LucioFranco LucioFranco merged commit 1de3f2f into master Mar 12, 2020
@LucioFranco LucioFranco deleted the lucio/papertrail branch March 12, 2020 15:38
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

Successfully merging this pull request may close these issues.

New papertrail sink
3 participants