[FAQ] How to Add Custom Labels/Attributes to interop.io OpenTelemetry Metrics

Question

How to add custom labels or attributes to the OpenTelemetry metrics exported by interop.io, to differentiate metrics by environment, internal platform version, or any other dimension relevant to your organization. I.e. I want to override the value of a built-in label such as platformVersion.

Answer

Adding Custom Attributes to All Metrics

Use the additionalAttributes or additionalResourceAttributes settings in your otel.metrics configuration to add custom labels to metrics generated by interop.io. This is the recommended approach when you want to attach your own attributes (e.g., a custom version identifier, environment name, or deployment tag) without modifying the built-in labels.

Overriding the Built-In Label

The built-in platformVersion label cannot be overridden through the otel.metrics configuration directly. However, you can override it globally via the top-level otel.platformVersion property:

{
    "otel": {
        "platformVersion": "my-version"
    }
}

You can also override platformVersion within the settings for individual metrics. The following is a simplified/pseudocode example showing the structure:

{
    "otel": {
        "enabled": true,
        "metrics": {
            "defaultMetricsEnabled": true,
            "metrics": [
                // Overriding the default settings for a predefined metric.
                {
                   "type": "app_error",
                   "enabled": true,
                   "platformVersion": "your_platform_version_here"
                }
               
            ]
        }
    }
}

Additional Resources

interop.io Insights Configuration documentation