Skip to content

New component: prometheustextfilereceiver #39213

Open
@michael-burt

Description

@michael-burt

The purpose and use-cases of the new component

I would like to propose a new component, Prometheus Textfile Receiver. This component would provide functional parity with the Node Exporter textfile collector.

Node Exporter provides a textfile collector that scrapes metrics stored in text files ending in the .prom file extension. It is configured to find all files in configured directories. The Prometheus Textfile receiver would work the same way. You would configure it with a list of directories to search for .prom files. It would not recursively look into subdirectories.

In addition to metrics found in .prom files, Node Exporter emits two additional metrics:

  • node_textfile_mtime_seconds - how much time has elapsed since the last modification to a discovered .prom file
  • node_textfile_scrape_error - were any errors encountered while scraping the static files

Prometheus Textfile Receiver would emit one additional metric: prometheustextfile.file.mtime which would provide the same functionality provided by node_textfile_mtime_seconds. The bundled scrape error metrics provided by OpenTelemetry Collector would cover the functionality provided by node_textfile_scrape_error.

Example configuration for the component

receivers:
  prometheustextfile:
    directories: 
      - /absolute/path/
      - /additional/path

Configured directories can end in either / or not, both will be accepted

Telemetry data types supported

Metrics are supported

Code Owner(s)

@michael-burt

Sponsor (optional)

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Sponsor NeededNew component seeking sponsor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions