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

Add support for providers in components command #11900

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ChrsMark
Copy link
Member

Description

This PR adds support for printing config providers with the components command.

Link to tracking issue

Related to #11570

Testing

Documentation

@ChrsMark
Copy link
Member Author

Sample output

./bin/otelcorecol_linux_amd64 components
buildinfo:
    command: otelcorecol
    description: Local OpenTelemetry Collector binary, testing only.
    version: 0.115.0-dev
receivers:
    - name: nop
      module: go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0
      stability:
        logs: Beta
        metrics: Beta
        traces: Beta
    - name: otlp
      module: go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0
      stability:
        logs: Beta
        metrics: Stable
        traces: Stable
processors:
    - name: batch
      module: go.opentelemetry.io/collector/processor/batchprocessor v0.115.0
      stability:
        logs: Beta
        metrics: Beta
        traces: Beta
    - name: memory_limiter
      module: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0
      stability:
        logs: Beta
        metrics: Beta
        traces: Beta
exporters:
    - name: debug
      module: go.opentelemetry.io/collector/exporter/debugexporter v0.115.0
      stability:
        logs: Development
        metrics: Development
        traces: Development
    - name: nop
      module: go.opentelemetry.io/collector/exporter/nopexporter v0.115.0
      stability:
        logs: Beta
        metrics: Beta
        traces: Beta
    - name: otlp
      module: go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0
      stability:
        logs: Beta
        metrics: Stable
        traces: Stable
    - name: otlphttp
      module: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0
      stability:
        logs: Beta
        metrics: Stable
        traces: Stable
connectors:
    - name: forward
      module: go.opentelemetry.io/collector/connector/forwardconnector v0.115.0
      stability:
        logs-to-logs: Beta
        logs-to-metrics: Undefined
        logs-to-traces: Undefined
        metrics-to-logs: Undefined
        metrics-to-metrics: Beta
        metrics-to-traces: Undefined
        traces-to-logs: Undefined
        traces-to-metrics: Undefined
        traces-to-traces: Beta
extensions:
    - name: memory_limiter
      module: go.opentelemetry.io/collector/extension/memorylimiterextension v0.115.0
      stability:
        extension: Development
    - name: zpages
      module: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0
      stability:
        extension: Beta
providers:
    - name: env
      module: go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0
    - name: file
      module: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0
    - name: http
      module: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0
    - name: https
      module: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0
    - name: yaml
      module: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0

@ChrsMark ChrsMark marked this pull request as ready for review December 16, 2024 14:51
@ChrsMark ChrsMark requested review from mx-psi, evan-bradley and a team as code owners December 16, 2024 14:51
Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrsMark sorry for the delay. I would love to see this merged. Can you please merge main and run make genotelcorecol to update the provider versions in the generated main.go file?

otelcol/command_components.go Outdated Show resolved Hide resolved
@ChrsMark ChrsMark force-pushed the components_cmd_add_providers branch from 5f5c477 to e022af7 Compare January 7, 2025 08:30
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark force-pushed the components_cmd_add_providers branch from e022af7 to 86ecb23 Compare January 7, 2025 08:37
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.67%. Comparing base (ced38e8) to head (8df43e7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11900   +/-   ##
=======================================
  Coverage   91.67%   91.67%           
=======================================
  Files         455      455           
  Lines       24039    24050   +11     
=======================================
+ Hits        22038    22049   +11     
  Misses       1629     1629           
  Partials      372      372           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrsMark
Copy link
Member Author

ChrsMark commented Jan 7, 2025

Thank's for reviewing this @andrzej-stencel! The patch is up to date now.

/cc @mx-psi

@@ -39,6 +39,9 @@ type ResolverSettings struct {
// It is required to have at least one factory.
ProviderFactories []ProviderFactory

// ProviderModules maps provider types to their respective go modules.
ProviderModules map[string]string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR in general LGTM but I don't feel like this is the best place for this field. The resolver does not really use this field. Should this be in otelcol.CollectorSettings maybe?

@ChrsMark ChrsMark force-pushed the components_cmd_add_providers branch from 772f5b9 to 74b548c Compare January 7, 2025 15:31
@ChrsMark ChrsMark force-pushed the components_cmd_add_providers branch 2 times, most recently from 6bb7e8f to 337dadd Compare January 7, 2025 15:35
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark force-pushed the components_cmd_add_providers branch from 337dadd to 6c815b3 Compare January 7, 2025 15:40
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

Successfully merging this pull request may close these issues.

4 participants