Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otelcol.receiver.filelog defaults don't agree #2878

Open
petewall opened this issue Feb 28, 2025 · 0 comments
Open

otelcol.receiver.filelog defaults don't agree #2878

petewall opened this issue Feb 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@petewall
Copy link
Contributor

petewall commented Feb 28, 2025

What's wrong?

Code and docs mismatch.

Steps to reproduce

In the code, otelcol.receiver.filelog's start_at field default to end:
https://github.com/grafana/alloy/blob/main/internal/component/otelcol/receiver/filelog/filelog.go#L119

In the docs, it says it defaults to beginning:
https://github.com/grafana/alloy/blob/main/docs/sources/reference/components/otelcol/otelcol.receiver.filelog.md?plain=1#L44

Looks like the upstream has it default to end, so maybe it's just the doc that needs to be updated.

System information

Ubuntu AMD64

Software version

1.7.1

Configuration

otelcol.receiver.filelog "run_log" {
  include = ["log.txt"]
  start_at = "beginning"
  delete_after_read = true
  attributes = {
    "run_id" = sys.env("RUN_ID"),
  }
  resource = {
    "source" = "github_actions",
    "repository" = sys.env("GITHUB_REPOSITORY"),
    "workflowName" = sys.env("GITHUB_WORKFLOW"),
  }

  output {
    logs = [otelcol.exporter.loki.prep_for_loki.input]
  }
}

Logs

Error: hackathon-action-stat/log-upload.alloy:1:1: Failed to build component: decoding configuration: 1 error occurred:
	* 'delete_after_read' cannot be used with 'start_at = end'
 1 |   otelcol.receiver.filelog "run_log" {
   |  _^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 2 | |   include = ["log.txt"]
 3 | |   delete_after_read = true
 4 | |   attributes = {
 5 | |     "run_id" = sys.env("RUN_ID"),
 6 | |   }
 7 | |   resource = {
 8 | |     "source" = "github_actions",
 9 | |     "repository" = sys.env("GITHUB_REPOSITORY"),
10 | |     "workflowName" = sys.env("GITHUB_WORKFLOW"),
11 | |   }
12 | | 
13 | |   output {
14 | |     logs = [otelcol.exporter.loki.prep_for_loki.input]
15 | |   }
16 | | }
   | |_^
17 |   

@petewall petewall added the bug Something isn't working label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant