Skip to content

Commit

Permalink
engine: include metrics exporter just if metrics was enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Sep 29, 2017
1 parent d782d6c commit 5caf35f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
37 changes: 37 additions & 0 deletions include/fluent-bit/flb_metrics_exporter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* Fluent Bit
* ==========
* Copyright (C) 2015-2017 Treasure Data Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef FLB_METRICS_EXPORTER_H
#define FLB_METRICS_EXPORTER_H

#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_config.h>

struct flb_me {
int fd;
struct flb_config *config;
struct mk_event event;

};

int flb_me_fd_event(int fd, struct flb_me *me);
struct flb_me *flb_me_create(struct flb_config *ctx);
int flb_me_destroy(struct flb_me *me);

#endif
3 changes: 3 additions & 0 deletions src/flb_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
#include <fluent-bit/flb_scheduler.h>
#include <fluent-bit/flb_parser.h>
#include <fluent-bit/flb_sosreport.h>

#ifdef FLB_HAVE_METRICS
#include <fluent-bit/flb_metrics_exporter.h>
#endif

#ifdef FLB_HAVE_BUFFERING
#include <fluent-bit/flb_buffer_chunk.h>
Expand Down

0 comments on commit 5caf35f

Please sign in to comment.