Skip to content

canonical/opentelemetry-collector-rock

Repository files navigation

opentelemetry-collector-rock

Open a PR to OCI Factory Publish to GHCR:dev Update rock

Rocks for Opentelemetry Collector. This repository holds all the necessary files to build rocks for the upstream versions we support.

The rocks on this repository are built with OCI Factory, which also takes care of periodically rebuilding the images.

How do I interact with this repo? This repo uses just to easily run some commands:

∮ just
Available recipes:
    clean version=latest_version          # `rockcraft clean` for a specific version
    lint-manifest version=latest_version  # Make sure you've run ocb-manifest
    ocb-manifest version=latest_version manifest=(version + "/manifest.yaml") # Generate the OCB manifest
    pack version=latest_version           # Pack a rock of a specific version
    run version=latest_version            # Run a rock and open a shell into it with `kgoss`

    [test]
    test version=latest_version           # Run all the tests
    test-integration version=latest_version test_name="" # Test the rock integration with other workloads
    test-isolation version=latest_version # Test the rock with `kgoss`

What are all those manifests? Each rock version has a set of manifest* files, that tell OCB what to include in the Collector. We include everything in -core, but cherry-pick from -contrib what we mention in -additions. Running just ocb-manifest generates a final manifest.yaml, which is the one used in the rock. Summarizing:

  • manifest-core.yaml, manifest-contrib.yaml: obtained via wget from upstream by the update-rock CI;
  • manifest-additions.yaml: the extensions from -contrib that we want to include;
  • manifest.yaml: generated by running just ocb-manifest, merges manifest-core.yaml with the items we cherry-picked from -contrib.

Automation takes care of:

  • validating PRs, by simply trying to build the rock;
  • pulling upstream releases, creating a PR with the necessary files to be manually reviewed;
  • on PRs, validate the added (or modified) rocks by running kgoss;
  • releasing to GHCR at ghcr.io/canonical/opentelemetry-collector:dev, when merging to main, for development purposes.

Prerequisites:

  • install goss and kgoss
  • do not use microk8s.kubectl (from snap) due to permission errors
    • use the kubectl snap instead
  • sign the CLA

Usage

If you want to run this OpenTelemtry Collector rock to observe a non-charmed deployment, you will need to write a few yaml manifests.

Here are the manifests you need to deploy the Collector and a Node Exporter pod to get metrics from the local host:

Open the opentelemetry-collector.yaml manifest and customize it to your needs; specifically:

  • modify the config to observe your non-charmed deployment and to write data to your Prometheus backend
  • update the image URI from localhost:32000/... to ubuntu/opentelemetry-collector:0.130-24.04

Now you can apply them:

kubectl apply -f node-exporter.yaml
kubectl apply -f opentelemetry-collector.yaml

Congrats, you're now observing your non-charmed deployment!

About

A ROCK for OpenTelemetry Collector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 7

Languages