Skip to main content

Install Agent

It guides you how to install the OpenTelemetry agent.

Download agent​

Execute the following command to download the agent to the instance where the OpenTelemetry Collector has been installed.

# Register package repository
$ sudo rpm -Uvh https://repo.whatap.io/centos/5/noarch/whatap-repo-1.0-1.noarch.rpm

# Install package
$ sudo yum install whatap-otel

Default agent settings​

To configure the agent, the WhaTap project's access key and collection server IP address are required. In WhaTap monitoring service, move to the project for the application product. In Management > Agent Installation, check the access key and collection server IP address for preparation.

Configuring the whatap.conf file​

Set the access key and collection server IP address in the agent configuration (whatap.conf) file.

echo "accesskey={ACCESS_KEY}" >> /usr/whatap/otel/whatap.conf 
echo "whatap.server.host={COLLECTOR_SERVER_IP_ADDRESS}" >> /usr/whatap/otel/whatap.conf

Configuring with environment variables​

You can set the access key and collection server IP address as environment variables.

WHATAP_ACCESSKEY={ACCESS_KEY}
WHATAP_SERVER_HOST={COLLECTOR_SERVER_IP_ADDRESS}
WHATAP_OTEL_GRPC_SERVER_PORT={gRPC_SERVER_LISTENING_PORT}
WHATAP_OTEL_HTTP_SERVER_PORT={HTTP_SERVER_LISTENING_PORT}
Note

If both environment variables and the whatap.conf file have been configured, the settings in the whatap.conf file take precedence.

Starting the agent​

Start the agent once the configuration is complete. On a first installation, the agent does not start automatically.

$ sudo systemctl start whatap-otel
$ sudo systemctl status whatap-otel

After changing the whatap.conf file or the environment variables, restart the agent to apply the changes.

Docker installation​

If you have the Opentelemetry Collector installed, you can run whatap-otel with a Docker container to receive data from the collector on the gRPC 6600 port or the HTTP 6601 port.

docker pull whatap/whatap-otel
docker-compose.yaml
version: '3.7'

services:
whatap_otel:
image: whatap/whatap-otel:latest

environment:
WHATAP_ACCESSKEY: x605111111111-z11111111-x1111111111m
WHATAP_SERVER_HOST: 1.1.1.1/2.2.2.2
WHATAP_OTEL_GRPC_SERVER_PORT: 6600
otel_metric_server_enabled: true
otel_log_server_enabled: true
log_stdout_enabled: true
#debug_otel_grpc_server_enabled: true

ports:
- 6600:6600
- 6601:6601

Kubernetes installation​

The following is a deployment example that creates the OpenTelemetry Collector and whatap-otel together in a single Pod.

otelcol-whatap-deploy.yaml
metadata:
name: otel-collector-deploy
spec:
replicas: 1
selector:
matchLabels:
app: otel-collector
template:
metadata:
name: otel-collector-pod
labels:
app: otel-collector
spec:
containers:
- name: otel-collector
image: otel/opentelemetry-collector-contrib:0.106.0
ports:
- containerPort: 4317 # OTLP gRPC
- containerPort: 4318 # OTLP HTTP
volumeMounts:
- name: config-volume-otelcol
mountPath: /etc/otel/config.yaml
subPath: otel-collector-config.yaml
args: ["--config", "/etc/otel/config.yaml"]
- name: whatap-otel-agent
image: whatap/whatap-otel:latest
ports:
- containerPort: 6600
env:
- name: "WHATAP_ACCESSKEY"
value: "x605111111111-z11111111-x1111111111m"
- name: "WHATAP_SERVER_HOST"
value: "1.1.1.1/2.2.2.2"
- name: "otel_metric_server_enabled"
value: "true"
- name: "otel_log_server_enabled"
value: "true"
- name: "log_stdout_enabled"
value: "true"
- name: NODE_IP
valueFrom: {fieldRef: {fieldPath: status.hostIP}}
- name: NODE_NAME
valueFrom: {fieldRef: {fieldPath: spec.nodeName}}
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: whatap.micro.enabled
value: "true"
volumes:
- name: config-volume-otelcol
configMap:
name: otelcol-config
otelcol-whatap-deploy.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: otelcol-config
data:
otel-collector-config.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
otlp:
endpoint: "127.0.0.1:6600"
tls:
insecure: true
logging:
loglevel: debug
processors:
batch:
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp, logging]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlp, logging]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp, logging]

