Skip to content

Object client scrape configs #2045

@cyriltovena

Description

@cyriltovena

Is your feature request related to a problem? Please describe.
I think it could be interesting to add to Promtail scraping capability from object storage such as s3, gcs, etc..

We already have this abstraction :

// ObjectClient is used to store arbitrary data in Object Store (S3/GCS/Azure/Etc)
type ObjectClient interface {
	PutObject(ctx context.Context, objectKey string, object io.ReadSeeker) error
	GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
	List(ctx context.Context, prefix string) ([]StorageObject, []StorageCommonPrefix, error)
	DeleteObject(ctx context.Context, objectKey string) error
	Stop()
}

And it seems we have everything to list files and store a positions file. Although we could still use the position file to be local ?

Describe the solution you'd like

The configuration could be like this:

scrape_configs:
  - job_name: gcs
    object_storage:
         bucket_name: GCS_BUCKET_NAME
    labels:
      __path__: /foo/**.log

  # Additional labels to assign to the logs
  [ <labelname>: <labelvalue> ... ]

Describe alternatives you've considered

Fluentd but it seems to have struggle with out of order entries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/agentcomponent/integrationshelp wantedWe would love help on these issues. Please come help us!keepaliveAn issue or PR that will be kept alive and never marked as stale.type/featureSomething new we should do

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions