mackerelio / fluent-plugin-mackerel Goto Github PK
View Code? Open in Web Editor NEWFluent plugin to send metrics to mackerel.io
License: Other
Fluent plugin to send metrics to mackerel.io
License: Other
When shutdown fluentd, this plugin recieve fluentd's lifecycle event
as metrics 😅
2017-11-30 08:56:40 +0000 [info]: #0 fluent/log.rb:316:info: shutting down fluentd worker worker=0
2017-11-30 08:56:40 +0000 [debug]: #0 fluent/log.rb:296:debug: calling stop on input plugin type=:tail plugin_id="object:2aad56dd1e08"
2017-11-30 08:56:40 +0000 [debug]: #0 fluent/log.rb:296:debug: calling stop on output plugin type=:copy plugin_id="object:2aad56a60cc4"
2017-11-30 08:56:40 +0000 [debug]: #0 fluent/log.rb:296:debug: calling stop on output plugin type=:datacounter plugin_id="object:2aad56dd0e7c"
2017-11-30 08:56:40 +0000 [debug]: #0 fluent/log.rb:296:debug: calling stop on filter plugin type=:stdout plugin_id="object:2aad56a330a8"
2017-11-30 08:56:40 +0000 [debug]: #0 fluent/log.rb:296:debug: calling stop on output plugin type=:mackerel plugin_id="object:2aad56664cd8"
2017-11-30 08:56:40 +0000 [debug]: #0 fluent/log.rb:296:debug: out_mackerel: stopped?
2017-11-30 08:56:40 +0000 [error]: #0 fluent/log.rb:356:error: out_mackerel: error_class=RuntimeError error="POST /api/v0/services/some-service/tsdb failed: 400 Invalid parameter"
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/log.rb:336:warn: unexpected error while calling stop on output plugin plugin=Fluent::Plugin::MackerelOutput plugin_id="object:2aad56664cd8" error_class=RuntimeError error="POST /api/v0/services/some-service/tsdb failed: 400 Invalid parameter"
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/mackerel-client-0.4.0/lib/mackerel/api_command.rb:49:in `check_status'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/mackerel-client-0.4.0/lib/mackerel/api_command.rb:36:in `execute'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/mackerel-client-0.4.0/lib/mackerel/metric.rb:30:in `post_service_metrics'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluent-plugin-mackerel-1.1.0/lib/fluent/plugin/out_mackerel.rb:173:in `send'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:205:in `block (2 levels) in shutdown'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:154:in `block (2 levels) in lifecycle'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:153:in `each'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:153:in `block in lifecycle'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:140:in `each'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:140:in `lifecycle'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:202:in `block in shutdown'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/root_agent.rb:256:in `shutdown'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/engine.rb:278:in `shutdown'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/engine.rb:247:in `run'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/supervisor.rb:774:in `run_engine'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/supervisor.rb:523:in `block in run_worker'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/supervisor.rb:699:in `main_process'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/supervisor.rb:518:in `run_worker'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/lib/fluent/command/fluentd.rb:316:in `<top (required)>'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.25/bin/fluentd:8:in `<top (required)>'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/bin/fluentd:22:in `load'
2017-11-30 08:56:40 +0000 [warn]: #0 fluent/root_agent.rb:153:each: /usr/bin/fluentd:22:in `<main>'
Probably the cause is Fluent::Plugin::MackerelOutput#send
🤗
https://github.com/fluent/fluentd/blob/v0.14.25/lib/fluent/root_agent.rb#L205
service metrics doesn't need custom
prefix, but current fluent-plugin-mackerel add prefix custom
without no exception.
We should implement any config_param
to prevent to add custom
prefix for service metrics.
抜粋になります。
<source>
type cloudwatch
tag cloudwatch-latency-XXXX.FUGAFUGA
cw_endpoint monitoring.us-west-1.amazonaws.com
namespace AWS/ELB
metric_name Latency
dimensions_name LoadBalancerName
dimensions_value <ELB-NAME>
interval 60
period 60
</source>
<source>
type cloudwatch
tag cloudwatch-status-XXXX.FUGAFUGA
cw_endpoint monitoring.us-west-1.amazonaws.com
namespace AWS/ELB
statistics Sum
metric_name HTTPCode_Backend_2XX,HTTPCode_Backend_3XX,HTTPCode_Backend_4XX,HTTPCode_Backend_5XX,RequestCount
dimensions_name LoadBalancerName
dimensions_value <ELB-NAME>
interval 60
period 60
</source>
<match cloudwatch-status-XXXX.*>
type copy
<store>
type mackerel
api_key <API-KEY>
service <SERVICE-NAME>
metrics_name ${[1]}-status.${out_key}
out_keys HTTPCode_Backend_2XX,HTTPCode_Backend_3XX,HTTPCode_Backend_4XX,HTTPCode_Backend_5XX
</store>
<store>
type mackerel
api_key <API-KEY>
service <SERVICE-NAME>
metrics_name ${[1]}-count.${out_key}
out_keys RequestCount
</store>
</match>
<match cloudwatch-latency-XXXX.*>
type mackerel
api_key <API-KEY>
service <SERVICE-NAME>
metrics_name ${[1]}-latency.${out_key}
out_keys Latency
</match>
こんな感じの設定が5個ぐらい存在して、その一つだけ
こんなふうに、最初のstoreエントリにまるっとまとまってしまう現象が起きています。
設定が悪いのかもしれませんが、ちょっと追った感じはわからず。。。
<match cloudwatch-latency-XXXX.*>
こちら側は普通に見れてます。
すいません。
Thank you for creating and maintaining great gem.
We Mackerel development team want to maintain this gem with you.
So, could you try following steps?
% gem owner fluent-plugin-mackerel -a '[email protected]'
You can transfer repository from setting tab right hand, but you might not transfer repository directly to mackerelio organization because of permission level.
If so, could you transfer the repo to me(Songmu)?
Thanks for your cooperation!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.