Configuring the Opentelemetry Collector​

Configure the OTLP Exporter to forward data to whatap-otel.

otel-collector-config.yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
processors:
batch:

exporters:
logging:
# Configure the OTLP exporter to target whatap-otel.
otlp:
endpoint: 127.0.0.1:6600
tls:
insecure: true

service:
pipelines:
traces:
receivers:
- otlp
processors:
- batch
exporters:
- logging
- otlp
telemetry:
logs:
level: debug #activate debug mode
  • End point (endpoint) setting: 127.0.0.1:6600

    The default port for local agents is 6600.

  • tls.secure setting: insecure: true

  • The gzip compression settings are used by default. (gzip is used)

Sending data over HTTP​

whatap-otel receives data over HTTP (6601) as well as gRPC (6600). To send data over HTTP from the Collector, use the otlphttp exporter.

otel-collector-config.yaml
exporters:
# Set whatap-otel as the target of the otlphttp exporter.
otlphttp:
endpoint: http://127.0.0.1:6601
tls:
insecure: true

service:
pipelines:
traces:
receivers:
- otlp
processors:
- batch
exporters:
- otlphttp

The Collector appends the path for each data type to the endpoint.

PathDescription
/v1/tracesReceives trace data
/v1/metricsReceives metric data
/v1/logsReceives log data

To use HTTP, enable the otel_http_server_enabled option on the agent. For more information, see the Agent settings document.

Info

For more information about the OpenTelemetry Collector installation, see the following link.

Other platforms​

Tyk Gateway​

Enable the OpenTelemetry function of Tyk Gateway and then check the transaction information through the OpenTelemetry Collecotr.

  1. Connect the OpenTelemetry Collector to the Tyk Gateway.
tyk.conf
{
"log_level": "debug" ,
"listen_port": 8081,

...

"opentelemetry": {
"enabled": true,
"endpoint": "111.222.333.444:4317",
}
}
  1. When the whatap-otel agent is connected to the OpenTelemetry Collector, trace data is collected.

Kong Gateway​

By configuring the built-in OpenTelemetry plugin in Kong Gateway, you can monitor transaction data through the OpenTelemetry Collector.

Specify the OpenTelemetry Collector endpoint in the OpenTelemetry plugin. When the Whatap-otel agent connects to the Collector, trace data will be collected.

  1. kong.conf

    Enable trace settings.

    tracing_instrumentations = all
    tracing_sampling_rate = 1
  2. OpenTelemetry Plugin Configuration

    Register the endpoint URL of the OpenTelemetry Collector.

    The default OTLP receiver settings are as follows:

    • Example default settings

      traces_endpoint: http://otelcollector:4318/v1/traces
      logs_endpoint: http://otelcollector:4318/v1/logs
    • Example kong.yaml configuration

      plugins:
      - name: opentelemetry
      config:
      traces_endpoint: http://otelcollector:4318/v1/traces
      logs_endpoint: http://otelcollector:4318/v1/logs
      resource_attributes:
      service.name: kong-otel
    • Example plugin configuration via Admin API

      curl -X POST http://localhost:8001/services/plugins \
      --header "accept: application/json" \
      --header "Content-Type: application/json" \
      --data '
      {
      "name": "opentelemetry",
      "config": {
      "traces_endpoint": "http://otelcollector:4318/v1/traces",
      "logs_endpoint": "http://otelcollector:4318/v1/logs",
      "resource_attributes": {
      "service.name": "kong-dev"
      }
      }
      }
      '
  • Supported version: Kong Gateway 3.3.x or higher
Info

For more detailed configuration instructions, refer to the following documentation.

Starting the monitoring​

  • If the application server is restarted after all settings are made, the agent collects data. Go to the Dashboard > Application dashboard menu and then perform monitoring for the collected data in real time.

  • For more information about the agent configuration, see the following.