SDK Autoconfiguration
The SDK’s autoconfiguration module is used for basic configuration of the agent. Read the
docs to find settings such as configuring export or sampling.
SDK的自动配置模块用于agent的基本配置。阅读文档来查找设置,如配置出口或采样。
Here are some quick links into those docs for the configuration options for specific portions of the SDK & agent:
这里有一些快速链接,可以进入这些文档,了解SDK和agent的特定部分的配置选项。
- Exporters
- Trace context propagation
- OpenTelemetry Resource and service name
- Batch span processor
- Sampler
- Span limits
- Using SPI to further configure the SDK
Peer service name
The peer service name is the name of a remote service being connected to. It corresponds to service.name
in the Resource for the local service.
peer service name是被连接的远程服务的名称。它与本地服务的资源中的service.name相对应。
System property | Environment variable | Description |
---|---|---|
otel.instrumentation.common.peer-service-mapping |
OTEL_INSTRUMENTATION_COMMON_PEER_SERVICE_MAPPING |
Used to specify a mapping from hostnames or IP addresses to peer services, as a comma-separated list of host=name pairs. The peer service is added as an attribute to a span whose host or IP match the mapping. For example, if set to 1.2.3.4=cats-service,dogs-abcdef123.serverlessapis.com=dogs-api, requests to 1.2.3.4 will have a peer.service attribute of cats-service and requests to dogs-abcdef123.serverlessapis.com will have an attribute of dogs-api . |
用于指定从主机名或IP地址到peer service name的映射,以逗号分隔的主机=名称对列表的形式。peer service name作为一个属性被添加到主机或IP与该映射相匹配的span中。 例如,如果设置为1.2.3.4=cats-service,dogs-abcdef123.serverlessapis.com=dogs-api,则对1.2.3.4的请求的请求将有一个peer.service属性为cats-service.而对dogs-abcdef123.serverlessapis.com的请求将有一个属性为dogs-api的属性。
DB statement sanitization
The agent sanitizes all database queries/statements before setting the db.statement
semantic attribute:
all values (strings, numbers) in the query string are replaced with a question mark ?
.
Examples:
- SQL query
SELECT a from b where password="secret"
will appear asSELECT a from b where password=?
in the exported span; - Redis command
HSET map password "secret"
will appear asHSET map password ?
in the exported span.
This behavior is turned on by default for all database instrumentations.
The following property may be used to disable it:
System property | Environment variable | Description |
---|---|---|
otel.instrumentation.common.db-statement-sanitizer.enabled |
OTEL_INSTRUMENTATION_COMMON_DB_STATEMENT_SANITIZER_ENABLED |
Enables the DB statement sanitization. The default value is true . |