export metrics with fluentd

40 Views Asked by At

I'm new to Fluentd and recently I've been writing a simple configuration for Fluentd. I send access_log from Nginx to Fluentd with a particular format. Then I parse it in Fluentd and expose metrics to a specific port.

So my question is, why doesn't Fluentd remove this data after a specific time? Where does Fluentd save this data?

config file:

<source>
    @type prometheus_tail_monitor
</source>

<source>
  @type prometheus
</source>

<source>
    @type syslog
    port 24224
    tag nginx_access
    <parse>
        @type regexp
        expression /^(?<time>[^ ]* [^ ]* [^ ]*)(?<server_name>\?.+)(?<urt>\S+)$/
        time_key time
        time_format %b %d %H:%M:%S
        types urt:float
    </parse>
</source>

<filter nginx_access.*>
  @type prometheus

  <metric>
    name nginx_http_request_duration_seconds
    type histogram
    desc Histogram of the total time spent on receiving the response from the upstream server.
    key urt
    <labels>
      server_name ${server_name}
    </labels>
  </metric>

</filter>

0

There are 0 best solutions below