mydest
.
Creating a new destination involves these steps:
- Extending the UI for the new destination
- Adding the collector configuration for the new destination
- Generating the documentation for the new destination
User Interface
For our new destination to be visible in the UI, we need to define the destination metadata and fields in YAML format:1
Add Logo
Go to
destinations/logos/
directory and add your logo.- Must be in SVG format
- Example:
mydest.svg
mydest.svg
2
Add Destination Metadata
Go to
destinations/data/
directory and create a new YAML file.- Example:
mydest.yaml
Allowed properties
Allowed properties
Key | Example | Required | Description | Docs |
---|---|---|---|---|
metadata.type | mydest | ✅ | unique identifier for the destination | ✅ |
metadata.displayName | My Destination | ✅ | display name of the destination | ✅ |
metadata.category | managed | ✅ | one-of: managed self hosted | ✅ |
spec.image | mydest.svg | ✅ | logo of the destination | ✅ |
spec.signals.traces.supported | true | ✅ | is tracing supported? | ✅ |
spec.signals.metrics.supported | true | ✅ | is metrics supported? | ✅ |
spec.signals.logs.supported | false | ✅ | is logging supported? | ✅ |
spec.note.type | Note | ❌ | type of callout box to display one-of: Note Info Warning Tip Check | ✅ |
spec.note.content | We handle the endpoint internally, so you don't need to provide it. | ❌ | content of the callout box | ✅ |
spec.fields | - | ✅ | list of fields to be configured, see specification here | ✅ |
Allowed properties for spec.fields[]
Allowed properties for spec.fields[]
Key | Example | Required | Description | Docs |
---|---|---|---|---|
name | MYDEST_API_KEY | ✅ | key name of the field | ✅ |
displayName | API Key | ✅ | display name of the field | ✅ |
secret | true | ❌ | is the field a secret? (e.g. password, token, etc.) | ❌ |
initialValue | - | ❌ | default value for the field | ✅ |
componentType | input | ✅ | one-of: input textarea dropdown checkbox multiInput keyValuePairs | ✅ |
componentProps.type | password | ❌ | the type of value (e.g. string, number, password, etc.) | ✅ |
componentProps.required | true | ❌ | is the field required? | ✅ |
componentProps.values | - | ❌ | list of options for dropdown | ❌ |
componentProps.placeholder | glc_eyJvIj... | ❌ | placeholder text for input | ✅ |
componentProps.tooltip | Obtained from your "My Dest" account | ❌ | tooltip text for input | ✅ |
renderCondition | ["MYDEST_URL", "!=", ""] | ❌ | hide/show the field in the UI (form only) one-of: [boolean] [string, operator, any] where string is the key name of the dependancy field, and operator is one-of: != == >= <= > < | ❌ |
hideFromReadData | ["MYDEST_URL", "==", ""] | ❌ | hide/show the field in the UI (read only) one-of: [boolean] [string, operator, any] where string is the key name of the dependancy field, and operator is one-of: != == >= <= > < | ❌ |
customReadDataLabels | - | ❌ | custom labels for the UI (read only) | ❌ |
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.1
Add Destination Type
Go to
common/dests.go
and add your new destination to the DestinationType
enum.- Make sure the value is the same as the
type
property inmydest.yaml
2
Add Collector Config
Go to
common/config
directory and create a new GO file.- Example:
mydest.go
Explain Config
Explain Config
- DestType - Returns the enum value of the destination added to
common/dests.go
in step 1. - ModifyConfig - Is called with the
dest
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. You can assume a basic configuration is already provided in thecurrentConfig
object, for details seegetBasicConfig
method incommon/config/root.go
file.- Make sure to give any exporter or pipeline a unique name in order to avoid conflicts, use the conventions:
otlp/<dest-name>-<dest.GetID()>
for OTel gRPC exportersotlphttp/<dest-name>-<dest.GetID()>
for OTel HTTP exporterstraces/<dest-name>-<dest.GetID()>
for traces pipelinesmetrics/<dest-name>-<dest.GetID()>
for metrics pipelineslogs/<dest-name>-<dest.GetID()>
for logs pipelines
- 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.
- Make sure to give any exporter or pipeline a unique name in order to avoid conflicts, use the conventions:
mydest.go
3
Add Available Config
Go to
common/config/root.go
and add the new destination to the availableConfigers
list.- Example:
&MyDest{}
common/config/root.go
Kubernetes-Specific Collector Configuration
If your destination configures Kubernetes settings, for example you have a config field that accepts a value that should be mounted in the Collector Pod, create aK8sConfiger
object in destinations.k8sconfig
.
This interface provides an additional function, ModifyGatewayCollectorDeployment
, which accepts a Destination and Collector Deployment.
Your implementation can use this function to modify the Deployment as necessary based on the Destination config.
Note: It is the responsibility of your implementation to check for the validity of this config, such as checking for conflicts or values
that already exist.
The K8sConfiger
interface also requires a DestType()
function, similar to common Destinations. This function returns the type
of common Destination that this Kubernetes implementation relies on. This is used by the Autoscaler to conditionally apply the K8sConfiger
only for the matching Destination.
When it is implemented, add your K8sConfiger
implementation to the availableConfigers
list in
destinations/k8sconfig/root.go
Generating Documentation
1
Install Python
Make sure you have Python installed on your system.
2
Generate Documentation
Go to
docs
directory, and run:3
Edit Documentation
The documentation has been generated in the
docs/backends
directory. Feel free to add any additional content to the generated file.- Edit only between the
!! START CUSTOM EDIT !!
and!! END CUSTOM EDIT !!
comments - Example:
mydest.mdx
mydest.mdx
4
Update README.md
Go to
README.md
and add your new destination to the list of destinations.