Enable RUM on Kloudfuse for Google GCS :: Kloudfuse Docs
Enable RUM on Kloudfuse for Google GCS
Create Session Replay
You can store RUM session recordings in a GCS Bucket. Follow these steps to create this bucket, and note the GCS bucket name and the credential (secretKey):
- Create a new bucket.
- Create a service account on GCP IAM that has access to the bucket.
- Create a new key under this service account. This creates and downloads a credential file.
- Rename this local credential file to
secretKey. - Save for following tasks this information:
- GCS Bucket Name
- Credential file named
secretKey
- Credential file named
Create Secret for Kloudfuse Namespace
Run the following command in the cluster that runs Kloudfuse:
Create a Secret for Kloudfuse Namespace
kubectl create secret generic kfuse-rum-gcs --from-file=./secretKey
Copied!
Configure the custom-values.yaml File
- Generate a UUID by running the following command:
uuidgen | tr 'A-Z' 'a-z'
Copied!
| You must reference this UUID in the Kloudfuse frontend SDK initialization call. |
- Add a
global.rumsection to thecustom-values.yamlfile:
rum:
enabled: true
applications:
- name: kf-frontend
id: 944f6a58-dbc2-45ad-bf93-def505aaff62
sessionReplayStorage:
type: gcs
useSecret: true
secretName: kfuse-rum-gcs (1)
gcs:
bucket: rum-session-replay-playground (2)
yamlCopied!
| 1 | secretName: Secret created in Create Secret for Kloudfuse Namespace](https://docs.kloudfuse.com/platform/3.2.5/rum-enable-google-gcs/#step2). |
| 2 | bucket: GCS bucket created for session replay storage, in Create Session Replay](https://docs.kloudfuse.com/platform/3.2.5/rum-enable-google-gcs/#step1). |
- List RUM-specific Kafka topics in the
custom-values.yamlfile. Use the configuration for the events stream as a reference for the number of replicas and partitions.
- name: kf_rum_session_replay_topic
partitions: 3
replicationFactor: 2
- name: kf_rum_views_topic
partitions: 3
replicationFactor: 2
- name: kf_rum_actions_topic
partitions: 3
replicationFactor: 2
- name: kf_rum_resources_topic
partitions: 3
replicationFactor: 2
- name: kf_rum_longtasks_topic
partitions: 3
replicationFactor: 2
- name: kf_rum_errors_topic
partitions: 3
replicationFactor: 2
yamlCopied!
- Specify the TLS configuration in the
tlssection of thecustom-values.yamlfile, and ensure you use a publichost.
tls:
enabled: true (1)
host: playground.kloudfuse.io (2)
email: admin@kloudfuse.com
clusterIssuer: playground-letsencrypt-prod
yamlCopied!
| 1 | enabled: true: Enable TLS. |
| 2 | host: playground.kloudfuse.io: This host is public. |
- Specify the Ingress configuration in the
ingresssection of thecustom-values.yamlfile. RUM must have a public ingest endpoint where the frontend browser posts data.
ingress:
controller:
service:
external:
enabled: true (1)
externalTrafficPolicy: Local (2)
yamlCopied!
| 1 | Enable external ingress policy |
| 2 | Enable and specify external traffic policy. |
- Enable RUM in the
ingestersection of thecustom-values.yamlfile:
ingester:
config:
rum:
enabled: true
# you can ignore the datadog section below from the PR since
# this is the default
datadog:
proxyToDatadogEnabled: false
yamlCopied!
- To ingest frontend logs into Kloudfuse, add parsing rules in the
log-parsersection of thecustom-values.yamlfile. Include these rules verbatim, along with existing rules.
- remap:
args:
kf_additional_tags:
- "$origin"
- "$application_id"
- "$session_id"
- "$view.id"
- "$view.url"
- "$view.referrer"
- "$error.handling"
- "$error.kind"
- "$error.stack"
- "$error.message"
- "$http.method"
- "$http.status_code"
- "$http.url"
conditions:
- matcher: "__kf_agent"
value: "datadog"
op: "=="
- transform:
args:
- action: "replace"
- sourceLabels: "#ddsource"
- targetLabel: "source"
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "error.kind"
- facetName: "error_kind"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "error.stack"
- facetName: "error_stack"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "error.message"
- facetName: "error_message"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "http.method"
- facetName: "@http_method"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "http.status_code"
- facetName: "http_status_code"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "http.url"
- facetName: "http_url"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "session_id"
- facetName: "sessionid"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "application_id"
- facetName: "applicationid"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "view.url"
- facetName: "view_url"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "view.referrer"
- facetName: "view_referrer"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "view.id"
- facetName: "view_id"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "error.handling"
- facetName: "@error_handling"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
- moveLabelToFacet:
args:
- name: "origin"
- facetName: "event_origin"
- agentFacet: true
conditions:
- matcher: "#__kf_ddrum"
value: "true"
op: "=="
yamlCopied!
- Enable RUM in the
uisection of thecustom-values.yamlfile:
ui:
config:
rum:
enabled: true
yamlCopied!
- Upgrade the cluster using these changes, and ensure that all pods are active.
Instrument the Frontend Application
To set up the Frontend SDK for RUM, see instructions in RUM Setup. Here is guide to the parameters to configure for SDK initialization:
- applicationId
Must match the application id defined above under the customer yaml global.rum.applications sectionapplicationId: '<APPLICATION_ID>' - clientToken
Use the string dummy as a value if the Kloudfuse installation does not have authenticated ingest enabled. If authenticated ingestion is enabled please follow the additional instructions noted on Step 5: Enable authenticated ingest below.clientToken: '<CLIENT_TOKEN>' - site
Use empty string.site: '<SITE>' - proxy
Must be of the formproxy: '<KFUSE_RUM_ENDPOINT>'https://<customers-kfuse-hostname>/ddrumproxy. Example: Kloudfuse Playground cluster has the value ofhttps://playground.kloudfuse.io/ddrumproxy. - service
Must match the application name, and cannot contain any white space. Example: kf-frontendservice: '<APPLICATION_NAME>' - env
This value depends on the type of deployment:env: 'production'test,production,staging, and so on. - version
If the frontend application has an identifier, use a string value that represents the version. Otherwise, use the default value ofversion: '1.0.0'1.0.0. - sessionSampleRate
We recommend a small number if the site has many users.sessionSampleRate: 100 - enableSessionRecording
We recommend a value ofenableSessionRecording: truetrueto use the session capture and replay feature. - enableLogCollection
We recommend a value ofenableLogCollection: truetrueto get frontend logs into their Kloudfuse cluster.
Enable Authenticated Ingestion
(Optional)
By default, this feature is disabled.
When you enable authenticated ingestion on the Kloudfuse platform, you must enable it globally, and add authentication tokens.
Follow these steps:
- To enable ingestion authentication, set
global authConfigtotruein thecustom-values.yamlfile:
Enable Ingestion Authentication
global:
authConfig:
enabled: true (1)
yamlCopied!
| 1 | authConfig: enable |
- Generate a new authentication token:
Generate token
uuidgen | tr -d '-' | tr 'A-Z' 'a-z' | sed 's/^/pub/'
Copied!
- Configure one or more client tokens in the
ingester config rumsection of thecustom-values.yamlfile:
Configure tokens
ingester:
config:
rum:
enabled: true (1)
clientTokens: (2)
- rumauthkey1: <unique authtoken value>
- rumauthkey2: <unique authtoken value>
yamlCopied!
| 1 | enabled: Enable RUM ingestion |
| 2 | clientTokens``rumauthkey1 and rumauthkey2: Unique authentication tokens for RUM, generated in Generate token. |
- Match the generated auth tokens to the
clientTokenvalue in the frontend RUM SDK configuration:
kfuseRumSDK.init({
config: {
applicationId: '<application id>', (1)
clientToken: '<unique authtoken value>', (2)
...
}
})
javascriptCopied!
| 1 | applicationId: The identifier of the service that provides the RUM stream. |
| 2 | clientToken: Unique authentication token for RUM, generated in Generate token, matching the declarations in Configure tokens. |