tencent cloud

Tencent Cloud Observability Platform

Release Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Basic Features
Basic Concepts
Use Cases
Use Limits
Purchase Guide
Tencent Cloud Product Monitoring
Application Performance Management
Mobile App Performance Monitoring
Real User Monitoring
Cloud Automated Testing
Prometheus Monitoring
Grafana
EventBridge
PTS
Quick Start
Monitoring Overview
Instance Group
Tencent Cloud Product Monitoring
Application Performance Management
Real User Monitoring
Cloud Automated Testing
Performance Testing Service
Prometheus Getting Started
Grafana
Dashboard Creation
EventBridge
Alarm Service
Cloud Product Monitoring
Tencent Cloud Service Metrics
Operation Guide
CVM Agents
Cloud Product Monitoring Integration with Grafana
Troubleshooting
Practical Tutorial
Application Performance Management
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Parameter Information
FAQs
Mobile App Performance Monitoring
Overview
Operation Guide
Access Guide
Practical Tutorial
Tencent Cloud Real User Monitoring
Product Introduction
Operation Guide
Connection Guide
FAQs
Cloud Automated Testing
Product Introduction
Operation Guide
FAQs
Performance Testing Service
Overview
Operation Guide
Practice Tutorial
JavaScript API List
FAQs
Prometheus Monitoring
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Terraform
FAQs
Grafana
Product Introduction
Operation Guide
Guide on Grafana Common Features
FAQs
Dashboard
Overview
Operation Guide
Alarm Management
Console Operation Guide
Troubleshooting
FAQs
EventBridge
Product Introduction
Operation Guide
Practical Tutorial
FAQs
Report Management
FAQs
General
Alarm Service
Concepts
Monitoring Charts
CVM Agents
Dynamic Alarm Threshold
CM Connection to Grafana
Documentation Guide
Related Agreements
Application Performance Management Service Level Agreement
APM Privacy Policy
APM Data Processing And Security Agreement
RUM Service Level Agreement
Mobile Performance Monitoring Service Level Agreement
Cloud Automated Testing Service Level Agreement
Prometheus Service Level Agreement
TCMG Service Level Agreements
PTS Service Level Agreement
PTS Use Limits
Cloud Monitor Service Level Agreement
API Documentation
History
Introduction
API Category
Making API Requests
Monitoring Data Query APIs
Alarm APIs
Legacy Alert APIs
Notification Template APIs
TMP APIs
Grafana Service APIs
Event Center APIs
TencentCloud Managed Service for Prometheus APIs
Monitoring APIs
Data Types
Error Codes
Glossary

Automatic Access of .NET Applications in Kubernetes Environment (Recommended)

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-10-13 19:10:49
For the .NET applications deployed on Kubernetes, Application Performance Management (APM) offers an automatic access solution that enables automatic agent injection, which facilitates quick access of applications.
The .NET applications adopting automatic access in Kubernetes environment will use the community edition of the OpenTelemetry-dotnet solution to inject agents. For more information about OpenTelemetry-dotnet, see the community OpenTelemetry-dotnet project.

Prerequisites

Ensure that the .NET version, dependency libraries, and frameworks are within the supported range of the agent by referring to Components and Frameworks Supported by the OpenTelemetry-dotnet Solution. For dependency libraries and frameworks supported by automatic instrumentation, data reporting will be completed upon successful access without the need to modify the code. If automatic instrumentation does not meet your needs, or you need to perform instrumentation at the business layer, please do so.

Step 1: Installing Operator

Install Operator in the Kubernetes cluster. It is recommended to install Operator in the APM console with one click. For details, see Installing tencent-opentelemetry-operator.

Step 2: Adding Annotation to Workload

Taking Tencent Kubernetes Engine (TKE) as an example, annotations can be added to workloads by following the steps below. For general Kubernetes clusters, use tools like kubectl to add annotations.
1. Log in to the TKE console.
2. Click Cluster to enter the corresponding TKE cluster.
3. In Workload, find the application that needs to access APM, click More, then click Edit YAML.
4. Add the following content in the Pod annotation, and click Complete to finish the access.
cloud.tencent.com/inject-dotnet: "true"
cloud.tencent.com/otel-service-name: my-app # Application name. For the processes that access using the same application name are displayed in APM as multiple instances under the same application.
# The application name can contain up to 63 characters, consisting of lowercase letters, digits, and the separator (-) only. It must start with a lowercase letter and end with a digit or lowercase letter.
Note that this content needs to be added to spec.template.metadata.annotations, affecting the Pod's annotation, rather than the workload's annotation. You can see the following code snippet:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
k8s-app: my-app
name: my-app
namespace: default
spec:
selector:
matchLabels:
k8s-app: my-app
template:
metadata:
labels:
k8s-app: my-app
annotations:
cloud.tencent.com/inject-dotnet: "true" # Add it here.
cloud.tencent.com/otel-service-name: my-app
spec:
containers:
image: my-app:0.1
name: my-app

Access Verification

After an annotation is added to the workload, the system triggers a restart of the application Pod based on the release policy. The newly started Pod will be automatically injected with an agent and access the APM server to report monitoring data. The reported business system is the default business system of Operator. In normal traffic cases, the connected application will be displayed in Application Performance Monitoring > Application list. Click Application name/ID to enter the application details page, then select Instance Analysis to view the connected application instance. Since there is certain delay in processing of observable data, you may wait for about 30 seconds if the application or instance is not found in the console.

More Access Configuration Items (Optional)

At the workload level, you can add more annotations to adjust the access behaviors:
Configuration Item
Description
cloud.tencent.com/apm-token
Specifies the Token for the APM business system. If this configuration item is not added, the configuration of the Operator is used (corresponding to the Operator's env.APM_TOKEN field).
cloud.tencent.com/dotnet-instr-version
Specifies the .NET agent version. If this configuration item is not added, the configuration of Operator (corresponding to the env.DOTNET_INSTR_VERSION field of Operator) is used. The value can be latest (default) or a specific version number. For a list of specific version numbers, see Agent Version Information. It is not recommended to fill in this field unless necessary.
cloud.tencent.com/container-names
Specifies the container(s) where the agent is injected. Injecting an agent into multiple containers is supported. In this case, simply enter multiple container names separated by English commas in the value section of this configuration item. If this configuration item is not added, the agent will be injected into the first container by default. This configuration item is supported in Operator version 0.88 and later.
cloud.tencent.com/otel-dotnet-auto-runtime
Specifies the location of .NET CLR Profiler. If this configuration item is not added, the configuration of Operator (corresponding to the env.CORECLR_PROFILER_PATH field of Operator) is used. It is not recommended to fill in this field unless necessary. This configuration item is supported in Operator version 0.88 and later.
Optional configuration items:
linux-x64 (default): Suitable for Linux glibc-based images.
linux-musl-x64: Suitable for Linux musl-based images.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan