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

Ability to define multiple filelog receivers OR apply different tags based on log file #34256

Closed
jamesqo opened this issue Jul 25, 2024 · 3 comments
Labels
question Further information is requested receiver/filelog Stale

Comments

@jamesqo
Copy link

jamesqo commented Jul 25, 2024

Component(s)

cmd/otelcontribcol

Is your feature request related to a problem? Please describe.

I am trying to set up the OpenTelemetry collector to send logs to Datadog using the Datadog exporter. Here is what the relevant portion of my configuration file looks like:

receivers:
  otlp:
    protocols:
      grpc:
  filelog:
    include:
        - /data/portal-cron/logs/validation_utils_py3.json
        - /data/portal-cron/logs/cvr-fetcher.log
    start_at: beginning
    attributes:
      ddtags: host:pipelines3.cbioportal.aws.mskcc.org

This will cause all events sent to Datadog to be tagged with host:pipelines3.cbioportal.aws.mskcc.org. But let's say I only want to apply this tag to events read from cvr-fetcher.log. I don't see an option to do this-- either by defining multiple filelog receivers, or perhaps there is some setting I'm missing? I have looked at the receiver schema here, but I could not find anything.

Describe the solution you'd like

Ability to set up multiple filelog receivers (this fork seems to have that ability, Ctrl+F search "multiple filelog receivers"), or apply ddtags only to specific log files

Describe alternatives you've considered

No response

Additional context

No response

@jamesqo jamesqo added enhancement New feature or request needs triage New item requiring triage labels Jul 25, 2024
Copy link
Contributor

Pinging code owners for receiver/filelog: @djaglowski. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

You can define multiples of any component by adding /name to the component type:

receivers:
  otlp:
    protocols:
      grpc:
  filelog:
    include:
        - /data/portal-cron/logs/validation_utils_py3.json
    start_at: beginning
    attributes:
      ddtags: host:pipelines3.cbioportal.aws.mskcc.org
  filelog/2:
    include:
        - /data/portal-cron/logs/cvr-fetcher.log
    start_at: beginning

Then just refer to each on in your pipelines:

service:
  pipelines:
    logs:
      receivers: [ otlp, filelog, filelog/2 ]
      processors: ...
      exporters: ...

@crobert-1 crobert-1 added question Further information is requested and removed enhancement New feature or request needs triage New item requiring triage labels Aug 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested receiver/filelog Stale
Projects
None yet
Development

No branches or pull requests

5 participants