SumoLogic / sumologic-otel-collector

Sumo Logic Distribution for OpenTelemetry Collector
Apache License 2.0
40 stars 38 forks source link

Support configuration thru environment variable #361

Closed mat-rumian closed 1 year ago

mat-rumian commented 2 years ago

It should be possible to configure OTEL Collector thru environment variable. This shouldn't require a lot of development effort - please see AWS Otel Collector solution. Thanks to this functionality we will simplify a lot deployments on the environments like AWS ECS Fargate/EC2.

pmalek-sumo commented 2 years ago

Ideally we'd work to put this in upstream because in order to introduce this into our collector we'd need to copy paste unexported funcs (like getConfigFlag() or getSetFlag() which are used in here which is being used by the code generated with opentelemetry collector builder).

@mat-rumian Are you aware of any issues upstream that tried to track this?

pmm-sumo commented 2 years ago

Since this capability is not available, I believe it's now just a matter of adding documentation @mat-rumian ?

mat-rumian commented 1 year ago

Collector supports configuration via environment variable. E.g.

export VALID_YAML="    receivers:
      otlp:
        protocols:
          grpc:
          http:
    exporters:
      otlp:
        endpoint: "otela-collector.default:4317"
        tls:
          insecure: true
        sending_queue:
          num_consumers: 4
          queue_size: 100
        retry_on_failure:
          enabled: true
    processors:
      batch:
      memory_limiter:
        limit_mib: 400
        spike_limit_mib: 100
        check_interval: 5s
    extensions:
      zpages: {}
      memory_ballast:
        size_mib: 165
    service:
      extensions: [zpages, memory_ballast]
      pipelines:
        traces:
          receivers: [otlp]
          processors: [memory_limiter, batch]
          exporters: [otlp]"

collector cmd line ./otelcol --config=env:VALID_YAML