# submit\_monitor\_indicator 方法

## 简要

向 Tencent Cloud 云监控产品上报给定无服务器云函数的自定义监控指标数据。

```python
def submit_monitor_indicator(self,
    region_id: str,
    namespace_name: str,
    function_name: str,
    indicator_name: str,
    indicator_value: int,
    function_version: str = None
)
```

## 参数

该方法的参数和参数描述如下：

| 参数                | 类型  | 必选 | 描述                                                             |
| ----------------- | --- | -- | -------------------------------------------------------------- |
| region\_id        | str | 是  | <p>无服务器云函数所在数据中心的唯一标识符。</p><p>例如：<code>ap-shanghai</code></p>  |
| namespace\_name   | str | 是  | <p>无服务器云函数所在命名空间的唯一名称。</p><p>例如：<code>default</code></p>       |
| function\_name    | str | 是  | <p>无服务器云函数的唯一名称。</p><p>例如：<code>hello</code></p>               |
| indicator\_name   | str | 是  | <p>上报的自定义指标唯一名称。</p><p>例如：<code>number\_of\_invokes</code></p> |
| indicator\_value  | int | 是  | <p>上报的自定义指标对应的数据值。</p><p>例如：<code>1</code></p>                 |
| function\_version | str | 否  | <p>无服务器云函数版本唯一名称。</p><p>例如：<code>$LATEST</code></p>            |

## 返回值

该方法没有返回值。

## 异常

该方法可能会主动引发以下异常：

#### ValueError

参数值或类型不符合预期。

## 示例

下面我们将通过一段 Python 代码向您演示如何使用该方法：

```python
function_client.submit_monitor_indicator(
    region_id = 'ap-shanghai',
    namespace_name = 'default',
    function_name = 'hello',
    indicator_name = 'number_of_invokes',
    indicator_value = 1
)
```

## 适用于

#### Tencent Cloud SDK for Python

产品软件包：tencent-cloud-sdk-serverless-functions >= 0.1.2


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/client/submit-monitor-indicator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
