Skip to content

Add Skep to your own Collector

If you already build your own OpenTelemetry Collector, keep it. Add Skep’s two components to your build and a few lines to your configuration. Nothing else in your collector changes: the observers are read only and add no exporters.

  • skepobserver is a processor. It summarizes what passes through the pipeline and never changes, drops or delays it.
  • skepcontrol is an extension. It registers the collector with Skep and uploads the observer’s summaries. It is the only part that talks to the network.
  • A Collector you build with the OpenTelemetry Collector Builder (ocb).
  • Your other components on Collector core v0.161.0, the release the Skep components are built against.
  • A copy of the Skep source. The module (github.com/skephq/skep) is not published to a public Go module proxy, so your build points at a checked out or vendored copy.
  • A collector key (skc_...). The install flow creates one. See What you need first.
  • The collector can reach Skep over HTTPS.
  1. In Skep, open Collectors, then Add collector. On a new organization, Home shows the same choices.
  2. Choose Connect your first collector.
  3. Answer Does it already tail sample? With Yes, it runs tail_sampling, Skep adds one observer before your sampler and one after it.
  4. Select Create collector key. The key is filled into the commands.

The guide gives you two files: builder-config.yaml (additions to your ocb manifest) and skep-config.yaml (additions to your collector configuration).

  1. Add both components to your ocb manifest, next to your existing ones. Point replaces at your copy of the Skep source (absolute paths, or relative to dist.output_path), so Go never fetches the module:

    processors:
    - gomod: github.com/skephq/skep/collector v0.1.0
    import: github.com/skephq/skep/collector/processor/skepobserver
    extensions:
    - gomod: github.com/skephq/skep/collector v0.1.0
    import: github.com/skephq/skep/collector/extension/skepcontrol
    replaces:
    - github.com/skephq/skep/collector => /src/skep/collector
    - github.com/skephq/skep/pkg => /src/skep/pkg
  2. Rebuild your collector.

    Terminal window
    builder --config builder-config.yaml

    To be sure the build used your copy and nothing was fetched, build with GOPRIVATE=github.com/skephq. A fetch then fails instead of reaching a proxy. Check that both components are in the binary with <your-collector> components.

  1. Make the collector key available to the collector process: in its systemd unit, container environment or Kubernetes Secret.

    Terminal window
    export SKEP_API_KEY=skc_...
    export SKEP_COLLECTOR_NAME=production-collector
  2. Merge skep-config.yaml into your configuration. Keep your receivers, exporters and other processors. Only the parts marked Skep are new:

    extensions:
    # Skep: registration, policy snapshots and observation upload.
    skepcontrol:
    endpoint: https://app.skep.observer
    api_key: ${env:SKEP_API_KEY}
    environment: production
    name: ${env:SKEP_COLLECTOR_NAME:-production-collector}
    # Keeps the collector's identity across restarts; any writable directory.
    state_dir: /var/lib/skep-otelcol
    processors:
    # Skep: observe what exists, before your sampler.
    skepobserver/pre:
    position: pre_sampling
    control_extension: skepcontrol
    # Skep: observe what your backend receives, after your sampler.
    skepobserver/post:
    position: post_sampling
    control_extension: skepcontrol
    service:
    extensions: [skepcontrol] # plus your existing extensions
    pipelines:
    traces:
    processors: [memory_limiter, skepobserver/pre, tail_sampling, skepobserver/post]
    metrics:
    processors: [memory_limiter, skepobserver/pre]
    logs:
    processors: [memory_limiter, skepobserver/pre]

    Without tail sampling there is no skepobserver/post, and every pipeline gets [memory_limiter, skepobserver/pre] plus your own processors.

  3. Restart your collector. It registers with Skep on start and uploads its first observations within a minute.

  • Put skepobserver/pre early in every pipeline, right after memory_limiter, which stays first.
  • With tail sampling, put skepobserver/pre before tail_sampling and skepobserver/post after it. Skep compares the two to show what sampling costs your questions.
  • Batch in your exporters’ sending_queue rather than with a batch processor. A batch processor before the observer hides the x-skep-observed request header from it, and Skep then cannot tell what an earlier tier already counted.
  • The guide’s last step, Wait for it to register, checks every 3 seconds. It shows the collector’s name (by default <environment>-collector), its status and its observer positions when it registers.
  • The collector’s log shows skepcontrol: registered with control plane.
  • Collectors lists it as online. Services appear in Data within about a minute.
  • ocb tries to download github.com/skephq/skep. The replaces paths are wrong. They are absolute, or relative to dist.output_path, and must point at the collector and pkg directories of your copy.
  • The build fails on module versions. Keep your other components on Collector core v0.161.0.
  • The collector fails to start with an unknown component. The binary you run is not the one you rebuilt. Check with <your-collector> components.
  • The log says skepcontrol: control plane not reachable; collector keeps exporting. The collector cannot register. The error after it says why: a 401 means the key is wrong or revoked (create a new collector key), a network error means the collector cannot reach Skep. Your telemetry still flows to your backend meanwhile.
  • Registered, but no post sampling counts. skepobserver/post is not in the traces pipeline after tail_sampling.

Rather not maintain a build? Run the Skep distribution instead: the upstream Collector with these components included. Every setting of both components is in Collector components.

Skep · Security · Changelog · Privacy