Contibution Guidelines
Adding New Observability Destination
There are tens if not hundreds of different observability destinations. Odigos goal is to provide a seamless and easy way to ship observability data to any one of them.
In this guide, you will learn how to contribute a new destination to Odigos. We
will create a new dummy destination called mydest. Creating a new destination
involves two steps:
- Extending the UI for the new destination
- Adding the collector configuration for the new destination
User Interface
For our new destination to be visible in the UI, we need to make several changes to the UI code:
- Go to
destinations/logos/directory and add your logo file, for examplemydest.svg. Please use svg format for the logo. - Go to
destinations/data/directory and create a new file calledmydest.yamlby duplicating one of the others. That file makes setup page for set destination available and is quite self-explanatory to use:
mydest.yaml
Collector Configuration
Now that our new vendor can be persisted/loaded in the Kubernetes data store, we need to implement the collector configuration.
- Go to
common/dests.goand add your new destination to theDestinationTypeenum. Make sure the value is the same as thetypeproperty of the destination UI class -mydestin the current case. - Go to
autoscaler/controllers/gateway/configdirectory and create a new file calledmydest.gowith the following content:
mydest.go
- The method
DestTypereturns the enum value of the destination added earlier. - The method
ModifyConfigis called with thedestobject which holds the data received from the UI and thecurrentConfigobject. ThecurrentConfigobject contains the current configuration of the gateway collector. Modify this object to include the OpenTelemetry configuration needed by your destination. Make sure to give any exporter or pipeline a unique name in order to avoid conflicts (use the conventiontraces/<dest-name>-<dest.GetID()>for traces pipelines andotlp/<dest-name>-<dest.GetID()>for OpenTelemetry exporters). You can assume a basic configuration is already provided in thecurrentConfigobject, for details seegetBasicConfigmethod incommon/config/root.gofile. - You can use the utility methods
isTracingEnabled,isMetricsEnabledandisLoggingEnabledto determine which signals are selected by the user for the destination and configure the collector accordingly. - The last step is to register the new destination struct in the
common/config/root.gofile:
That’s it! Now you can use your new destination in the UI and send data to it.
Please submit a PR to the odigos git repository, we are happy to accept new destinations.