Datadog integration config for Vue Storefront Cloud

Datadog integration config for Vue Storefront Cloud

Datadog is an observability service for cloud-scale applications, providing monitoring of servers, databases, tools, and services, through a SaaS-based data analytics platform. Wikipedia

In our Cloud is possible to integrate your VSF application with two Datadog components: logging and APM.

Configuration

To enable Datadog features use our API. The configuration requires the API Key which is provided by Datadog.

Example configuration:

echo '
 "datadog": {
    "logs": {
        "enabled": true
    },
    "api_key": "<your_api_key>",
    "env_var": [],
  }' | curl -s https://farmer.vuestorefront.cloud/instance/my-instance -X PATCH -H 'X-User-Id: xxxx' -H 'X-Api-Key: yyyy' --json @-

Logging

To enable the logging feature set the configuration option datadog.logs.enabled: true.

Example configuration:

echo '
 "datadog": {
    "logs": {
        "enabled": true
    },
    "api_key": "<your_api_key>",
    "env_var": [],
  }' | curl -s https://farmer.vuestorefront.cloud/instance/my-instance -X PATCH -H 'X-User-Id: xxxx' -H 'X-Api-Key: yyyy' --json @-

Regions

To switch the Datadog region you can set DD_SITE environment variable using the configuration option datadog.env_var. By default US region is used (DD_SITE=datadoghq.com). See the example below showing how to set EU region for logging using our API call.

echo '
 "datadog": {
    "logs": {
        "enabled": true
    },
    "api_key": "<your_api_key>",
    "env_var": [{"name": "DD_SITE", "value":"datadoghq.eu"}],
  }' | curl -s https://farmer.vuestorefront.cloud/instance/my-instance -X PATCH -H 'X-User-Id: xxxx' -H 'X-Api-Key: yyyy' --json @-

APM

To enable the APM feature in your VSF application firstly you have to install dd-trace module. Then enable and configure the Datadog Agent in our Cloud.

Add Datadog module

Install the Datadog module in your VSF application using npm:

npm install dd-trace --save

For the nodejs module, the Datadog Agent is available on localhost:8126.

For more information please visit Datadog tracing documentaion.

Datadog Agent

To enable and configure the Datadog Agent use our API. Enable it using config option datadog.apm.enabled: true and set valid API Key using datadog.api_key: <your_api_key>.

Example configuration:

echo '
 "datadog": {
    "apm": {
        "enabled": true
    },
    "api_key": "<your_api_key>",
    "env_var": [],
  }' | curl -s https://farmer.vuestorefront.cloud/instance/my-instance -X PATCH -H 'X-User-Id: xxxx' -H 'X-Api-Key: yyyy' --json @-

In our Cloud we use the latest version of the Datadog Agent provided as a docker image. It is being deployed as a sidecar container and is available on localhost:8126.

Regions

To switch a region you can set DD_APM_DD_URL environment variable using the configuration option datadog.env_var. By default US region is used (DD_APM_DD_URL=https://trace.agent.datadoghq.com). See the example below showing how to set the EU region for APM using our API call.

echo '
 "datadog": {
    "apm": {
        "enabled": true
    },
    "api_key": "<your_api_key>",
    "env_var": [{"name": "DD_APM_DD_URL", "value":"https://trace.agent.datadoghq.eu"}],
  }' | curl -s https://farmer.vuestorefront.cloud/instance/my-instance -X PATCH -H 'X-User-Id: xxxx' -H 'X-Api-Key: yyyy' --json @-

Other configuration options

The Datadog APM has more configuration options and all the options can be set as environment variables similar to region. For more details please visit Datadog APM documentation.