update agent telemetry url to be cloud function instead of posthog (#15085)
* update agent events telemetry url to be cloud function instead of posthog.
Andrew Maguire committed
May 29, 2023 at 08:54 UTC
430c0ec56a7cf0d8672e5a5ee9a73455f030b1ad
3 files changed
+7
-10
daemon/anonymous-statistics.sh.in
+3
-4
@@ -74,7 +74,6 @@ NETDATA_PREBUILT_DISTRO="${42}"
74
# define body of request to be sent
75
REQ_BODY="$(cat << EOF
76
{
77
- "api_key": "mqkwGT0JNFqO-zX2t0mW6Tec9yooaVu7xCBlXtHnt5Y",
77
"event": "${ACTION} ${ACTION_RESULT}",
78
"properties": {
79
"distinct_id": "${NETDATA_REGISTRY_UNIQUE_ID}",
@@ -164,9 +163,9 @@ REQ_BODY="$(cat << EOF
163
EOF
164
)"
165
167
-# send the anonymous statistics to the Netdata PostHog
166
+# send the anonymous statistics to Netdata
167
if [ -n "$(command -v curl 2> /dev/null)" ]; then
169
- curl --silent -o /dev/null --write-out '%{http_code}' -X POST --max-time 2 --header "Content-Type: application/json" -d "${REQ_BODY}" https://app.posthog.com/capture/
168
+ curl --silent -o /dev/null --write-out '%{http_code}' -X POST --max-time 2 --header "Content-Type: application/json" -d "${REQ_BODY}" https://us-east1-netdata-analytics-bi.cloudfunctions.net/ingest_agent_events
169
else
170
wget -q -O - --no-check-certificate \
171
--server-response \
@@ -174,5 +173,5 @@ else
173
--timeout=1 \
174
--header 'Content-Type: application/json' \
175
--body-data "${REQ_BODY}" \
177
- 'https://app.posthog.com/capture/' 2>&1 | awk '/^ HTTP/{print $2}'
176
+ 'https://us-east1-netdata-analytics-bi.cloudfunctions.net/ingest_agent_events' 2>&1 | awk '/^ HTTP/{print $2}'
177
fi
docs/anonymous-statistics.md
+3
-3
@@ -8,8 +8,8 @@ learn_rel_path: "Configuration"
8
9
# Anonymous telemetry events
10
11
-By default, Netdata collects anonymous usage information from the open-source monitoring agent using the open-source
12
-product analytics platform [PostHog](https://github.com/PostHog/posthog). We use their [cloud enterprise platform](https://posthog.com/product).
11
+By default, Netdata collects anonymous usage information from the open-source monitoring agent. For agent events like start,stop,crash etc we use our own cloud function in GCP. For frontend telemetry (pageviews etc.) on the agent dashboard itself we use the open-source
12
+product analytics platform [PostHog](https://github.com/PostHog/posthog).
13
14
We are strongly committed to your [data privacy](https://netdata.cloud/privacy/).
15
@@ -52,7 +52,7 @@ variable is controlled via the [opt-out mechanism](#opt-out).
52
## Agent Backend - Anonymous Statistics Script
53
54
Every time the daemon is started or stopped and every time a fatal condition is encountered, Netdata uses the anonymous
55
-statistics script to collect system information and send it to the Netdata PostHog via an http call. The information collected for all
55
+statistics script to collect system information and send it to the Netdata telemetry cloud function via an http call. The information collected for all
56
events is:
57
58
- Netdata version
packaging/installer/kickstart.sh
+1
-3
@@ -34,7 +34,7 @@ REPOCONFIG_RPM_URL_PREFIX="https://repo.netdata.cloud/repos/repoconfig"
34
REPOCONFIG_RPM_VERSION="2-1"
35
START_TIME="$(date +%s)"
36
STATIC_INSTALL_ARCHES="x86_64 armv7l aarch64 ppc64le"
37
-TELEMETRY_URL="https://app.posthog.com/capture/"
37
+TELEMETRY_URL="https://us-east1-netdata-analytics-bi.cloudfunctions.net/ingest_agent_events"
38
39
# ======================================================================
40
# Defaults for environment variables
@@ -63,7 +63,6 @@ else
63
fi
64
65
NETDATA_TARBALL_BASEURL="${NETDATA_TARBALL_BASEURL:-https://github.com/netdata/netdata-nightlies/releases}"
66
-TELEMETRY_API_KEY="${NETDATA_POSTHOG_API_KEY:-mqkwGT0JNFqO-zX2t0mW6Tec9yooaVu7xCBlXtHnt5Y}"
66
67
if echo "${0}" | grep -q 'kickstart-static64'; then
68
NETDATA_FORCE_METHOD='static'
@@ -267,7 +266,6 @@ telemetry_event() {
266
267
REQ_BODY="$(cat << EOF
268
{
270
- "api_key": "${TELEMETRY_API_KEY}",
269
"event": "${1}",
270
"properties": {
271
"distinct_id": "${DISTINCT_ID}",