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.yaml
by 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.go
and add your new destination to theDestinationType
enum. Make sure the value is the same as thetype
property of the destination UI class -mydest
in the current case. - Go to
autoscaler/controllers/gateway/config
directory and create a new file calledmydest.go
with the following content:
mydest.go
- The method
DestType
returns the enum value of the destination added earlier. - The method
ModifyConfig
is called with thedest
object which holds the data received from the UI and thecurrentConfig
object. ThecurrentConfig
object 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 thecurrentConfig
object, for details seegetBasicConfig
method incommon/config/root.go
file. - You can use the utility methods
isTracingEnabled
,isMetricsEnabled
andisLoggingEnabled
to 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.go
file:
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.