Integrations
Zipkin
Overview
This document provides a detailed guide to integrating Zipkin with Callgoose SQIBS for real-time trace analysis, incident management, and performance monitoring. The integration enables the automatic creation, updating, and resolution of incidents in Callgoose SQIBS based on trace data sent from Zipkin. The guide includes steps for configuring Zipkin to send trace data, setting up API filters in Callgoose SQIBS, and troubleshooting.
Prerequisites
- Zipkin Installation: Ensure that Zipkin is installed and configured to trace your microservices.
- Callgoose SQIBS Account: Valid access to Callgoose SQIBS with privileges to set up API filters and receive JSON payloads.
- Webhook/API Endpoint: Available in Callgoose SQIBS to receive trace data from Zipkin.
1. Obtain API Token and Endpoint Details
To integrate Zipkin with Callgoose SQIBS, you first need to obtain an API token and find the API endpoint details.
- Generate an API Token:
- Follow the guide on How to Create API Token in Callgoose SQIBS.
- Find the API Endpoint:
- Refer to the Callgoose SQIBS API Endpoint Documentation to get the endpoint details where the JSON payloads from Zipkin will be sent.
2. Debugging and Troubleshooting
You can enable debugging in the API tokens used with Zipkin trace data for troubleshooting purposes.
- Enable Debugging:
- You can update the debug value when adding or updating an API token.
- When API tracking is enabled, logs are stored in the API log section for review. Debugging will automatically disable after 48 hours.
- When API tracking is turned off, no logs are saved in the API log.
- Using API Log for Troubleshooting:
- The API log provides detailed information on all API calls made to Callgoose SQIBS.
- Check the JSON values in each API log entry for troubleshooting purposes.
- Use the API log to create or refine API filters to ensure incidents are created correctly based on the trace data received from Zipkin.
3. Configuring Zipkin to Send JSON Payloads
To configure Zipkin to generate the required JSON payloads, follow the steps outlined below. These steps will guide you through setting up Zipkin to ensure that the trace data matches what is expected by Callgoose SQIBS.
3.1 Configuring the Zipkin Reporter
To send trace data from Zipkin to Callgoose SQIBS, you need to configure Zipkin’s httpLogger to send the trace data.
- Open the Zipkin Configuration File:
- Locate and open the configuration file for Zipkin (e.g., application.yml or zipkin-server.properties).
- Modify the Reporter Settings:
- Add the HTTP reporter settings:
yaml zipkin: reporter: http: endpoint: "https://your-sqibs-api-endpoint.com/v1/trace" json: true messageMaxBytes: 5242880
- Replace https://your-sqibs-api-endpoint.com/v1/trace with your actual Callgoose SQIBS API endpoint.
- Include API Token in Headers:
- Ensure that the API token is included in the headers:
bash curl -X POST "https://your-sqibs-api-endpoint.com/v1/trace" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"traceId":"trace-id-example","name":"service-name","timestamp":1234567890}'
- Replace YOUR_API_TOKEN with the token generated in Callgoose SQIBS.
3.2 Customizing the Payload
Ensure that the JSON payload sent includes key fields like traceId, name, timestamp, and duration. For example:
json { "traceId": "$TRACE_ID", "id": "$SPAN_ID", "name": "$SERVICE_NAME", "timestamp": "$TIMESTAMP", "duration": "$DURATION" }
3.3 Test the Integration
- Perform a test to ensure the payload is correctly formatted and received by the Callgoose SQIBS API endpoint.
- Review the payload in Callgoose SQIBS to confirm that it matches the expected structure.
4. Configuring Callgoose SQIBS
4.1 Create API Filters in Callgoose SQIBS
To correctly map incidents from Zipkin traces, you need to create API filters based on the JSON payloads received.
4.1.1 Example JSON Payload from Zipkin
Trace Started (status: "running"):
json { "traceId": "123abc456", "name": "order-service", "timestamp": "2024-09-06T12:00:00.000Z", "duration": 1200 }
Trace Completed (status: "completed"):
json { "traceId": "123abc456", "name": "order-service", "timestamp": "2024-09-06T12:05:00.000Z", "duration": 1200 }
4.2 Configuring API Filters
4.2.1 Integration Templates
If there is a Zipkin integration template in the “Select Integration Template” dropdown in the API filter settings, you can use it to automatically configure the necessary filters. You can modify these values to suit your specific requirements.
4.2.2 Manually Adding/Editing Filters
- Trigger Filter (For Creating Incidents):
- Payload JSON Key: "status"
- Key Value Contains: "running"
- Map Incident With: "traceId"
- Incident Title From: "name"
- Incident Description From: Optionally, use a field like "duration".
- Resolve Filter (For Resolving Incidents):
- Payload JSON Key: "status"
- Key Value Contains: "completed"
- Incident Mapped With: "traceId"
Refer to the API Filter Instructions and FAQ for more details.
4.3 Finalizing Setup
- Save the API Filters:
- Ensure that the filters are correctly configured and saved in Callgoose SQIBS.
- Test the Integration:
- Trigger a trace in Zipkin to verify if incidents are created in Callgoose SQIBS.
- Ensure that incidents are created with the correct title, description, and mapped values.
5. Testing and Validation
5.1 Triggering Traces in Zipkin
Simulate a trace in Zipkin by calling a service. Verify that an incident is created in Callgoose SQIBS.
5.2 Resolving Traces
Resolve a trace in Zipkin and confirm that the corresponding incident is marked as resolved in Callgoose SQIBS.
6. Security Considerations
- API Security: Ensure that the Callgoose SQIBS API endpoint is correctly configured and that the API token is securely stored.
- Permissions: Verify that the webhook in Zipkin has appropriate permissions to send trace data to Callgoose SQIBS.
- Data Encryption: Ensure that data transmission between Zipkin and Callgoose SQIBS is encrypted.
7. Troubleshooting
- No Incident Created: Verify that the webhook URL in Zipkin is correct and that the JSON payload structure matches the API filters configured in Callgoose SQIBS.
- Incident Not Resolved: Ensure that the resolve filter in Callgoose SQIBS is correctly configured.
8. Conclusion
This guide provides a comprehensive overview of how to integrate Zipkin with Callgoose SQIBS for effective trace management. By following these steps, you can ensure that traces from Zipkin are automatically reflected as incidents in Callgoose SQIBS, with proper resolution tracking when the issues are resolved.
For further customization or advanced use cases, refer to the official documentation for both Zipkin and Callgoose SQIBS:
- Zipkin Documentation
- Callgoose SQIBS API Token Documentation
- Callgoose SQIBS API Endpoint Documentation
- API Filter Instructions and FAQ
- How to Send API
This documentation will guide you through the integration process, ensuring that your trace data is managed effectively within Callgoose SQIBS based on real-time traces from Zipkin.