Skip to content

Commit

Permalink
Move steps to single flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbirnstiehl committed Aug 28, 2024
1 parent 1162b0c commit b7ec4f3
Showing 1 changed file with 51 additions and 28 deletions.
79 changes: 51 additions & 28 deletions docs/configure-upstream-collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,74 @@ Refer to the [guided onboarding](guided-onboarding.md) docs or the [manual confi

Use the Elastic [example configurations](https://github.com/elastic/elastic-agent/tree/main/internal/pkg/otel/samples) as a reference when configuring your upstream collector.

## Build a custom collector for MacOS or Linux
## Build a custom collector

To build a custom collector to collect your telemetry data from a MacOS or Linux system and send it to Elastic Observability, complete the following steps.
To build a custom collector to collect your telemetry data and send it to Elastic Observability, you need to:

### Step 1. Install the OpenTelemetry Collector builder
Install the OpenTelemetry Collector builder (ocb) using the following command:
1. Install the OpenTelemetry Collector builder (ocb).
1. Create a builder configuration file.
1. Build the collector.

Refer to the following sections to complete these steps.

`go install go.opentelemetry.io/collector/cmd/builder@latest
`
### Step 1. Install the OpenTelemetry Collector builder
Install the ocb using the command that aligns with you system from the [OpenTelemetry building a custom collector documentation](https://opentelemetry.io/docs/collector/custom-collector/#step-1---install-the-builder).

### Step 2. Create a builder configuration file
Create a builder configuration file (for example, `builder-config.yml`) that defines your custom collector. This file specifies the components (receivers, exporters, processors, and extensions) included in your custom collector.
Create a builder configuration file,`builder-config.yml`, to define the custom collector. This file specifies the components (extensions, exporters, processors, receivers, and connectors) included in your custom collector.

Refer to the following example `builder-config.yml`:
The following example `builder-config.yml` file contains the components needed to send your telemetry data to Elastic Observability. For more information on these components, refer to the [components](collector-components.md) documentation. Keep or remove components from the example configuration file to fit your needs.

``` yaml
dist:
name: "custom-otel-collector"
description: "Custom OpenTelemetry Collector"
output_path: "./build"

receivers:
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.103.0"
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.103.0"
name: otelcol-dev
description: Basic OTel Collector distribution for Developers
output_path: ./otelcol-dev
otelcol_version: 0.107.0

processors:
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.103.0"
- gomod: "github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor v0.5.1"
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.103.0"
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.103.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: "go.opentelemetry.io/collector/exporter/otlphttpexporter v0.103.0"
- gomod: "go.opentelemetry.io/collector/exporter/loggingexporter v0.103.0"
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.103.0"
- 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
```
### Step 3. Build the Collector
Build your custom collector using the ocb toll and the configuration file by running the following command:
Build your custom collector using the ocb tool and the configuration file by running the following command:
`builder --config builder-config.yml`

This command generates a new collector in the specified output path (for example, ./build). The generated collector includes onnly the components you specified in the configuration file.

## Build a custom collector for Kubernetes
This command generates a new collector in the specified output path, `otelcol-dev`. The generated collector includes the components you specified in the configuration file.

To build a custom collector to collect your telemetry data from a Kubernetes system and send it to Elastic Observability, complete the following steps.
For general information on building a custom collector, refer to the [OpenTelemetry documentation](https://opentelemetry.io/docs/collector/custom-collector/#step-1---install-the-builder).

0 comments on commit b7ec4f3

Please sign in to comment.