-
Notifications
You must be signed in to change notification settings - Fork 203
Add new extension yagp hooks collector #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cff1cf7
00d0798
a7c6387
8b302a2
2d9eaea
e5a2fd5
69dcbfd
11dabf1
a7a6db8
92bc2fb
2157ed9
933fe68
22a602f
0e35522
e49a598
06b6e0b
f4a5878
b5446ab
10c3c86
c866e5b
bb6aed4
95d4a39
5609141
02b53c5
d640cfc
2384337
8d2d5ee
f1acf98
c94dd1d
61b9273
0070c3f
c67de87
abd9f22
8944d7e
396d811
fc43eb5
5fd6f36
ce93949
af25547
446c58a
1299852
0562fea
8412300
da46c27
7840dcb
5287681
55a0eca
b1a2c12
4f84185
5ea67ec
424b3bd
960d549
585097e
f8cddb0
6ffe3e1
fee9b00
2a9128a
f0b5e4b
831a83d
b7c57a6
945118f
45014d9
ff28f14
0f0b821
5254e40
6979f95
9bee734
b7e496f
6a99e3f
cdd2a5c
b76c43b
f8bcb85
99aa17f
3dbafff
a0f4c33
85f2f32
0005ad0
d3963c8
c7d827f
2b993d3
d9666d7
ed603e0
55f691f
45638c3
304d36a
6d5769f
83b8b16
45aced6
869c5ea
d6173b0
cdf9ff5
5af0b20
647c2aa
30218a5
89b89aa
208366d
661caff
c808eba
b4c9cbd
97b876f
f1eea80
cd90491
8eace77
9c4029e
577ad15
5b9fd6c
6c2f8bd
211b33e
19a5811
7605825
d17e3e3
fb8688d
1befa6d
fd7b874
8fe91a1
2184c9f
291fea9
c446926
392cde8
4e3f37e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,12 @@ | |
| # to build Postgres with a different make, we have this make file | ||
| # that, as a service, will look for a GNU make and invoke it, or show | ||
| # an error message if none could be found. | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If no actual changes to Makefile, we can restore it. |
||
| # If the user were using GNU make now, this file would not get used | ||
| # because GNU make uses a make file named "GNUmakefile" in preference | ||
| # to "Makefile" if it exists. PostgreSQL is shipped with a | ||
| # "GNUmakefile". If the user hasn't run the configure script yet, the | ||
| # GNUmakefile won't exist yet, so we catch that case as well. | ||
|
|
||
|
|
||
| # AIX make defaults to building *every* target of the first rule. Start with | ||
| # a single-target, empty rule to make the other targets non-default. | ||
| all: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1365,6 +1365,13 @@ PGAC_ARG_BOOL(with, zstd, yes, [do not build with Zstandard], | |||||
| AC_MSG_RESULT([$with_zstd]) | ||||||
| AC_SUBST(with_zstd) | ||||||
|
|
||||||
| # | ||||||
| # yagp_hooks_collector | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this new extension need other dependencies? Not sure about this. If so, we can add the pre-required dependencies here. FYI. |
||||||
| # | ||||||
| PGAC_ARG_BOOL(with, yagp_hooks_collector, no, | ||||||
| [build with YAGP hooks collector extension]) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||
| AC_SUBST(with_yagp_hooks_collector) | ||||||
|
|
||||||
| if test "$with_zstd" = yes; then | ||||||
| dnl zstd_errors.h was renamed from error_public.h in v1.4.0 | ||||||
| PKG_CHECK_MODULES([ZSTD], [libzstd >= 1.4.0]) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| BasedOnStyle: LLVM | ||
| SortIncludes: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| MODULE_big = yagp_hooks_collector | ||
| EXTENSION = yagp_hooks_collector | ||
| DATA = $(wildcard *--*.sql) | ||
| REGRESS = yagp_cursors yagp_dist yagp_select yagp_utf8_trim yagp_utility yagp_guc_cache yagp_uds yagp_locale | ||
|
|
||
| PROTO_BASES = yagpcc_plan yagpcc_metrics yagpcc_set_service | ||
| PROTO_OBJS = $(patsubst %,src/protos/%.pb.o,$(PROTO_BASES)) | ||
|
|
||
| C_OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c src/*/*.c)) | ||
| CPP_OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp src/*/*.cpp)) | ||
| OBJS = $(C_OBJS) $(CPP_OBJS) $(PROTO_OBJS) | ||
|
|
||
| override CXXFLAGS = -Werror -fPIC -g3 -Wall -Wpointer-arith -Wendif-labels \ | ||
| -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv \ | ||
| -Wno-unused-but-set-variable -Wno-address -Wno-format-truncation \ | ||
| -Wno-stringop-truncation -g -ggdb -std=c++17 -Iinclude -Isrc/protos -Isrc -DGPBUILD | ||
|
|
||
| PG_CXXFLAGS += -Isrc -Iinclude | ||
| SHLIB_LINK += -lprotobuf -lpthread -lstdc++ | ||
| EXTRA_CLEAN = src/protos | ||
|
|
||
| ifdef USE_PGXS | ||
| PG_CONFIG = pg_config | ||
| PGXS := $(shell $(PG_CONFIG) --pgxs) | ||
| include $(PGXS) | ||
| else | ||
| subdir = gpcontrib/yagp_hooks_collector | ||
| top_builddir = ../.. | ||
| include $(top_builddir)/src/Makefile.global | ||
| include $(top_srcdir)/contrib/contrib-global.mk | ||
| endif | ||
|
|
||
| src/protos/%.pb.cpp src/protos/%.pb.h: protos/%.proto | ||
| @mkdir -p src/protos | ||
| sed -i 's/optional //g' $^ | ||
| sed -i 's|cloud/mdb/yagpcc/api/proto/common/|protos/|g' $^ | ||
| protoc -I /usr/include -I /usr/local/include -I . --cpp_out=src $^ | ||
| mv src/protos/$*.pb.cc src/protos/$*.pb.cpp | ||
|
|
||
| $(CPP_OBJS): src/protos/yagpcc_metrics.pb.h src/protos/yagpcc_plan.pb.h src/protos/yagpcc_set_service.pb.h | ||
| src/protos/yagpcc_set_service.pb.o: src/protos/yagpcc_metrics.pb.h |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||
| ## YAGP Hooks Collector | ||||||
|
|
||||||
| An extension for collecting greenplum query execution metrics and reporting them to an external agent. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ### Collected Statistics | ||||||
|
|
||||||
| #### 1. Query Lifecycle | ||||||
| - **What:** Captures query text, normalized query text, timestamps (submit, start, end, done), and user/database info. | ||||||
| - **GUC:** `yagpcc.enable`. | ||||||
|
|
||||||
| #### 2. `EXPLAIN` data | ||||||
| - **What:** Triggers generation of the `EXPLAIN (TEXT, COSTS, VERBOSE)` and captures it. | ||||||
| - **GUC:** `yagpcc.enable`. | ||||||
|
|
||||||
| #### 3. `EXPLAIN ANALYZE` data | ||||||
| - **What:** Triggers generation of the `EXPLAIN (TEXT, ANALYZE, BUFFERS, TIMING, VERBOSE)` and captures it. | ||||||
| - **GUCs:** `yagpcc.enable`, `yagpcc.min_analyze_time`, `yagpcc.enable_cdbstats`(ANALYZE), `yagpcc.enable_analyze`(BUFFERS, TIMING, VERBOSE). | ||||||
|
|
||||||
| #### 4. Other Metrics | ||||||
| - **What:** Captures Instrument, Greenplum, System, Network, Interconnect, Spill metrics. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - **GUC:** `yagpcc.enable`. | ||||||
|
|
||||||
| ### General Configuration | ||||||
| - **Nested Queries:** When `yagpcc.report_nested_queries` is `false`, only top-level queries are reported from the coordinator and segments, when `true`, both top-level and nested queries are reported from the coordinator, from segments collected as aggregates. | ||||||
| - **Data Destination:** All collected data is sent to a Unix Domain Socket. Configure the path with `yagpcc.uds_path`. | ||||||
| - **User Filtering:** To exclude activity from certain roles, add them to the comma-separated list in `yagpcc.ignored_users_list`. | ||||||
| - **Trimming plans:** Query texts and execution plans are trimmed based on `yagpcc.max_text_size` and `yagpcc.max_plan_size` (default: 1024KB). For now, it is not recommended to set these GUCs higher than 1024KB. | ||||||
| - **Analyze collection:** Analyze is sent if execution time exceeds `yagpcc.min_analyze_time`, which is 10 seconds by default. Analyze is collected if `yagpcc.enable_analyze` is true. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to add the new test to
build-cloudberry-rocky8.ymlor*.*-deb.ymlfile? FYI.