Shipping OpenTelemetry data to FusionReactor Cloud¶
Shipping OpenTelemetry data to FusionReactor Cloud from FusionReactorAPM on Vimeo.
Step 1: Create an otel-config.yaml file¶
For our OTel Collector we need to create an otel-config.yaml file.
Tip
Be careful with the indentation here as yaml syntax is very sensitive.
receivers:
otlp:
exporters:
otlphttp:
endpoint: "https://api.fusionreactor.io"
compression: none
headers:
authorization: "<your api key>"
prometheusremotewrite:
endpoint: "https://api.fusionreactor.io/v1/metrics"
headers:
authorization: "<your api key>"
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [prometheusremotewrite]
traces:
receivers: [otlp]
exporters: [otlphttp]
The receivers section declares that all telemetry data will be sent to the OTel collector's receiver that is running on otelcollector port 4318, using OpenTelemetry Protocol (OTLP) and HTTP format.
Tip
You can use gRPC instead of HTTP.
Step 2: Configure OTLPHTTP and Prometheus remote_write¶
Next we configure our OTLPHTTP exporter for traces, and the Prometheus remote_write for metrics. The collector sends the metric and tracing data to the endpoints - the FusionReactor Cloud - at the address api.fusionreactor.io.
Step 3: Replace credentials with API key¶
Replace both credentials under authorization here with your own API key.
Tip
To generate a new API key, go to FusionReactor Cloud > Account Settings > API Keys > Generate. Copy this key and paste it under credentials.
Step 4: Services outlined and data shipped¶
Finally, in the services section is where we bring everything together.
pipelines:
metrics:
receivers: [otlp]
exporters: [prometheusremotewrite]
traces:
receivers: [otlp]
exporters: [otlphttp]
-
Metrics and traces will be received by the OTLP receiver.
-
Metrics are then exported via Prometheus remote_write.
-
Traces are exported via the OTLPHTTP exporter.
All of the data is then shipped to the FusionReactor Cloud.
Step 5: Create OTel Docker image¶
Use this config file to create an OTel Docker image and input the following:
FROM otel/opentelemetry-collector
ADD otel-config.yaml /etc/otelcol/config.yaml
ADD otel-config.yaml /etc/otelcol/config.yaml
Step 6: Create docker-compose.yml file¶
Create a docker-compose.yml file with the following to start your Go App and your OTel Collector.
services:
gooteldemo:
image: gooteldemo
environment:
- OTEL_SERVICE_NAME=gooteldemo
- OTEL_RESOURCE_ATTRIBUTES="application=gooteldemo"
#otel
otelcollector:
image: gootelcollector
ports:
- "4318:4318"
- "8888:8888"
Step 7: Run “docker-compose up”¶
Run “docker-compose up” in the terminal to bring up your containers, starting my Go App and Telemetry collection.
View your metrics and traces¶
Navigate to FusionReactor Cloud in a browser, to access the many features available such as Dashboards, which gives us loads to get started with without needing any additional configuration.
Tip
Select Explore > Metrics in the drop-down. Then select the Metrics browser drop-down, to see the Add Counter metric that was created in the above example. Selecting Use Query will display metric information graphically.
Info
View the your trace set up in my Go App, under Explore > Traces. Select Search and choose your Service Name eg test-go-server-http. Then select Run Query and your trace will be displayed.
So, as you can see, OpenTelemetry is a powerful tool to pull metrics and traces from your servers, and this is just one example of the many implementations to use OpenTelemetry with FusionReactor.
Need more help?
Contact support in the chat bubble and let us know how we can assist.