Code Monkey home page Code Monkey logo

oci-logan-fluentd-output-plugin's Introduction

OCI Logging Analytics Fluentd Output Plugin

Overview

OCI Logging Analytics Fluentd output plugin collects event logs, buffer into local file system, periodically creates payload and uploads it to OCI Logging Analytics.

Installation Instructions

Prerequisites

Refer Prerequisites

Requirements

fluent-plugin-oci-logging-analytics fluentd ruby rubyzip oci prometheus-client yajl-ruby
>= 2.0.0 >= 0.14.10, < 2 >= 2.6 ~> 2.3.2 ~> 2.16 ~> 2.1.0 ~>1.4.3

Installation

Add this line to your application's Gemfile:

gem 'fluent-plugin-oci-logging-analytics'

And then execute:

$ bundle

Or install it manually as:

$ gem install fluent-plugin-oci-logging-analytics --no-document
# If you need to install specific version, use -v option

Configuration

Output Plugin Configuration

Buffer Configuration

Advantages of 'file' based Buffer plugin

- In case of a fast input plugin and slow output plugin, buffer will keep on increase and file based buffer with default 50GB (can configure for higher value) can handle the output plugin delay. 
  We may not have huge memory configured for memory based plugin and will result in data loss.

- In case of back-end service not available (5XX exceptions), output plugin will keep retrying with the existing chunk and meanwhile, new chunks will be keep on getting scheduled. 
  Each chunk being 2MB size, and with chunk interval 30 sec, in case of a 30 mins outage (can be more in unforeseen cases), we need a minimum of 120MB memory allocated for memory buffer.

- In any container based logging analytics, as the logs are not saved in the containers and they are completely lost in case not consumed, file based memory provides a persistent buffer implementation.

- For container based deployments, while creating the fluentd config file, we need to consider all these edge cases and proper sizing to come up with the memory size.

- As the data loss is very critical and not all customers are aware of these cases, we prevented memory buffer. Having said that, we can go ahead and remove that limitation and let the informed customers like you can do the proper sizing and decide which option is helpful for them.

Input Plugin Configuration

The incoming log events must be in a specific format so that the Fluentd plugin provided by Oracle can process the log data, chunk them, and transfer them to OCI Logging Analytics.

Filter Configuration

Use filter plugin (record_transformer) to transform the input log events to add OCI Logging Analytics specific fields/metadata.

Examples

  • Example configuration that can be used for monitoring syslog log

  • Example configuration that can be used for monitoring apache error log

  • Example configuration that can be used for monitoring kafka log

Start Viewing the Logs in Logging Analytics

Refer Viewing the Logs in Logging Analytics

Metrics

The plugin emits following metrics in Prometheus format, which provides stats/insights about the data being collected and processed by the plugin. Refer monitoring-prometheus for details on how to expose these and other various Fluentd metrics to Prometheus (If the requirement is to collect and monitor core Fluentd and this plugin metrics alone using Prometheus then Step1 and Step2 from the referred document can be skipped).

Note

For prometheus metrics to work properly, please add 'tag' and 'worker_id' (in case of multi worker configuration) to the filter block.

tag ${tag}
worker_id ${ENV['SERVERENGINE_WORKER_ID']}

Metrics details

Metric Name: oci_la_fluentd_output_plugin_records_received 
labels: [:worker_id,:tag,:oci_la_log_group_id,:oci_la_log_source_name,:oci_la_log_set]
Description: Number of records received by the OCI Logging Analytics Fluentd output plugin.
Type : Gauge

Metric Name: oci_la_fluentd_output_plugin_records_valid 
labels: [:worker_id,:tag,:oci_la_log_group_id,:oci_la_log_source_name,:oci_la_log_set]
Description: Number of valid records received by the OCI Logging Analytics Fluentd output plugin.
Type : Gauge 

Metric Name: oci_la_fluentd_output_plugin_records_invalid 
labels: [:worker_id,:tag,:oci_la_log_group_id,:oci_la_log_source_name,:oci_la_log_set,:reason]
Description: Number of invalid records received by the OCI Logging Analytics Fluentd output plugin. 
Type : Gauge

Metric Name: oci_la_fluentd_output_plugin_records_post_error 
labels: [:worker_id,:tag,:oci_la_log_group_id,:oci_la_log_source_name,:oci_la_log_set,:error_code, :reason]
Description: Number of records failed posting to OCI Logging Analytics by the Fluentd output plugin.
Type : Gauge
    
Metric Name: oci_la_fluentd_output_plugin_records_post_success 
labels: [:worker_id,:tag,:oci_la_log_group_id,:oci_la_log_source_name,:oci_la_log_set]
Description: Number of records posted by the OCI Logging Analytics Fluentd output plugin. 
Type : Gauge  

Metric Name: oci_la_fluentd_output_plugin_chunk_time_to_receive
labels: [:worker_id,:tag]
Description: Average time taken by Fluentd to deliver the collected records from Input plugin to OCI Logging Analytics output plugin.
Type : Histogram  

Metric Name: oci_la_fluentd_output_plugin_chunk_time_to_post 
labels: [:oci_la_log_group_id]
Description: Average time taken for posting the received records to OCI Logging Analytics by the Fluentd output plugin.
Type : Histogram

FAQ

See FAQ.

Changes

See CHANGELOG.

License

Copyright (c) 2021, 2022 Oracle and/or its affiliates.

See LICENSE for more details.

oci-logan-fluentd-output-plugin's People

Contributors

kgvarun avatar kirannadupuru avatar santhoshkvuda avatar shivamshishodia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

oci-logan-fluentd-output-plugin's Issues

Debugging Information

Hello,

I've previously used the OCI Logging plugin for FluentD.

I am having some trouble using this particular plugin and there doesn't seem to be any feed back from the plugin itself.
I have a FluentD docker instance that has managed sending data to a file.
Trying to send data to an OLA endpoint I can see the tcpdump -i any command making some DNS queries in the FluentD container, but nonetheless I don't see any data in OLA.

Is there any way to enable any kind of logs like in the OCI Logging plugin? Hopefully showing something akin to:
image

Here you can see that a payload was sent and 200 response code was received back. Is there any such mechanism for OLA?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.