elastic / opentelemetry

Get started with our Elastic Distros of OpenTelemetry
6 stars 8 forks source link

[Documentation] Build custom collector #5

Open tetianakravchenko opened 2 months ago

tetianakravchenko commented 2 months ago

Similar to https://opentelemetry.io/docs/collector/custom-collector/, but specific to the elastic-agent dependendencies

  1. install ocb
  2. use custom builder-config.yaml
    builder-config.yaml
dist:
  name: otelcol-dev
  description: Basic OTel Collector distribution for Developers
  output_path: ./otelcol-dev
  otelcol_version: 0.107.0

extensions:
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.106.1
  - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.106.1

exporters:
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.106.1
  - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.106.1
  - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.106.1
  - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.106.1

processors:
  - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.106.1
  - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.106.1

receivers:
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver v0.106.1
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.106.1
  - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.106.1

connectors:
  - gomod:  github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.106.1

Note: list of components can be found - https://github.com/elastic/elastic-agent/blob/main/internal/pkg/otel/README.md (except - elasticinframetricsprocessor)

  1. ./ocb --config builder-config.yaml
  2. use binary otelcol-dev/otelcol-dev

cc @mlunadia

mlunadia commented 2 months ago

@mdbirnstiehl FYI

mdbirnstiehl commented 2 months ago

@tetianakravchenko can these efforts be combined with this issue and this PR? Would be great to get any input you have there.