Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
c60053e1
未验证
提交
c60053e1
编辑于
6 months ago
作者:
Olivier Gonzalez
提交者:
GitLab
6 months ago
浏览文件
操作
下载
补丁
差异文件
Improve internal event tracking documentation
Explicit how addtional_properties should be used.
上级
6bb52325
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
doc/development/internal_analytics/internal_event_instrumentation/quick_start.md
+25
-8
25 个添加, 8 个删除
...l_analytics/internal_event_instrumentation/quick_start.md
有
25 个添加
和
8 个删除
doc/development/internal_analytics/internal_event_instrumentation/quick_start.md
+
25
−
8
浏览文件 @
c60053e1
...
@@ -78,8 +78,26 @@ track_internal_event(
...
@@ -78,8 +78,26 @@ track_internal_event(
Additional properties can be passed when tracking events. They can be used to save additional data related to given event.
Additional properties can be passed when tracking events. They can be used to save additional data related to given event.
Tracking classes have built-in properties with keys
`label`
(string),
`property`
(string) and
`value`
(numeric). It's recommended
Tracking classes already have three built-in properties:
to use these properties first.
-
`label`
(string)
-
`property`
(string)
-
`value`
(numeric)
The arbitrary naming and typing of the these three properties is due to constraints from the data extraction process.
It's recommended to use these properties first, even if their name does not match with the data you want to track.
This recommendation is particularly important if you want to leverage these attributes as
[
metric filters
](
metric_definition_guide.md#filters
)
. You can further describe what is the actual data being tracked
by using the
`description`
property in the YAML definition of the event. For an example, see
[
`create_ci_internal_pipeline.yml`
](
https://gitlab.com/gitlab-org/gitlab/-/blob/537ea367dab731e886e6040d8399c430fdb67ab7/config/events/create_ci_internal_pipeline.yml
)
:
```
ruby
additional_properties:
label:
description:
The
source
of
the
pipeline
,
e
.
g
.
a
push
,
a
schedule
or
similar
.
property
:
description:
The
source
of
the
config
,
e
.
g
.
the
repository
,
auto_devops
or
similar
.
```
Additional properties are passed by including the
`additional_properties`
hash in the
`#track_event`
call:
Additional properties are passed by including the
`additional_properties`
hash in the
`#track_event`
call:
...
@@ -88,8 +106,8 @@ track_internal_event(
...
@@ -88,8 +106,8 @@ track_internal_event(
"create_ci_build"
,
"create_ci_build"
,
user:
user
,
user:
user
,
additional_properties:
{
additional_properties:
{
label:
'scheduled'
,
label:
source
,
# The label is tracking the source of the pipeline
value:
20
property:
config_source
# The property is tracking the source of the configuration
}
}
)
)
```
```
...
@@ -100,10 +118,9 @@ If you need to pass more than three additional properties, you can use the `addi
...
@@ -100,10 +118,9 @@ If you need to pass more than three additional properties, you can use the `addi
track_internal_event
(
track_internal_event
(
"code_suggestion_accepted"
,
"code_suggestion_accepted"
,
user:
user
,
user:
user
,
additional_properties:
{
label:
editor_name
,
label:
'vsc'
,
property:
suggestion_type
,
property:
'automatic'
,
value:
suggestion_shown_duration
value:
200
,
lang:
'ruby'
,
lang:
'ruby'
,
custom_key:
'custom_value'
custom_key:
'custom_value'
}
}
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录