Skip to content

Add lint warning for unused extensions #411

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

Open
garysassano opened this issue Mar 9, 2025 · 0 comments
Open

Add lint warning for unused extensions #411

garysassano opened this issue Mar 9, 2025 · 0 comments

Comments

@garysassano
Copy link

Currently, when an extension is defined but never used, there is no clear warning. To improve usability, the warning message could follow the style of ESLint's unused variable warnings.

Example Configuration

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  batch:

exporters:
  otlp:
    endpoint: otelcol:4317

extensions:
  health_check:
  pprof:
  zpages:

service:
  extensions: [pprof, zpages]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]

Expected Output

warning: 'health_check' is defined but never used. (unused-extension)

This would make it easier to identify unused extensions. I had an issue where I had lots of extensions and I forgot to include one in the service section. I spent half an hour debugging an issue that could have been resolved immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant