### Verify installation task output Source: https://docs.guance.com/deployment/Kubernetes-HA-Guide Example of successful task execution output during cluster setup. ```text # 命令跑完后task 不能有错误 TASK [cluster-addon : 准备 DNS的部署文件] ********************************************* changed: [10.200.14.144] TASK [cluster-addon : 创建coredns部署] ********************************************* changed: [10.200.14.144] TASK [cluster-addon : 准备dnscache的部署文件] ***************************************** changed: [10.200.14.144] TASK [cluster-addon : 创建dnscache部署] ******************************************** changed: [10.200.14.144] TASK [cluster-addon : 准备 metrics-server的部署文件] ********************************** changed: [10.200.14.144] TASK [cluster-addon : 创建 metrics-server部署] ************************************* changed: [10.200.14.144] TASK [cluster-addon : 准备 nfs-provisioner 配置目录] ********************************* changed: [10.200.14.144] TASK [cluster-addon : 准备 nfs-provisioner部署文件] ********************************** changed: [10.200.14.144] => (item=nfs-provisioner.yaml) changed: [10.200.14.144] => (item=test-pod.yaml) TASK [cluster-addon : 创建 nfs-provisioner部署] ************************************ changed: [10.200.14.144] TASK [cluster-addon : 准备 openebs-provisioner 配置目录] ***************************** changed: [10.200.14.144] TASK [cluster-addon : 准备 openebs-provisioner 部署文件] ***************************** changed: [10.200.14.144] => (item=openebs-provisioner.yaml) TASK [cluster-addon : 创建 openebs-provisioner 部署] ******************************* changed: [10.200.14.144] TASK [cluster-addon : 准备 ingress-nginx 配置目录] *********************************** changed: [10.200.14.144] TASK [cluster-addon : 准备 ingress-nginx 部署文件] *********************************** changed: [10.200.14.144] => (item=ingress-nginx.yaml) TASK [cluster-addon : 创建 ingress-nginx 部署] ************************************* changed: [10.200.14.144] PLAY RECAP ********************************************************************* 10.200.14.144 : ok=110 changed=99 unreachable=0 failed=0 skipped=172 rescued=0 ignored=0 10.200.14.145 : ok=117 changed=106 unreachable=0 failed=0 skipped=199 rescued=0 ignored=0 10.200.14.146 : ok=93 changed=83 unreachable=0 failed=0 skipped=148 rescued=0 ignored=0 localhost : ok=33 changed=30 unreachable=0 failed=0 skipped=11 rescued=0 ignored=0 ``` -------------------------------- ### Query Product Documentation Source: https://docs.guance.com/ai/assistant/knowledge-capture-sharing Example command to request installation instructions and verification steps for a specific component. ```text 如何为 Kubernetes 集群安装 DataKit,并确认指标已经上报? ``` -------------------------------- ### Complete OWL CLI quickstart workflow Source: https://docs.guance.com/owl/quickstart-cli Complete example showing the full OWL CLI workflow: configure environment variables, sync tools, list categories and tools, show tool details, validate a tool call, and execute a tool with JSON output. The bash and PowerShell versions are equivalent. ```bash export OWL_REGISTRY_ENDPOINT="your-owl-endpoint" export OWL_TOKEN="your-token" owl sync owl category list owl list -c data owl show owl.data.query owl validate owl.data.show_dql_namespace -f json owl exec owl.data.show_dql_namespace -f json ``` ```powershell $env:OWL_REGISTRY_ENDPOINT = "your-owl-endpoint" $env:OWL_TOKEN = "your-token" owl sync owl category list owl list -c data owl show owl.data.query owl validate owl.data.show_dql_namespace -f json owl exec owl.data.show_dql_namespace -f json ``` -------------------------------- ### FTUnityBridge resource tracking example Source: https://docs.guance.com/real-user-monitoring/unity/app-access Shows how to start and stop a resource, then add it with a ResourceParams object containing URL, headers, status, body, and method. The example uses a GET request and populates the params from a client and response. ```csharp FTUnityBridge.StartResource(resourceId); FTUnityBridge.StopResource(resourceId); ResourceParams resourceParams = new ResourceParams(); resourceParams.url = url; resourceParams.requestHeader = client.DefaultRequestHeaders.ToDictionary(header => header.Key, header => string.Join(",", header.Value)); resourceParams.responseHeader = response.Headers.ToDictionary(header => header.Key, header => string.Join(",", header.Value)); resourceParams.resourceStatus = (int)response.StatusCode; resourceParams.responseBody = responseData; resourceParams.resourceMethod = "GET"; FTUnityBridge.AddResource(resourceId, resourceParams); ``` -------------------------------- ### GET Request Example: List Dashboards Source: https://docs.guance.com/open-api/example Example of how to list dashboards using a GET request. ```APIDOC ## GET /api/v1/dashboards/list ### Description Retrieves a list of dashboards. ### Method GET ### Endpoint /api/v1/dashboards/list ### Query Parameters - **pageIndex** (integer) - Optional - The index of the page to retrieve. - **pageSize** (integer) - Optional - The number of items per page. ### Request Example ```bash curl "https://openapi.guance.com/api/v1/dashboards/list?pageIndex=1&pageSize=10" \ -H "Content-Type: application/json" \ -H "DF-API-KEY: ${DF_API_KEY}" \ --compressed \ --insecure ``` ### Response #### Success Response (200) - **code** (integer) - The response status code. - **content** (array) - An array of dashboard objects. - **errorCode** (string) - An error code if an error occurred. - **message** (string) - A message describing the response. - **pageInfo** (object) - Information about the pagination. - **success** (boolean) - Indicates if the request was successful. - **traceId** (string) - A unique identifier for the trace. #### Response Example ```json { "code":200, "content":[ {Object} ], "errorCode":"", "message":"", "pageInfo":{ "count":10, "pageIndex":1, "pageSize":10, "totalCount":836 }, "success":true, "traceId":"1749091119335873001" } ``` ``` -------------------------------- ### Example Configuration File Source: https://docs.guance.com/deployment/Kubernetes-HA-Guide An example of the config.yaml file used for cluster customization. ```yaml # config.yaml ############################ # prepare ############################ # 可选离线安装系统软件包 (offline|online) # 离线环境默认为 "offline" INSTALL_SOURCE: "offline" # 可选进行系统安全加固 github.com/dev-sec/ansible-collection-hardening OS_HARDEN: false ############################ # role:deploy ############################ # default: ca will expire in 100 years # default: certs issued by the ca will expire in 50 years CA_EXPIRY: "876000h" CERT_EXPIRY: "438000h" # kubeconfig 配置参数 CLUSTER_NAME: "cluster1" CONTEXT_NAME: "context-{{ CLUSTER_NAME }}" # k8s version K8S_VER: "__k8s_ver__" ############################ # role:etcd ############################ # 设置不同的wal目录,可以避免磁盘io竞争,提高性能 # 建议修改为磁盘空间较大的目录,具体以实际情况为准 ETCD_DATA_DIR: "/var/lib/etcd" ETCD_WAL_DIR: "" ############################ # role:runtime [containerd,docker] ############################ # ------------------------------------------- containerd # [.]启用容器仓库镜像 ENABLE_MIRROR_REGISTRY: true # [containerd]基础容器镜像 SANDBOX_IMAGE: "easzlab.io.local:5000/easzlab/pause:__pause__" # [containerd]容器持久化存储目录 # 建议修改为磁盘空间较大的目录,具体以实际情况为准 CONTAINERD_STORAGE_DIR: "/var/lib/containerd" # ------------------------------------------- docker # [docker]容器存储目录 # 建议修改为磁盘空间较大的目录,具体以实际情况为准 # 只有部署机器上会有docker服务 DOCKER_STORAGE_DIR: "/var/lib/docker" # [docker]开启Restful API ENABLE_REMOTE_API: false # [docker]信任的HTTP仓库 INSECURE_REG: '["http://easzlab.io.local:5000"]' ############################ # role:kube-master ############################ # k8s 集群 master 节点证书配置,可以添加多个ip和域名(比如增加公网ip和域名) MASTER_CERT_HOSTS: - "10.1.1.1" - "k8s.easzlab.io" #- "www.test.com" # node 节点上 pod 网段掩码长度(决定每个节点最多能分配的pod ip地址) # 如果flannel 使用 --kube-subnet-mgr 参数,那么它将读取该设置为每个节点分配pod网段 # https://github.com/coreos/flannel/issues/847 NODE_CIDR_LEN: 24 ############################ # role:kube-node ############################ # Kubelet 根目录 # 建议修改为磁盘空间较大的目录,具体以实际情况为准 KUBELET_ROOT_DIR: "/var/lib/kubelet" # node节点最大pod 数 MAX_PODS: 110 # 配置为kube组件(kubelet,kube-proxy,dockerd等)预留的资源量 # 数值设置详见templates/kubelet-config.yaml.j2 KUBE_RESERVED_ENABLED: "no" # k8s 官方不建议草率开启 system-reserved, 除非你基于长期监控,了解系统的资源占用状况; # 并且随着系统运行时间,需要适当增加资源预留,数值设置详见templates/kubelet-config.yaml.j2 # 系统预留设置基于 4c/8g 虚机,最小化安装系统服务,如果使用高性能物理机可以适当增加预留 # 另外,集群安装时候apiserver等资源占用会短时较大,建议至少预留1g内存 SYS_RESERVED_ENABLED: "no" ############################ # role:network [flannel,calico,cilium,kube-ovn,kube-router] ############################ # ------------------------------------------- flannel # [flannel]设置flannel 后端"host-gw","vxlan"等 FLANNEL_BACKEND: "vxlan" DIRECT_ROUTING: false # [flannel] flanneld_image: "quay.io/coreos/flannel:v0.10.0-amd64" flannelVer: "__flannel__" flanneld_image: "easzlab.io.local:5000/easzlab/flannel:{{ flannelVer }}" ``` -------------------------------- ### View Installer Help Source: https://docs.guance.com/datakit/datakit-offline-install Display the available command-line arguments for the Linux installer. ```bash ./installer-linux-amd64 --help ``` -------------------------------- ### Get Pipeline Request Example Source: https://docs.guance.com/open-api/pipeline__get Example of how to make a GET request to retrieve pipeline information using cURL. Ensure you replace '' with your actual API key. ```shell curl 'https://openapi.guance.com/api/v1/pipeline/pl_xxxx32/get' \ -H 'DF-API-KEY: ' \ --compressed ``` -------------------------------- ### Install RabbitMQ on Ubuntu Source: https://docs.guance.com/integrations/rabbitmq Installs RabbitMQ on Ubuntu and starts the server service. ```bash sudo apt-get update sudo apt-get install rabbitmq-server sudo service rabbitmq-server start ``` -------------------------------- ### Application Configuration Example Source: https://docs.guance.com/deployment/application-configuration-guide This is a comprehensive example of the application's configuration file, illustrating various settings for console access, external APIs, alerting, token expiration, logging, database connections, and more. ```yaml # 观测云控制台地址访问协议 protocol: "http" # 观测云控制台地址 hostname: "console.cloudcare.cn" # 管理后台站点访问地址 managementHostname: "management.cloudcare.cn" # 当前站点名称 envName: 观测云部署版 # 系统是否开启debug 模式,一般不开启 debug: false # 系统默认语言 defaultLanguage: "zh" # 前端访问地址前缀, 前两个花括号会被 protocol 和 hostname 占据,如需配置统一的二级地址,可直接调整此配置 frontServerUrlPrefixFormat: "{}://{}" # ExternalAPI 服务配置。 external: # 每次请求签名的有效期, 单位秒 timeliness: 60 # 旧版单账号 ak/sk 配置;保留用于兼容历史环境,等价于一组 privilege=w 的读写账号 accessKey: "" secretKey: "" # 接口操作中作为账号的邮箱名 email: "" # ExternalAPI 多账号配置,支持读写账号和只读账号分离;为空时只使用上方旧版单账号配置 # 字段说明: # name: 账号标识,仅用于日志、观测和排障;不要填写 default 这类含义不清的名称 # accessKey: 请求头 X-Df-Access-Key 使用的 AK # secretKey: 当前 AK 对应的签名 SK,不会写入日志 # privilege: 账号权限,w 表示读写账号,可访问 privilege=r/w 接口;r 表示只读账号,只可访问 privilege=r 接口 # email: 当前 ExternalAPI 账号在请求上下文中展示的邮箱;为空时回退到 external.email # enabled: 是否启用该账号,false 时该账号不可用于认证 accounts: [] # accounts: # - name: "primary-write" # accessKey: "" # secretKey: "" # privilege: "w" # email: "" # enabled: true # - name: "security-readonly" # accessKey: "" # secretKey: "" # privilege: "r" # email: "" # enabled: true # 告警策略 成员类型 可选的 通知方式 alertPolicyFixedNotifyTypes: email: enable: true # Token 默认过期时间设置 token_exp_set: # web端默认设置 4小时 front_web: 14400 # 管理后台 token 默认过期时长 manage: 7200 # API 文档是否开启, 默认关闭, 为true时表示开启。API文档路径默认为 /v1/doc; inner api 默认地址为 /v1/inner.doc apiDocPageSwitch: # 管理后台 admin: false # 前台 front: false # inner 服务 inner: false # openapi 服务 openapi: false center: false # external 服务 external: false # query_view 中链路的时间范围偏移量, 单位为 秒 BusinessQueryViewTimeOffset: 900 # 同组织跨工作空间 Trace 查询配置,默认关闭 SameOrgTraceQuerySet: # 是否允许查询同组织下非当前工作空间的 Trace 数据 enable: false # 单次查询或工作空间列表筛选允许传入的最大工作空间 UUID 数量 maxWorkspaceCount: 20 # 单次 Trace 查询显式传入 limit 时允许的最大值 maxLimit: 1000 # 单次 Trace 查询允许的最大时间窗口,单位小时 maxTimeRangeHours: 24 # 同组织工作空间简化列表接口允许的最大分页大小 workspaceListPageSizeMax: 100 # 观测云的数据库配置 database: connection: pool_size: 20 max_overflow: 100 echo: false pool_timeout: 30 # 此设置会导致池在给定的秒数过去后回收连接。它默认为-1,或者没有超时。例如,设置为 3600 表示连接将在一小时后回收。请注意,如果八小时内没有检测到连接上的任何活动,MySQL 将自动断开连接(尽管这可以通过 MySQLDB 连接本身和服务器配置进行配置)。 pool_recycle: 3600 # 布尔值,如果为 True,将启用连接池“预 ping”功能,该功能在每次结帐时测试连接的活动性 pool_pre_ping: true # 检索连接时使用 LIFO(后进先出)QueuePool而不是 FIFO(先进先出)。使用 LIFO,服务器端超时方案可以减少非高峰使用期间使用的连接数量。规划服务器端超时时,请确保使用回收(pool_recycle)或预 ping(pool_pre_ping) 策略来妥善处理过时的连接。 pool_use_lifo: true # Logger Configuration logger: filename: /logdata/business.log level: info # 每个日志文件的最大大小 max_bytes: 52428800 # 日志文件滚动的总数量 backup_count: 3 # 控制日志输出方式, 默认即输出到文件也输出到stdout output_mode_switch: file: true stdout: true # GunLogger-access, 同上 g_access_logger: filename: /logdata/g_access.log mode: a level: info max_bytes: 52428800 backup_count: 3 # 控制日志输出方式, 默认即输出到文件也输出到stdout output_mode_switch: file: true stdou # 新建工作空间时, 默认的超大日志拆分单位, 单位byte workspaceLoggingCutSizeSet: es: 10240 sls: 2048 beaver: 2048 doris: 10240 # 新建工作空间时,默认的数据保留策略 workspaceVersionSet: unlimited: # 部署版新建工作空间的默认策略配置 durationSet: rp: 30d logging: 14d keyevent: 14d tracing: 7d profiling: 7d rum: 7d # 只有 部署版 才会存在 session_replay 的单独配置 session_replay: 7d network: 2d security: 90d backup_log: 180d # 工作空间默认状态设置 WorkspaceDefaultStatsConfig: isOpenLogMultipleIndex: true # 默认创建工作空间, 自定义日志索引不开启 logMultipleIndexCount: 6 # 默认创建工作空间, 自定义日志索引数量 loggingCutSize: 10240 # 默认创建工作空间, 超大日志计数单元10KB maxSearchResultCount: 0 # 默认创建工作空间, 查询数量上限0 # es/doris索引配置默认信息 WorkspaceDefaultesIndexSettings: number_of_shards: 1 # 默认创建工作空间, 主分片数 es number_of_replicas: 1 # 默认创建工作空间, 是否开启副本 es | doris rollover_max_size: 30 # 默认创建工作空间, 分片大小 es hot_retention: 24 # 默认创建工作空间, 热数据时长 es | doris # openapi 限流设置 openapiCurrentLimitingSet: # 限流开关,默认关闭,如需使用可以设置为 true isOpen: false crontabSet: # 每分钟执行的限流次数 hour: "*" minute: "*/1" frequency: # ak 级别调用限流 100次每分钟 ak: 100 # 工作空间级别调用限流 300次每分钟 workspace: 300 # Studio 后端 CORS 白名单配置 CorsAllowOriginSet: # 是否开启 CORS Origin 白名单,默认关闭以保持兼容;开启后仅对白名单浏览器 Origin 返回 Access-Control-Allow-Origin enabled: false # 精确匹配的前端域名列表,数据格式为字符串数组,需包含协议、域名和可选端口。 # 示例:["https://console.example.com", "https://uat-console.example.com:8443"] allowedOrigins: [] # 受控通配规则列表,数据格式为字符串数组,按 Origin 字符串做通配匹配。 # 示例:["https://*.example.com"];确需放开多子域名时再配置,不建议使用 "*"。 allowedOriginPatterns: [] # 是否允许浏览器携带凭据跨域访问 allowCredentials: true # 允许的跨域请求方法 allowMethods: "GET,POST,HEAD,PATCH,PUT,OPTIONS,DELETE" # 部署版登录限制 LoginLimitSet: # 同一用户名连续登录错误重试次数 retry_times: 5 # 连续登录失败 retry_times 次后限制登录的时间,默认15分钟 exp: 900 ... ``` -------------------------------- ### Resource usage example Source: https://docs.guance.com/real-user-monitoring/harmonyos/config-rum Example of manually reporting a resource lifecycle: start, stop, and add resource data. Includes a second scenario with extended properties for start and stop. ```typescript import { FTRUMGlobalManager, ResourceParams, NetStatusBean } from '@guancecloud/ft_sdk/Index'; const resourceId = 'https://api.example.com/data'; // 场景 1: // 请求开始 FTRUMGlobalManager.getInstance().startResource(resourceId); // 请求结束后,补充请求、响应和网络性能数据。 const resourceParams = new ResourceParams(); resourceParams.setUrl(resourceId); resourceParams.setResourceStatus(200); resourceParams.setResponseContentLength(1024); resourceParams.resourceType = 'xhr'; const netStatusBean = new NetStatusBean(); netStatusBean.setResourceHostIP('192.168.1.1'); netStatusBean.setDNSTime(10000000); netStatusBean.setTcpTime(20000000); netStatusBean.setTTFB(50000000); netStatusBean.setResponseTime(100000000); FTRUMGlobalManager.getInstance().stopResource(resourceId); FTRUMGlobalManager.getInstance().addResource(resourceId, resourceParams, netStatusBean); // 场景 2:带扩展属性。以下为独立请求,使用时替换场景 1 的 startResource 和 stopResource 调用。 const startResourceProperty: Record = { request_source: new String('checkout') }; FTRUMGlobalManager.getInstance().startResource(resourceId, startResourceProperty); const stopResourceProperty: Record = { response_cache: new Boolean(false) }; FTRUMGlobalManager.getInstance().stopResource(resourceId, stopResourceProperty); ``` -------------------------------- ### Initialize Deployment Environment Source: https://docs.guance.com/deployment/Kubernetes-HA-Guide Commands to install Docker, start the local registry, and load offline images on the deployment node. ```bash # 在部署机器上安装docker服务 # 启动registry本地仓库 # 载入离线环境所需要的镜像包,并push到registry仓库 ./ezdown -D ./ezdown -X ``` -------------------------------- ### Initialize Logging Configuration Source: https://docs.guance.com/best-practices/cloud-native/opentelemetry-guance Copy the sample logging configuration file to the active configuration directory. ```bash cd /usr/local/datakit/conf.d/log cp logging.conf.sample logging-socket-4560.conf ``` -------------------------------- ### Get Member Group Request Example Source: https://docs.guance.com/open-api/member-group__get Example of how to make a GET request to retrieve a member group's details using cURL. Include your API key and the group UUID. ```bash curl 'https://openapi.guance.com/api/v1/workspace/member_group/get?groupUUID=group_xxxx32' \ -H 'DF-API-KEY: ' \ --compressed ``` -------------------------------- ### Get Dialing Task Request Example Source: https://docs.guance.com/open-api/dialing-task__get This example shows how to make a GET request to retrieve a specific dialing task using its UUID. Ensure you replace `` with your actual API key. ```curl curl 'https://openapi.guance.com/api/v1/dialing_task/dial_xxxx32/get' \ -H 'DF-API-KEY: ' \ -H 'Content-Type: application/json;charset=UTF-8' \ --compressed ``` -------------------------------- ### Initialize Prometheus Configuration Source: https://docs.guance.com/best-practices/cloud-native/opentelemetry-guance Copy the sample Prometheus configuration file to the active configuration directory. ```bash cd /usr/local/datakit/conf.d/prom cp prom.conf.sample prom-otel.conf ``` -------------------------------- ### Get Event Content Request Example Source: https://docs.guance.com/open-api/keyevent__get Example of a cURL request to fetch event content using the GET /api/v1/events/{doc_id}/get endpoint. Ensure you replace `` with your actual API key. ```bash curl 'https://openapi.guance.com/api/v1/events/E_c7jodqs24loo3v53qc30/get' \ -H 'DF-API-KEY: ' \ --compressed ``` -------------------------------- ### Install DataKit on Linux/Mac Source: https://docs.guance.com/datakit/datakit-offline-install Use this command to install DataKit on Linux or Mac by pointing the installer to an internal Nginx server. An optional HTTPS_PROXY is included in this example. ```bash DK_DATAWAY=https://openway.guance.com?token= DK_INSTALLER_BASE_URL=http://[Nginx-Server]:8080/datakit HTTPS_PROXY=http://1.2.3.4:9530 bash -c 'eval "$(curl -L ${DK_INSTALLER_BASE_URL}/install.sh)"' ``` -------------------------------- ### Disk IO Configuration Example Source: https://docs.guance.com/integrations/diskio This is a sample configuration file for the diskio input plugin. It shows optional settings for collection interval, device filtering, and metadata tagging. ```toml [[inputs.diskio]] ##(optional) collect interval, default is 10 seconds interval = '10s' ## By default, gather stats for all devices including ## disk partitions. ## Setting interfaces using regular expressions will collect these expected devices. # devices = [''^sda\d*''', '''^sdb\d*''', '''vd.*'''] ## If the disk serial number is not required, please uncomment the following line. # skip_serial_number = true ## On systems which support it, device metadata can be added in the form of ## tags. ## Currently only Linux is supported via udev properties. You can view ## available properties for a device by running: ## 'udevadm info -q property -n /dev/sda' ## Note: Most, but not all, udev properties can be accessed this way. Properties ## that are currently inaccessible include DEVTYPE, DEVNAME, and DEVPATH. # device_tags = ["ID_FS_TYPE", "ID_FS_USAGE"] ## Using the same metadata source as device_tags, ## you can also customize the name of the device through a template. ## The "name_templates" parameter is a list of templates to try to apply equipment. ## The template can contain variables of the form "$PROPERTY" or "${PROPERTY}". ## The first template that does not contain any variables that do not exist ## for the device is used as the device name label. ## A typical use case for LVM volumes is to obtain VG/LV names, ## not DM-0 names which are almost meaningless. ## In addition, "device" is reserved specifically to indicate the device name. # name_templates = ["$ID_FS_LABEL","$DM_VG_NAME/$DM_LV_NAME", "$device:$ID_FS_TYPE"] [inputs.diskio.tags] # some_tag = "some_value" # more_tag = "some_other_value" ``` -------------------------------- ### NPM install and init full RUM SDK Source: https://docs.guance.com/real-user-monitoring/web/app-access Install and initialize the full RUM SDK via NPM. The init call uses the public OpenWay configuration with site and clientToken. Replace placeholders with actual values. ```bash npm install @cloudcare/browser-rum @cloudcare/browser-core ``` ```javascript import { datafluxRum } from "@cloudcare/browser-rum" datafluxRum.init({ applicationId: "", site: "", clientToken: "", service: "web-app", env: "production", version: "1.0.0", sessionSampleRate: 100, trackUserInteractions: true }) ``` -------------------------------- ### FTUnityBridge.StartView and StopView example Source: https://docs.guance.com/real-user-monitoring/unity/app-access Starts a View with the name "TEST_VIEW_ONE" and then stops it. This is the minimal example for View tracking. ```csharp FTUnityBridge.StartView("TEST_VIEW_ONE"); FTUnityBridge.StopView(); ``` -------------------------------- ### Start Services with Docker Compose Source: https://docs.guance.com/best-practices/cloud-native/opentelemetry-simpling Command to start the demo services using docker-compose. ```bash docker-compose up -d ``` -------------------------------- ### field_values function example Source: https://docs.guance.com/dql/funcs Example usage of the field_values function to get all tag values. The result is an array type containing all values of the field. ```text // 获取所有标签值 M::metrics:(field_values(tags)) [1h] BY metric_name ``` -------------------------------- ### Service Manage Get Response Example Source: https://docs.guance.com/open-api/service-manage__get This is an example of a successful response when retrieving service management information. It includes details about the service, its catalog, and creator/updator information. ```json { "code": 200, "content": { "colour": "#40C9C9", "createAt": 1693798688, "creatorInfo": { "acntWsNickname": "", "email": "xxx", "iconUrl": "", "name": "Alibaba Cloud Monitoring Data Source", "username": "xxx" }, "service": "test", "serviceCatelog": { "Docs": [ { "link": "https://docs.guance.com", "name": "guance", "provider": "example_yun" }, { "link": "https://func.guance.com/doc", "name": "func", "provider": "example_yun" } ], "Related": { "AppId": "a138bcb0_47ef_11ee_9d75_31ea50b9d85a", "DashboardUUIDs": [ "dsbd_xxxx32", "dsbd_xxxx32" ], "Tags": [ "mysql", "test" ] }, "Repos": [ { "link": "https://www.guance.com", "name": "guance", "provider": "example_yun" }, { "link": "https://func.guance.com", "name": "func", "provider": "example_yun" } ], "Team": { "colour": "#40C9C9", "oncall": [ { "emails": [ "xxx@guance.com", "xxx@guance.com" ], "name": "example_yun", "type": "email" }, { "mobiles": [ "xxxxxxx5786", "xxxxxxx4231" ], "name": "zhuyun", "type": "mobile" }, { "name": "test", "slack": "#test", "type": "slack" } ], "service": "jinlei_1", "team": "group_xxxx32", "type": "db" } }, "type": "db", "updateAt": 1693798688, "updatorInfo": { "acntWsNickname": "", "email": "xxx", "iconUrl": "", "name": "Alibaba Cloud Monitoring Data Source", "username": "xxx" }, "uuid": "sman_xxxx32" }, "errorCode": "", "message": "", "success": true, "traceId": "TRACE-1255F7E2-9035-4696-B7EE-9DDBB2BC13D2" } ``` -------------------------------- ### List iOS build products Source: https://docs.guance.com/integrations/rum Example command to list the contents of the build directory to locate .dSYM files. ```bash $ ls -l Build/Products/Debug-iphonesimulator/ total 0 drwxr-xr-x 6 zy staff 192 8 9 15:27 Fishing.app drwxr-xr-x 3 zy staff 96 8 9 14:02 Fishing.app.dSYM drwxr-xr-x 15 zy staff 480 8 9 15:27 Fishing.doccarchive drwxr-xr-x 6 zy staff 192 8 9 13:55 Fishing.swiftmodule ``` -------------------------------- ### Initialize Node.js project Source: https://docs.guance.com/integrations/langfuse Creates a new directory and initializes a Node.js project with npm. ```bash mkdir langfuse-js-demo cd langfuse-js-demo npm init -y ``` -------------------------------- ### Get Note Details Response Example Source: https://docs.guance.com/open-api/notes__get Example JSON response when successfully retrieving note details. This response includes information about charts associated with the note. ```json { "code": 200, "content": { "charts": [ { "chartGroupUUID": "", "createAt": 1677652479, "creator": "acnt_xxxx32", "dashboardUUID": "", "deleteAt": -1, "extend": { "fixedTime": "", "settings": { "alias": [], "colors": [], "direction": "vertical", "fixedTime": "", "isTimeInterval": false, "levels": [], "openCompare": false, "openStack": false, "showFieldMapping": false, "showLine": false, "showTitle": true, "showTopSize": false, "showTopWithMetric": "", "stackContent": "group", "stackType": "time", "timeInterval": "default", "titleDesc": "", "topSize": 10, "units": [], "xAxisShowType": "groupBy" } }, "id": 3152, "isWorkspaceKeyIndicator": 0, "name": "New Chart", "queries": [ { "color": "", "datasource": "dataflux", "name": "", "qtype": "dql", "query": { "alias": "", "code": "A", "dataSource": "", "field": "", "fieldFunc": "", "fill": null, "filters": [], "funcList": [], "groupBy": [], "groupByTime": "", "indexFilter": "", "namespace": "metric", "q": "", "queryFuncs": [], "type": "simple" }, "type": "bar", "unit": "" } ], "status": 0, "type": "bar", "updateAt": 1677652479, "updator": "acnt_xxxx32", "uuid": "chrt_xxxx32", "workspaceUUID": "wksp_xxxx32" }, { "chartGroupUUID": "", "createAt": 1677652487, "creator": "acnt_xxxx32", "dashboardUUID": "", "deleteAt": -1, "extend": { "fixedTime": "", "settings": { "alias": [], "colors": [], "fixedTime": "", "isTimeInterval": false, "levels": [], "showFieldMapping": false, "showRemainingTime": true, "showTitle": true, "showYearlySLA": true, "timeInterval": "default", "titleDesc": "", "units": [] } }, "id": 3153, "isWorkspaceKeyIndicator": 0, "name": "New Chart", "queries": [ { "color": "", "datasource": "dataflux", "name": "", "qtype": "dql", "query": { "funcList": [], "q": "M::slo:(SUM(`slo_cost`)) { `slo_id` = 'monitor_xxxx32' }", "slo": { "goal": 99.99, "id": "monitor_xxxx32", "minGoal": 95, "name": "dav", "workspaceUUID": "" } }, "type": "slo", "unit": "" } ], "status": 0, "type": "slo", "updateAt": 1677652487, "updator": "acnt_xxxx32" } ] } } ``` -------------------------------- ### 复制 prom 采集器配置模板 Source: https://docs.guance.com/integrations/minio_v3 进入 DataKit 配置目录,复制 prom.conf.sample 为 prom-minio.conf,作为 MinIO 采集器的配置文件。 ```bash cd /usr/local/datakit/conf.d/samples/ cp prom.conf.sample prom-minio.conf ```