Attribute Name | Key | Required | Scenarios Where Automatic Injection Is Possible |
Instance name | host.name | Yes | Connect via Tencent Cloud Enhanced Java Agent Connect via Skywalking Solution TKE environment can be integrated with one click via tencent-opentelemetry-operator |
CVM region | cvm.region | No | Connecting via Tencent Cloud OpenTelemetry Java Agent Enhanced Edition |
CVM instance ID | cvm.instance.id | No | Connecting via Tencent Cloud OpenTelemetry Java Agent Enhanced Edition |
TKE region | k8s.region | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
TKE cluster ID | k8s.cluster.id | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
K8s node IP | k8s.node.ip | No | One - click connection of TKE environment through Tencent OpenTelemetry Operator. |
K8s namespace. | k8s.namespace.name | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
Name of K8s Deployment. | k8s.deployment.name | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
Name of K8s Pod. | k8s.pod.name | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
K8s Pod IP | k8s.pod.ip | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
Application version. | service.version | No | One-click integration of TKE environment via Tencent OpenTelemetry Operator |
Custom field 1 | custom_key_1 | No | - |
Custom field 2 | custom_key_2 | No | - |
Custom Field 3 | custom_key_3 | No | - |
token
and service.name
. In the OpenTelemetry standard, Resource Attributes reflect the basic information of an application instance in the form of key-value pairs. Users can set instance attributes through environment variables or in the access code. The specific setting method is consistent with the way token
and service.name
are set when connecting the application.OTEL_RESOURCE_ATTRIBUTES
. Eventually, OTEL_RESOURCE_ATTRIBUTES
will be displayed in a format similar to key1=value1,key2=value2,key3=value3
.k8s.region
and k8s.cluster.id
.export OTEL_RESOURCE_ATTRIBUTES="service.name=myService,token=myToken"
export
OTEL_RESOURCE_ATTRIBUTES="$OTEL_RESOURCE_ATTRIBUTES,k8s.region=ap-guangzhou,k8s.cluster.id=cls-7i2n4axx
"
OTEL_RESOURCE_ATTRIBUTES
environment variable, refer to the following code snippet:spec:containers:- env:- name: OTEL_RESOURCE_ATTRIBUTESvalue: "service.name=myService,token=myToken,k8s.region=ap-guangzhou,k8s.cluster.id=cls-7i2n4axx"
spec:containers:- env:- name: OTEL_RESOURCE_ATTRIBUTESvalue: "custom_key_1=value1,custom_key_2=value_2,cvm.region=ap-guangzhou,cvm.instance.id=ins-3flvdptq"
import ("context""errors""os""go.opentelemetry.io/otel/sdk/resource")r, err := resource.New(ctx, []resource.Option{resource.WithAttributes(attribute.KeyValue{Key: "token", Value: attribute.StringValue("my-token")},attribute.KeyValue{Key: "service.name", Value: attribute.StringValue("my-service")},attribute.KeyValue{Key: "host.name", Value: attribute.StringValue("10.10.0.1")},attribute.KeyValue{Key: "k8s.region", Value: attribute.StringValue("ap-guangzhou")},attribute.KeyValue{Key: "k8s.cluster.id", Value: attribute.StringValue("cls-7i2n4ace")},),}...)
spec:containers:- env:- name: POD_NAMEvalueFrom:fieldRef:apiVersion: v1fieldPath: metadata.name- name: POD_IPvalueFrom:fieldRef:apiVersion: v1fieldPath: status.podIP- name: NODE_IPvalueFrom:fieldRef:apiVersion: v1fieldPath: status.hostIP
spec:containers:- env:- name: OTEL_RESOURCE_ATTRIBUTESvalue: "service.name=myService,token=myToken,k8s.pod.ip=$(POD_IP),k8s.pod.name=$(POD_NAME)"