tidb
tidb copied to clipboard
telemetry: add telemetry related code back
This reverts commit 3d1708f80cc5f792fac3ac014786b84b578dfc8b.
What problem does this PR solve?
Issue Number: close https://github.com/pingcap/tidb/issues/61766
Problem Summary: Add telemetry related code back, it will print log to files. The code removed PR is https://github.com/pingcap/tidb/pull/51202
The output log looks like
[2025/06/17 16:23:52.465 +08:00] [INFO] [telemetry.go:67] [category=telemetry] ["telemetry data"="{\"reportTimestamp\":1750148632,\"featureUsage\":{\"txn\":{\"asyncCommitUsed\":false,\"onePCUsed\":false,\"txnCommitCounter\":{\"twoPC\":0,\"asyncCommit\":0,\"onePC\":0},\"mutationCheckerUsed\":true,\"assertionLevel\":\"FAST\",\"rcCheckTS\":false,\"rcWriteCheckTS\":false,\"fairLocking\":true,\"SavepointCounter\":0,\"lazyUniqueCheckSetCounter\":0,\"FairLockingUsageCounter\":{\"txn_fair_locking_used\":0,\"txn_fair_locking_effective\":0}},\"clusterIndex\":{},\"newClusterIndex\":{\"numClusteredTables\":0,\"numTotalTables\":1},\"temporaryTable\":false,\"cte\":{\"nonRecursiveCTEUsed\":0,\"recursiveUsed\":0,\"nonCTEUsed\":0},\"accountLock\":{\"lockUser\":0,\"unlockUser\":0,\"createOrAlterUser\":0},\"cachedTable\":false,\"autoCapture\":false,\"placementPolicy\":{\"numPlacementPolicies\":0,\"numDBWithPolicies\":0,\"numTableWithPolicies\":0,\"numPartitionWithExplicitPolicies\":0},\"nonTransactional\":{\"delete\":0,\"update\":0,\"insert\":0},\"globalKill\":true,\"multiSchemaChange\":{\"multi_schema_change_used\":0},\"exchangePartition\":{\"exchange_partition_cnt\":0},\"tablePartition\":{\"table_partition_cnt\":0,\"table_partition_list_cnt\":0,\"table_partition_range_cnt\":0,\"table_partition_hash_cnt\":0,\"table_partition_range_columns_cnt\":0,\"table_partition_range_columns_gt_1_cnt\":0,\"table_partition_range_columns_gt_2_cnt\":0,\"table_partition_range_columns_gt_3_cnt\":0,\"table_partition_list_columns_cnt\":0,\"table_partition_max_partitions_cnt\":0,\"table_partition_create_interval_partitions_cnt\":0,\"table_partition_add_interval_partitions_cnt\":0,\"table_partition_drop_interval_partitions_cnt\":0,\"table_TablePartitionComactCnt\":0,\"table_reorganize_partition_cnt\":0},\"logBackup\":false,\"enablePaging\":false,\"enableCostModelVer2\":true,\"DDLUsageCounter\":{\"add_index_ingest_used\":0,\"metadata_lock_used\":true,\"flashback_cluster_used\":0,\"dist_reorg_used\":0},\"enableGlobalMemoryControl\":true,\"autoIDNoCache\":false,\"indexMergeUsageCounter\":{\"index_merge_used\":0},\"resourceControl\":{\"resourceControlEnabled\":true,\"numResourceGroups\":1},\"ttlUsage\":{\"ttl_job_enabled\":true,\"ttl_table_count\":0,\"ttl_job_enabled_tables\":0,\"ttl_hist_date\":\"2025-06-16\",\"table_hist_with_delete_rows\":[{\"less_than\":10000,\"count\":0},{\"less_than\":100000,\"count\":0},{\"less_than\":1000000,\"count\":0},{\"less_than\":10000000,\"count\":0},{\"less_than_max\":true,\"count\":0}],\"table_hist_with_delay_time\":[{\"less_than\":1,\"count\":0},{\"less_than\":6,\"count\":0},{\"less_than\":24,\"count\":0},{\"less_than\":72,\"count\":0},{\"less_than_max\":true,\"count\":0}]},\"storeBatchCopr\":{\"batch_size\":4,\"query\":0,\"tasks\":0,\"batched\":0,\"batched_fallback\":0}},\"windowedStats\":[]}"]
What changed and how does it work?
Check List
Tests
- [x] Unit test
- [ ] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test
- [ ] I checked and no code files have been changed.
Side effects
- [ ] Performance regression: Consumes more CPU
- [ ] Performance regression: Consumes more Memory
- [ ] Breaking backward compatibility
Documentation
- [ ] Affects user behaviors
- [ ] Contains syntax changes
- [x] Contains variable changes
- [ ] Contains experimental features
- [ ] Changes MySQL compatibility
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
None
Hi @Defined2014. Thanks for your PR.
PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Codecov Report
Attention: Patch coverage is 69.66551% with 263 lines in your changes missing coverage. Please review.
Project coverage is 74.8907%. Comparing base (
9f1396b) to head (0186d6b). Report is 1 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #61753 +/- ##
================================================
+ Coverage 72.9375% 74.8907% +1.9532%
================================================
Files 1742 1794 +52
Lines 483190 492182 +8992
================================================
+ Hits 352427 368599 +16172
+ Misses 109165 100473 -8692
- Partials 21598 23110 +1512
| Flag | Coverage Δ | |
|---|---|---|
| integration | 48.7920% <29.2964%> (?) |
|
| unit | 72.1847% <69.6655%> (-0.0110%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 52.7804% <ø> (ø) |
|
| parser | ∅ <ø> (∅) |
|
| br | 63.0718% <ø> (+16.7318%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
[LGTM Timeline notifier]
Timeline:
2025-06-23 06:01:58.7005834 +0000 UTC m=+683571.423762382: :ballot_box_with_check: agreed by hawkingrei.2025-06-25 06:48:25.444477043 +0000 UTC m=+859158.167656025: :ballot_box_with_check: agreed by tangenta.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/retest
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/ok-to-test
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: bb7133, hawkingrei, tangenta, XuHuaiyu, yudongusa
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [XuHuaiyu,bb7133,hawkingrei,tangenta]
- ~~pkg/config/OWNERS~~ [yudongusa]
- ~~pkg/ddl/OWNERS~~ [tangenta]
- ~~pkg/distsql/OWNERS~~ [XuHuaiyu]
- ~~pkg/domain/OWNERS~~ [tangenta]
- ~~pkg/planner/OWNERS~~ [hawkingrei]
- ~~pkg/sessionctx/vardef/OWNERS~~ [yudongusa]
- ~~pkg/sessionctx/variable/OWNERS~~ [yudongusa]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest
/retest
/retest
/retest
/retest
/retest
/retest
/retest
/retest