Sending OpenTelemetry data to the Instana backend
Telemetry data can be sent in OTLP format directly from applications or systems to the Instana backend. Complete the following configurations:
Prerequisites
-
The special endpoints of the backend
otlp-acceptorcomponent are used when OpenTelemetry data is sent.In the following configuration example, the OpenTelemetry collector is used to connect to the Instana backend
otlp-acceptorcomponent:exporters: otlp: endpoint: ${INSTANA_OTLP_GRPC_BACKEND}:4317 headers: x-instana-key: xxxxxxxThe
https://value that is added inotlp. endpointindicates that a secure connection is used. If tls is not set, it is enabled by default. For more information, see OtlpExporter Setting. -
You must set the required Instana agent key for validation. Set the x-instana-key field with the agent key of the Instana for targeting the Instana backend.
Creating the required resource attribute or environment variable
The Instana backend requires the host.id, faas.id, or device.id resource attribute. Alternatively, you can set x-instana-host as an environment variable. Instana uses the host.id attribute to uniquely identify a host and link OpenTelemetry entities to the correct host. You can provide the host.id in two ways:
-
By using OpenTelemetry SDK (suggested for non-containerized systems)
OpenTelemetry has a standard semantic convention for
host.id. Most OpenTelemetry SDKs support collecting thehost.idresource attribute on non-containerized systems. When you providehost.idthrough an OpenTelemetry SDK, Instana can seamlessly link the OpenTelemetry entity to the corresponding host in Instana infrastructure monitoring. -
By retrieving
host.idfrom the Instana UITo find the
host.idin the Instana UI, go to Analyze Infrastructure > Host. Select the required host from the list to view its details. Under System, you can find Host ID. If you manually set thishost.idin your OpenTelemetry resource attributes, Instana links the OpenTelemetry entity to the corresponding host in Instana infrastructure monitoring.
If the OpenTelemetry Collector is deployed in a Daemonset mode, the OpenTelemetry Collector is located in the same host of the applications that send out OpenTelemetry data. You can also set the x-instana-host header by using the
OTLP exporter.
exporters:
otlp:
endpoint: ${INSTANA_OTLP_GRPC_BACKEND}:4317
headers:
x-instana-key: xxxxxxx
x-instana-host: xxxx // or use ${host.name} if set in the configuration files processors.resource.attributes or in the OpenTelemetry SDK
The `https://` value that is added in `otlp. endpoint` indicates that a secure connection is used. If tls is not set, it is enabled by default. For more information, see [OtlpExporter Setting](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/README.md). {: note}
- Set the
x-instana-keyfield with the agent key of the Instana agent for targeting the Instana backend. - Set the
x-instana-hostfield with the host name with value:${host.name}, which is the name of the host that runs the OpenTelemetry Collector. The host.name can be found in configuration files processors.resource.attributes or in the OpenTelemetry SDK. If the host.name is not set, you can set the host name from your environment variables, such asHOSTNAMEorHOST, or you can set it manually. - Set the
endpointfield with the correct domain name of theotlp-acceptorcomponent of the Instana backend. - Instana uses OTLP standard port numbers, such as 4317 for
OTLP/gRPCand 4318 forOTLP/HTTP. Port 443 is also supported forOTLP/HTTP.
Configuring Self-Hosted Instana
On Instana self-hosted, port 443 is used for OTLP/gRPC and OTLP/HTTP protocols. The following domain names are used for the protocols:
otlp-grpc.<base_domain> for OTLP/gRPC
otlp-http.<base_domain> for OTLP/HTTP
To send the OpenTelemetry data to the Instana backend, complete the following steps:
-
Make sure the two DNS entries
otlp-http.<base_domain>andotlp-grpc.<basedomain>are created for theotlp-acceptorcomponent in your Instana backend.- For more information about DNS configuration on Instana self-hosted Standard Edition, see single-node cluster DNS Settings and multi-node cluster DNS Settings.
- For more information about DNS configuration on Instana self-hosted Custom Edition on the Kubernetes platform, see Setting up load balancers and DNS.
- For more information about configuring Instana self-hosted Custom Edition on the Openshift platform, see Setting up load balancers and DNS - Instana backend on openshift.
-
Configure the OTLP exporter to use with OpenTelemetry collector and complete one of the following steps:
-
OTLP exporter with certification verification:
-
Get CA file from self-hosted instana
- For self-hosted standard edition:
kubectl get secret instana-tls -n instana-core -o jsonpath='{.data.ca\.crt}'|base64 -d > ca.crt - For self-hosted custom edition which certificate is generated by openssl command:
kubectl get secret instana-tls -n instana-core -o jsonpath='{.data.tls\.crt}'|base64 -d > tls.crt
- For self-hosted standard edition:
-
Copy
ca.crtto the location of the OpenTelemetry collector environment:exporters: otlp: endpoint: https://otlp-grpc.<base_domain>:443 tls: insecure: false ca_file: <path_to_cert_file>/<cert_file_name> headers: x-instana-key: xxxxxx x-instana-host: xxxxxx // or use ${host.name} if set in the configuration files processors.resource.attributes or in the OpenTelemetry SDK
-
-
OTLP exporter without certification verification:
exporters: otlp: endpoint: https://otlp-grpc.<base_domain>:443 tls: insecure: false insecure_skip_verify: true headers: x-instana-key: xxxxxx x-instana-host: xxxxxx // or use ${host.name} if set in the configuration files processors.resource.attributes or in the OpenTelemetry SDK
-
Forwarding Telemetry data to the Instana backend with the OpenTelemetry Collector
To forward OpenTelemetry data to the Instana backend, complete the following steps:
-
Identify your Instana deployment region. The endpoint for the Instana backend varies based on the deployment region. To find the Instana region that is dedicated to your environment, on the Instana UI, go to the navigation menu, and then click More > About Instana. The Instana dialog is displayed. You can see the Instana deployment region in the dialog.
Each Instana SaaS environment is associated with a specific region name, such as
blue,red,green,orange, orcoral. For detailed information about the endpoint of the Instana backendotlp-acceptor, see Endpoints of Instana backend otlp-acceptor. -
Configure an
OTLP/gRPCorOTLP/HTTPconnection to the Instana backend. For example, if you are using the Instanablueenvironment, you can configure anOTLP/gRPCorOTLP/HTTPconnection to the Instana backend by using the following configuration:-
OTLP/gRPCexporters: otlp: endpoint: otlp-blue-saas.instana.io:4317 headers: x-instana-key: xxxx ... service: pipelines: traces: receivers: [...] processors: [...] exporters: [..., otlp] metrics: receivers: [...] processors: [...] exporters: [..., otlp] logs: receivers: [...] processors: [...] exporters: [..., otlp]Set the
x-instana-keyfield with the agent key of the Instana agent for targeting the Instana backend. -
OTLP/HTTPexporters: otlphttp: endpoint: https://otlp-blue-saas.instana.io:4318 headers: x-instana-key: xxxx ... service: pipelines: traces: receivers: [...] processors: [...] exporters: [..., otlphttp] metrics: receivers: [...] processors: [...] exporters: [..., otlphttp] logs: receivers: [...] processors: [...] exporters: [..., otlphttp]
-
Configuring the resource attributes
The Instana backend requires a host.id, faas.id, or device.id resource attribute. Alternatively, you can set x-instana-host as an environment variable pointing to the host name.
If the OpenTelemetry Collector is deployed in the DaemonSet mode, that is, the OpenTelemetry Collector is located in the same host of the applications that send the OpenTelemetry data, you can set the x-instana-host header by
using the OTLP exporter. See the following example:
exporters:
otlp:
endpoint: otlp-blue-saas.instana.io:4317
headers:
x-instana-key: xxxxxxx
x-instana-host: xxxx // or use ${host.name} if set in the configuration files processors.resource.attributes or in the OpenTelemetry SDK
You must specify the host name in the x-instana-host field if no host.name, host.id, faas.id, or device.id resource attribute is defined in your application or system. To
find the host.name in the Instana UI, go to Analyze Infrastructure > Host. Select the required host from the list to view its details. Under System, you can find Host Name.
The way you can add the host.name resource attribute is to use the resource processor:
processors:
resource:
attributes:
- key: host.name
action: upsert
value: "myhost1.ibm.com"
After you complete all configuration changes in the agent configuration.yaml file, run the following command to use the OpenTelemetry Collector:
otel-contrib --config configuration.yaml
Endpoints of the Instana backend otlp-acceptor
In the following table, you can see the domain names of the Instana backend otlp-acceptor for different Instana SaaS environments. For more information about the Instana SaaS environment, see Integrating with OpenTelemetry by using the OpenTelemetry Collector.
| Instana SaaS environment | Domain name of otlp-accepter |
|---|---|
| blue | gRPC: otlp-blue-saas.instana.io:4317 HTTP: https://otlp-blue-saas.instana.io:4318 |
| red | gRPC: otlp-red-saas.instana.io:4317 HTTP: https://otlp-red-saas.instana.io:4318 |
| green | gRPC: otlp-green-saas.instana.io:4317 HTTP: https://otlp-green-saas.instana.io:4318 |
| orange | gRPC: otlp-orange-saas.instana.io:4317 HTTP: https://otlp-orange-saas.instana.io:4318 |
| coral | gRPC: otlp-coral-saas.instana.io:4317 HTTP: https://otlp-coral-saas.instana.io:4318 |
| teal | gRPC: otlp-grpc-teal-saas.instana.io:443 HTTP: https://otlp-http-teal-saas.instana.io:443 |
| mizu | gRPC: otlp-grpc-mizu-saas.instana.io:443 HTTP: https://otlp-http-mizu-saas.instana.io:443 |
| pumpkin | gRPC: otlp-grpc-pumpkin-saas.instana.io:443 HTTP: https://otlp-http-pumpkin-saas.instana.io:443 |
| jade | gRPC: otlp-grpc-jade-saas.instana.io:443 HTTP: https://otlp-http-jade-saas.instana.io:443 |
All endpoints of the Instana backend otlp-acceptor in SaaS environments are TLS-enabled.