Skip to content

Commit 9887aa2

Browse files
authored
(DOCSP-47858) Adds MEKO telemetry feature. (#2063)
* (DOCSP-47858) Adds MEKO telemetry feature. * Revises per tech review. * Revises per copy review + second-round tech review.
1 parent 6331c82 commit 9887aa2

File tree

5 files changed

+324
-0
lines changed

5 files changed

+324
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. code-block:: yaml
2+
3+
operator:
4+
telemetry:
5+
# Enables telemetry. Setting this to "false" will stop all telemetry.
6+
enabled: true
7+
# Adds RBAC clusterRole for kube-system UID detection for the Kubernetes cluster UID.
8+
# Adds RBAC clusterRole for RBAC for nodes. We are listing exactly one node to detect the cluster provider (for example, eks).
9+
# Adds RBAC clusterRole for /version query for detecting Kubernetes server version.
10+
installClusterRole: true
11+
collection:
12+
# Controls how often the Kubernetes Operator collects and saves the data to the telemetry ConfigMap. It doesn't control whether this data is sent to MongoDB for analysis.
13+
# Valid time units for frequency are "m", or "h". Anything less than one minute defaults to 1h.
14+
frequency: 1h
15+
# Enables the Kubernetes Operator to collect and send cluster-level telemetry.
16+
# Note: the cluster UUID is unique but random and MongoDB has no way to map this to a customer.
17+
clusters:
18+
enabled: true
19+
# Enables the Kubernetes Operator to collect and send deployment-level telemetry.
20+
deployments:
21+
enabled: true
22+
# Enables the Kubernetes Operator to collect and send Kubernetes Operator-level telemetry.
23+
operators:
24+
enabled: true
25+
# Enables sending the collected telemetry to MongoDB.
26+
send:
27+
enabled: true
28+
# Controls how often the Kubernetes Operator sends the collected the data to MongoDB for analysis.
29+
# Valid time units are "h". Anything less than one hour defaults to 168h, which is one week.
30+
frequency: 168h

source/reference.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Reference
5151
Databases </reference/k8s-operator-specification>
5252
Multi-Kubernetes-Clusters</reference/k8s-operator-multi-cluster-specification>
5353
Enterprise Installation Settings </reference/operator-settings>
54+
Kubernetes Operator Telemetry </reference/meko-telemetry>
5455
Exclusive Settings </reference/k8s-op-exclusive-settings>
5556
Support Lifecycle </reference/support-lifecycle>
5657
CRD Log Rotation Settings </reference/k8s-operator-crd-logging-specification>

source/reference/helm-operator-settings.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,16 @@ The default value is **mongodb-enterprise-operator**.
352352
operator:
353353
name: mongodb-enterprise-operator
354354

355+
.. _helm-meko-telemetry:
356+
357+
operator.telemetry
358+
------------------
359+
360+
Enables the |k8s-op-short| to :ref:`collect and send telemetry <meko-telemetry>`.
361+
The default for the following settings is ``true``.
362+
363+
.. include:: /includes/example-telemetry-helm.rst
364+
355365
.. _helm-vault-secret-enabled:
356366

357367
operator.vaultSecretBackend.enabled

source/reference/kubectl-operator-settings.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,53 @@ MDB_MAX_CONCURRENT_RECONCILES
565565
- name: MDB_MAX_CONCURRENT_RECONCILES
566566
value: "10"
567567

568+
.. _mdb-operator-telemetry-enabled:
569+
570+
MDB_OPERATOR_TELEMETRY_ENABLED
571+
------------------------------
572+
573+
Enables the |k8s-op-short| to :ref:`collect and send telemetry <meko-telemetry>` to MongoDB for analysis.
574+
:ref:`mdb-operator-telemetry-send-enabled` must also be set to ``true`` for the
575+
|k8s-op-short| to send telemetry to MongoDB.
576+
577+
The default is ``true``. If set to ``false``, the |k8s-op-short| doesn't collect or send telemetry to MongoDB.
578+
579+
.. code-block:: yaml
580+
:linenos:
581+
582+
spec:
583+
template:
584+
spec:
585+
serviceAccountName: mongodb-enterprise-operator
586+
containers:
587+
- env:
588+
- name: MDB_OPERATOR_TELEMETRY_ENABLED
589+
value: "true"
590+
591+
.. _mdb-operator-telemetry-send-enabled:
592+
593+
MDB_OPERATOR_TELEMETRY_SEND_ENABLED
594+
-----------------------------------
595+
596+
Enables the |k8s-op-short| to :ref:`send telemetry <meko-telemetry>` to MongoDB for analysis.
597+
:ref:`mdb-operator-telemetry-enabled` must also be set to ``true`` for the |k8s-op-short| to send telemetry.
598+
599+
The default is ``true``. If set to ``false``, the |k8s-op-short| collects telemetry
600+
in the ConfigMap named ``mongodb-enterprise-operator-telemetry``, but doesn't send
601+
it to MongoDB.
602+
603+
.. code-block:: yaml
604+
:linenos:
605+
606+
spec:
607+
template:
608+
spec:
609+
serviceAccountName: mongodb-enterprise-operator
610+
containers:
611+
- env:
612+
- name: MDB_OPERATOR_TELEMETRY_SEND_ENABLED
613+
value: "true"
614+
568615
.. _mdb-propogate-proxy-env:
569616

570617
MDB_PROPAGATE_PROXY_ENV

source/reference/meko-telemetry.txt

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
.. _meko-telemetry:
2+
3+
========================================
4+
Configure {+k8s-op-short+} Telemetry
5+
========================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
|k8s-op|'s telemetry collects anonymous, aggregate usage data to
16+
help MongoDB identify improvements with the greatest impact to customers. The
17+
{+k8s-op-short+} enables telemetry by default.
18+
19+
This telemetry data helps MongoDB:
20+
21+
* Improve product reliability and stability.
22+
* Optimize performance based on real-world cluster configurations.
23+
* Ensure smooth upgrades and simplified issue resolution.
24+
25+
{+k8s-op-short+} telemetry is separate from the data collected by the {+mdbagent+}
26+
and does not depend on |onprem|.
27+
28+
.. _meko-telemetry-tracks:
29+
30+
Learn What the {+k8s-op-short+} Tracks
31+
-----------------------------------------
32+
33+
{+k8s-op-short+} telemetry tracks
34+
non-Personally-Identifiable Information (PII), which includes but is
35+
not limited to the following information:
36+
37+
.. note::
38+
39+
This list is kept up to date in alignment with iterations to the telemetry data sent,
40+
but might not be exhaustive or include full detail. For full insight into the telemetry
41+
sent to MongoDB for analysis, see :ref:`view-meko-telemetry`.
42+
43+
.. list-table::
44+
:header-rows: 1
45+
:widths: 60 40
46+
47+
* - Data
48+
- Example Value
49+
50+
* - {+k8s-op-short+} version number
51+
- ``1.31.0``
52+
53+
* - |k8s| cluster version
54+
- ``v1.22.0``
55+
56+
* - |k8s| cluster provider
57+
- ``gke``, ``eks``, ``aks``
58+
59+
* - |k8s| UUID. This is the same as the UID of the ``kube-system`` namespace.
60+
To learn more, see the `OpenTelemetry documentation <https://opentelemetry.io/docs/specs/semconv/attributes-registry/k8s/>`__.
61+
- ``f47ac10b-58cc-4372-a567-0e02b2c3d479``
62+
63+
* - ``mongodb`` |crd| deployments and resource types. {+k8s-op-short+} telemetry
64+
does *not* track custom deployment names.
65+
- Example values:
66+
67+
- Architecture: ``static``, ``non-static``
68+
- Multi-Cluster: ``true``, ``false``
69+
- Deployment Type: ``ReplicaSet``
70+
71+
* - Self-generated {+k8s-op-short+} UUID. {+k8s-op-short+} telemetry
72+
does *not* track custom names.
73+
- ``d2d2c3e0-6666-4e83-1234-abcd5678efgh``
74+
75+
* - Telemetry send timestamps
76+
- ``2025-02-14T15:45:34.27814598Z``
77+
78+
.. _meko-telemetry-not-tracks:
79+
80+
Learn What the {+k8s-op-short+} Doesn't Track
81+
------------------------------------------------
82+
83+
{+k8s-op-short+} telemetry *doesn't* track:
84+
85+
.. list-table::
86+
:header-rows: 1
87+
:widths: 60 40
88+
89+
* - Data
90+
- Example
91+
92+
* - PII and values that could potentially contain PII, including all
93+
self-set, free-text fields such as custom names or database user
94+
names.
95+
- ``--clusterName MyCluster``
96+
97+
* - Data that could uniquely identify the company using the |k8s-op-short|.
98+
- ``<hostname>:<port>``
99+
100+
* - |api| key values or |service| login credentials.
101+
- ``private_api_key abcdefghi123456789``
102+
103+
.. _telemetry-rbac:
104+
105+
Required RBAC for MongoDB
106+
-------------------------
107+
108+
MongoDB requires specific :k8sdocs:`role-based access control (RBAC) </reference/access-authn-authz/rbac>` permissions to collect telemetry.
109+
*Do not disable these permissions*. These permissions allow MongoDB to:
110+
111+
* Retrieve the |k8s| cluster UID.
112+
* Access information for a single node to determine the cloud provider, such as EKS, GKE, or AKS.
113+
* Query the ``/version`` endpoint to detect the |k8s| server version and ensure compatibility.
114+
115+
Disabling these RBAC roles might lead to degraded functionality, compatibility issues,
116+
and reduced support effectiveness. To maintain full functionality and receive the best
117+
support experience, these permissions must remain enabled.
118+
119+
.. _view-meko-telemetry:
120+
121+
View Your Telemetry
122+
-------------------
123+
124+
To review the telemetry collected by your {+k8s-op-short+} before it sends
125+
your data to MongoDB for analysis, follow these steps:
126+
127+
.. procedure::
128+
:style: normal
129+
130+
.. step:: (Optional) Disable telemetry transmission.
131+
132+
To prevent the {+k8s-op-short+} from sending telemetry to MongoDB before you review it,
133+
set :ref:`mdb-operator-telemetry-send-enabled` to ``false``.
134+
135+
Alternatively, if you use |helm|, set :ref:`operator.telemetry.send.enabled <helm-meko-telemetry>` to ``false``.
136+
137+
.. step:: View your telemetry.
138+
139+
Your telemetry is collected in a ConfigMap named ``mongodb-enterprise-operator-telemetry``.
140+
To view this ConfigMap, replace ``<namespace>`` and run:
141+
142+
.. io-code-block::
143+
:copyable: true
144+
145+
.. input::
146+
:language: sh
147+
148+
kubectl get configmap mongodb-enterprise-operator-telemetry -n <namespace> -o yaml
149+
150+
.. output::
151+
:language: sh
152+
153+
- apiVersion: v1
154+
data:
155+
lastSendPayloadClusters: '[{"timestamp":"2025-02-14T15:45:34.27814598Z","source":"Clusters","properties": {"kubernetesAPIVersion":"v1.30.4","kubernetesClusterID":"80b25668-6732-4463-93fb-61ae0487c3e8", "kubernetesFlavour":"Unknown"}},{"timestamp":"2025-02-14T15:45:34.278149016Z","source":"Clusters","properties": {"kubernetesAPIVersion":"v1.30.4","kubernetesClusterID":"80b25668-6732-4463-93fb-61ae0487c3e8", "kubernetesFlavour":"Unknown"}}]'
156+
lastSendPayloadDeployments: '[{"timestamp":"2025-02-14T15:45:34.280318302Z","source":"Deployments","properties": {"architecture":"non-static","deploymentUID":"ff43ecfb-d244-4639-bca9-9cbbb9fbaa56","isMultiCluster":false, "operatorID":"4ae3880d-4bc5-495c-b5ea-ff9c9fc0bb34","type":"ReplicaSet"}}]'
157+
lastSendPayloadOperators: '[{"timestamp":"2025-02-14T15:45:34.270025096Z","source":"Operators","properties": {"kubernetesClusterID":"80b25668-6732-4463-93fb-61ae0487c3e8","kubernetesClusterIDs": ["80b25668-6732-4463-93fb-61ae0487c3e8"],"operatorID":"4ae3880d-4bc5-495c-b5ea-ff9c9fc0bb34","operatorType":"MEKO", "operatorVersion":"67af61832ac9680007bb966b"}}]'
158+
lastSendTimestampClusters: Initial-Value
159+
lastSendTimestampDeployments: "1739377730"
160+
lastSendTimestampOperators: "1739377728"
161+
Operator-UUID: 9cc0fb41-5142-419d-b440-baae616f66d4
162+
kind: ConfigMap
163+
metadata:
164+
name: mongodb-enterprise-operator-telemetry
165+
166+
.. note::
167+
168+
* ``lastSendPayload<type>`` is the most recently collected data
169+
for a cluster, deployment, or {+k8s-op-short+} instance.
170+
* ``lastSendTimestamp<type>`` is the date and time when the {+k8s-op-short+} last
171+
sent ``lastSendPayload<type>`` to MongoDB for analysis. If the value is
172+
``Initial-Value``, no telemetry has yet been sent to MongoDB. If you
173+
:ref:`disable telemetry <disable-meko-telemetry>`, ``Initial-Value`` never changes.
174+
175+
.. _disable-meko-telemetry:
176+
177+
Disable Telemetry for the {+k8s-op-short+}
178+
---------------------------------------------
179+
180+
The {+k8s-op-short+} enables telemetry by default. You can disable {+k8s-op-short+} telemetry
181+
in the following ways:
182+
183+
- Add the environment variable :ref:`MDB_OPERATOR_TELEMETRY_ENABLED <mdb-operator-telemetry-enabled>` to your {+k8s-op-short+} deployment
184+
configuration and set to ``false``.
185+
186+
.. code-block:: yaml
187+
188+
spec:
189+
template:
190+
spec:
191+
serviceAccountName: mongodb-enterprise-operator
192+
containers:
193+
- name: mongodb-enterprise-operator
194+
env:
195+
- name: MDB_OPERATOR_TELEMETRY_ENABLED
196+
value: "false"
197+
198+
- Alternatively, if you use |helm|, set :ref:`operator.telemetry.enabled <helm-meko-telemetry>` to ``false``.
199+
200+
.. code-block:: sh
201+
202+
helm template operator helm_chart --set operator.telemetry.enabled=false
203+
204+
.. _enable-meko-telemetry:
205+
206+
Enable Telemetry for the {+k8s-op-short+}
207+
--------------------------------------------
208+
209+
The {+k8s-op-short+} enables telemetry by default. If telemetry is
210+
currently disabled, you can enable telemetry by setting the following environment variables
211+
to ``true``, or removing the values entirely, which then defaults the settings to ``true``.
212+
213+
- Set the environment variables ``MDB_OPERATOR_TELEMETRY_ENABLED`` and
214+
``MDB_OPERATOR_TELEMETRY_SEND_ENABLED`` in your {+k8s-op-short+} deployment
215+
configuration to ``true`` or remove the values entirely, which then defaults the settings
216+
to ``true``. To learn more, see :ref:`mdb-operator-telemetry-enabled`.
217+
218+
.. code-block:: yaml
219+
220+
spec:
221+
template:
222+
spec:
223+
serviceAccountName: mongodb-enterprise-operator
224+
containers:
225+
- name: mongodb-enterprise-operator
226+
env:
227+
- name: MDB_OPERATOR_TELEMETRY_ENABLED
228+
value: "true"
229+
- name: MDB_OPERATOR_TELEMETRY_SEND_ENABLED
230+
value: "true"
231+
232+
- Alternatively, if you use |helm|, set the following settings to ``true`` or remove
233+
the values entirely, which then defaults the settings to ``true``.
234+
To learn more, see :ref:`helm-meko-telemetry`.
235+
236+
.. include:: /includes/example-telemetry-helm.rst

0 commit comments

Comments
 (0)