fluent-plugin-newrelic 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa7f85405e5ce666734d15281351981ca8d702e75efafc4b70221a5967c04426
4
- data.tar.gz: cf1c6e0c8d5bb12f5f3c2af3adf05c414eb79ae80b700c70ab606b5ba3235c1c
3
+ metadata.gz: 11df01d6cf7ef5b768dabccfc1d57f0aa7bf3bbd96010ab0d9109b0dae65434e
4
+ data.tar.gz: bd8b44e862c08b809fb7ad08913d679dca2ff13d3029dca8c6c31656fa317676
5
5
  SHA512:
6
- metadata.gz: e543ee72fc1808b59c121b85bc14df698c7eaeb8c762276a806f8171d07beccab88fb246f6d05277fb739602137ee77324013cf6aa87467b7528a8b89c345080
7
- data.tar.gz: d7bcfaf304976556e14b666a5068d6cb16db89f1188712a5964e0ac25a3e5b808bf53144cbf8160bb71272c654ea35d245d395e393d43ad5bc43eabd49bf4d4b
6
+ metadata.gz: 2f5b0a413c051418c0635352cac3bbac7b039c00c4fef14d694cd3a531111e07f85dc9f44d87641b774cc00869a51574e161644b3fc3392c257284e0342aeead
7
+ data.tar.gz: b8da217e0801af5053fad0539680348e5e94eeec56ddf4a67872c63afd968c53647ba2cde5b98424392b2104675298ee62a29e74bbc41d5790a0aad9911c23b7
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug so we can take care of it
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ [NOTE]: # ( ^^ Provide a general summary of the issue in the title above ^^ )
10
+
11
+ ## Description
12
+
13
+ [NOTE]: # ( Describe the problem you're encountering )
14
+ [TIP]: # ( Do NOT share sensitive information, whether personal, proprietary, or otherwise! )
15
+
16
+ ## Expected Behavior
17
+
18
+ [NOTE]: # ( Tell us what you expected to happen )
19
+
20
+ ## [Troubleshooting](https://discuss.newrelic.com/t/troubleshooting-frameworks/108787) or [NR Diag](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) results
21
+
22
+ [NOTE]: # ( Provide any other relevant log data )
23
+ [TIP]: # ( Scrub logs and diagnostic information for sensitive information )
24
+
25
+ ## Steps to Reproduce
26
+
27
+ [NOTE]: # ( Please be as specific as possible )
28
+ [TIP]: # ( Link a sample application that demonstrates the issue )
29
+
30
+ ## Your Environment
31
+
32
+ [TIP]: # ( Include as many relevant details about your environment as possible including the running version of New Relic software and any relevant configurations. )
33
+
34
+ ## Additional context
35
+
36
+ [TIP]: # ( Add any other context about the problem here. For example, relevant community posts, support tickets, screenshots... )
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Community Project header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Project.png)](https://opensource.newrelic.com/oss-category/#community-project)
1
+ [![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
2
2
 
3
3
  # fluent-plugin-newrelic
4
4
 
@@ -86,15 +86,27 @@ Example using License key:
86
86
  Getting your New Relic license key:
87
87
  `https://rpm.newrelic.com/accounts/<ACCOUNT_ID>`
88
88
 
89
+ ## Playground
90
+
91
+ To provide a sandbox environment where you can play with the plugin while development or testing
92
+ we've added a docker-compose environment that would help to run fluend with the plugin and send
93
+ some logs. [More info](playground/README.md)
94
+
95
+ ## Community
96
+
97
+ New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub: [Log forwarding](https://discuss.newrelic.com/tag/log-forwarding)
98
+
99
+
89
100
  **A note about vulnerabilities**
90
101
 
91
102
  As noted in our [security policy](../../security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
92
103
 
93
104
  If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic).
94
105
 
95
- If you would like to contribute to this project, review [these guidelines](https://opensource.newrelic.com/code-of-conduct/).
106
+ If you would like to contribute to this project, **please create a branch directly in this repository** and review [these guidelines](https://opensource.newrelic.com/code-of-conduct/).
96
107
 
97
108
  ## License
109
+
98
110
  newrelic-fluentd-output is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License.
99
111
 
100
112
 
@@ -33,11 +33,15 @@ module Fluent
33
33
  config_param :license_key, :string, :default => nil
34
34
 
35
35
  DEFAULT_BUFFER_TYPE = 'memory'.freeze
36
+ DEFAULT_TIMEKEY = 5
37
+ DEFAULT_TIMEKEY_WAIT = 0
36
38
  MAX_PAYLOAD_SIZE = 1000000 # bytes
37
39
 
38
40
  config_section :buffer do
39
41
  config_set_default :@type, DEFAULT_BUFFER_TYPE
40
- config_set_default :chunk_keys, ['timestamp']
42
+ config_set_default :chunk_keys, ['time']
43
+ config_set_default :timekey, DEFAULT_TIMEKEY
44
+ config_set_default :timekey_wait, DEFAULT_TIMEKEY_WAIT
41
45
  end
42
46
 
43
47
  define_method('log') {$log} unless method_defined?(:log)
@@ -1,3 +1,3 @@
1
1
  module NewrelicFluentdOutput
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -0,0 +1 @@
1
+ NEW_RELIC_API_KEY=REPLACE_WITH_YOUR_API_KEY
@@ -0,0 +1 @@
1
+ .env
@@ -0,0 +1,7 @@
1
+ FROM fluent/fluentd:v1.12-1
2
+
3
+ WORKDIR /usr/share/fluentd
4
+
5
+ USER root
6
+
7
+ RUN fluent-gem install fluent-plugin-newrelic
@@ -0,0 +1,40 @@
1
+ # New Relict Fluentd output plugin playground
2
+
3
+ ## Starting the environment
4
+
5
+ To run the environment first go to `./playground` folder:
6
+
7
+ 1. Copy `.env.example` to `.env` and fill your own New Relic API KEY or LICENSE KEY.
8
+ 2. Run `docker-compose up -d`
9
+
10
+ Thats it, you should have a running docker with latests new relic output plugin version.
11
+
12
+ ## Writing logs
13
+
14
+ Since the file `./testlogs/test.log` are mounted as a volume on the docker instance and
15
+ is being tailed by fluentd you could write some text to the file and it should be picked
16
+ up by fluentd.
17
+
18
+ This command should write a line on the log file and it will reach new relic in a while.
19
+
20
+ `echo "Hello world" >> ./testlogs/test.log`
21
+
22
+ If what you need is send logs every .05s, for example, you can have a big file like
23
+ [1mb of text](https://gist.github.com/khaykov/a6105154becce4c0530da38e723c2330) and
24
+ use some awk magic to send each line with .05s delay.
25
+
26
+ `awk '{print $0; system("sleep .05");}' 1mbofdata.txt >> ./testlogs/test.log`
27
+
28
+ ## Troubleshooting
29
+
30
+ If you need to go inside the container to debug something just run `docker-compose exec fluentd sh`
31
+ and you'll be inside the instance. This is a development image so you'll find that you're
32
+ logged in as root, this allows you to install the tools you need with `apk`. For example
33
+ `apk add vim`.
34
+
35
+ The plugin is located on `/usr/lib/ruby/gems/2.7.0/gems/fluent-plugin-newrelic-{version}`
36
+
37
+ ## More examples
38
+
39
+ For more examples, you could adapt the configurations on [examples](../examples/readme.md)
40
+ to use them with this playground and test whatever you need.
@@ -0,0 +1,23 @@
1
+ <source>
2
+ @type tail
3
+ <parse>
4
+ @type none
5
+ </parse>
6
+ path /testlogs/*
7
+ path_key file
8
+ tag sample.tag
9
+ </source>
10
+
11
+ # Add service_name field to all events ("records") with a Fluentd tag of sample.tag
12
+ <filter sample.tag>
13
+ @type record_transformer
14
+ <record>
15
+ logtype test
16
+ service_name fluentd-test
17
+ </record>
18
+ </filter>
19
+
20
+ # Write sample.tag events to New Relic
21
+ <match sample.tag>
22
+ @type newrelic
23
+ </match>
@@ -0,0 +1,12 @@
1
+ version: "3.0"
2
+
3
+ services:
4
+ fluentd:
5
+ env_file: .env
6
+ build:
7
+ dockerfile: ./Dockerfile
8
+ context: .
9
+ volumes:
10
+ - "./config:/fluentd/etc"
11
+ - "./testlogs/:/testlogs/:rw"
12
+ command: fluentd -c /fluentd/etc/fluent.conf -v
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-newrelic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - New Relic Logging Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2021-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -102,6 +102,7 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".dockerignore"
105
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
105
106
  - ".github/workflows/merge-to-master.yml"
106
107
  - ".github/workflows/pr.yml"
107
108
  - ".github/workflows/repolinter.yml"
@@ -129,6 +130,14 @@ files:
129
130
  - lib/newrelic-fluentd-output/version.rb
130
131
  - merge-to-master-pipeline.yml
131
132
  - newrelic-fluentd-output.gemspec
133
+ - playground/.env.example
134
+ - playground/.gitignore
135
+ - playground/Dockerfile
136
+ - playground/README.md
137
+ - playground/config/fluent.conf
138
+ - playground/docker-compose.yml
139
+ - playground/testlogs/.gitkeep
140
+ - playground/testlogs/test.log
132
141
  - pr-pipeline.yml
133
142
  homepage: https://github.com/newrelic/newrelic-fluentd-output
134
143
  licenses: