API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Enable OpenTelemetry in API Gateway

By Amit Kumar Singh posted Wed September 25, 2024 06:33 AM

  

OpenTelemetry is an open source observability framework for distributed tracing and monitoring of distributed systems. It provides a standardized way to collect performance and observability data, which provides visibility into the performance and health of your systems. 

We can enable OpenTelemetry in API Gateway by following below steps.

PreReq

DataPower V10.6.0.1 

Create the config

  1.        Take the config below and update parameters as required and save as otel.cfg.       

                 Change the HOSTNAME and PORT in the config below to match your OTel Agent (e.g. Instana)

                 The default ports for OpenTelemetry are 4317 (grpc) or 4318(http)

                  

%if% available "otel-exporter"

otel-exporter "otel-exp"

  type http

  hostname otel-collector.cp4i.svc.cluster.local

  traces-path "/v1/traces"

  metrics-path "/v1/metrics"

  logs-path "/v1/logs"

  port 4318

http-content-type binary

  timeout 10

  processor batch

  max-queue-size 2048

  max-export-size 512

  export-delay-interval 5000

exit

%endif%

%if% available "otel-sampler"

otel-sampler "otel-samp"

  parent-based

  type always-on

exit

%endif%

%if% available "otel"

otel "api-otel"

  exporter otel-exp

  sampler otel-samp

exit

%endif%

apigw "apiconnect"

  otel api-otel

exit                 

Package Config

1.      Take the otel.cfg file and zip it to a file called otelgwextension.zip

2.      Create a manifest.json file with content provided below (replace filename with name of zip file created in step 1). 

{

            "extension": {

                        "files": [

                                    {

                                                "filename": "otelgwextension.zip",

                                                "deploy":"immediate",

                                                "type": "extension"

                                    }

                        ]

            }

}

3.      Then again create a zip file with manifest.json and zip file created in step 1.

4.      Login to API Connect Cloud Manager Admin, go to topology, select the gateway and click on configure gateway extension.

       

5.      Click on Add and upload the zip file created in step above and press save.

6.      Wait a few minutes for the extension to apply.

7.      Once gateway extension is applied, we can see the corresponding opentelemetry on API gateway.

         

  

0 comments
48 views

Permalink