Developer's Guide to Integrating Didit with Modern Observability Stacks
Integrating identity verification into modern observability stacks like Grafana, Loki, and Tempo is crucial for monitoring, debugging, and ensuring the reliability of your identity workflows.

Seamless IntegrationDidit's clean APIs and developer-first design allow for straightforward integration with leading observability tools such as Grafana, Loki, and Tempo.
Enhanced MonitoringBy instrumenting Didit's identity verification processes, developers can gain real-time visibility into session statuses, success rates, and potential bottlenecks.
Proactive DebuggingLeverage distributed tracing with Tempo to pinpoint issues within complex identity workflows, ensuring quick resolution and minimal user impact.
Optimized PerformanceDidit's modular and AI-native architecture, combined with robust observability, helps optimize the performance and reliability of your identity verification services, all while offering Free Core KYC.
The Criticality of Observability in Identity Verification
In today's digital landscape, identity verification is no longer a mere checkbox; it's a foundational pillar of trust and security. As businesses scale and user interactions become more complex, the underlying identity verification processes must be robust, reliable, and transparent. This is where modern observability stacks come into play. Tools like Grafana for visualization, Loki for logs, and Tempo for traces provide a comprehensive view into the health and performance of your applications. Integrating these with your identity verification platform, such as Didit, is paramount for proactive monitoring, rapid debugging, and ensuring a seamless user experience.
Without proper observability, issues like verification failures, liveness detection challenges, or slow ID Verification processes can go unnoticed, leading to frustrated users, compliance risks, and potential fraud. By instrumenting Didit's APIs, developers can transform raw verification data into actionable insights, making it easier to identify trends, diagnose problems, and continuously improve their identity workflows.
Instrumenting Didit Sessions with Logs (Loki) and Metrics (Grafana)
Didit's API-first approach makes it incredibly straightforward to integrate logging and metrics collection into your identity verification workflows. When you create a verification session using Didit's API, you receive a session_id and a status. These are crucial data points for observability.
Logging with Loki
For every call to Didit's API, especially when creating a session or receiving a webhook, you should log relevant details. Loki is an excellent choice for this due to its label-based indexing, which makes it efficient for querying. Here’s how you might approach it:
// Pseudocode for logging a session creation
const diditResponse = await didit.createSession({
workflow_id: 'your-workflow-id',
callback: 'https://yourapp.com/verification-complete',
vendor_data: 'user-123'
});
logger.info('Didit session created', {
session_id: diditResponse.session_id,
workflow_id: diditResponse.workflow_id,
status: diditResponse.status,
vendor_data: diditResponse.vendor_data,
service: 'identity-verification-service',
component: 'didit-api-integration'
});
When Didit sends webhooks notifying you of session updates (e.g., status changes, successful verification, or failures), log these events with similar detail. This allows you to search Loki for all logs related to a specific session_id or vendor_data to understand the complete lifecycle of a verification attempt. For instance, if a user experiences an issue with Didit's ID Verification failing, you can quickly filter logs to see the exact status changes and any error messages.
Metrics with Grafana
For quantitative analysis, expose metrics from your application that interact with Didit. Common metrics include:
didit_session_created_total: Counter for total sessions initiated.didit_session_status_total{status="success"}: Counter for successful verifications.didit_session_status_total{status="failed"}: Counter for failed verifications.didit_session_duration_seconds: Histogram or summary for the time taken from session creation to completion.didit_api_request_duration_seconds: Histogram for API response times.
These metrics, exposed via Prometheus and visualized in Grafana, provide dashboards that show the overall health and performance of your identity verification system. You can set up alerts for sudden drops in success rates or increases in latency, indicating potential issues with Didit's Liveness Detection or other components.
Distributed Tracing for Complex Workflows (Tempo)
Modern applications often involve multiple microservices communicating to complete a single user request. Identity verification is no exception, especially when orchestrating various checks like AML Screening, Proof of Address, and Phone & Email Verification. Distributed tracing, powered by tools like Tempo, becomes indispensable here.
When a user initiates an identity verification flow, you can start a new trace. As your application makes calls to Didit's API, and as Didit's webhooks trigger subsequent actions in your system, you should propagate trace contexts (e.g., OpenTelemetry trace IDs). This allows you to see the entire journey of a verification request across all services involved, from the frontend initiation to the final verification decision.
// Pseudocode for using OpenTelemetry with Didit API call
import { trace } from '@opentelemetry/api';
const tracer = trace.getTracer('my-app-didit-integration');
async function verifyUser(userData) {
const span = tracer.startSpan('didit.createSession');
try {
// Add relevant attributes to the span
span.setAttribute('user.id', userData.id);
span.setAttribute('workflow.id', 'your-workflow-id');
const diditResponse = await didit.createSession({
workflow_id: 'your-workflow-id',
callback: 'https://yourapp.com/verification-complete',
vendor_data: userData.id
});
span.setAttribute('didit.session_id', diditResponse.session_id);
span.setAttribute('didit.status', diditResponse.status);
span.setStatus({ code: SpanStatusCode.OK });
return diditResponse;
} catch (error) {
span.setStatus({ code: SpanStatusCode.ERROR, message: error.message });
span.recordException(error);
throw error;
} finally {
span.end();
}
}
If a user reports an issue with their Age Estimation or NFC Verification process, you can use the user's ID or session ID to search Tempo. The trace will show you exactly which service or external API call (like the Didit API) introduced latency or failed, providing invaluable insights for debugging and performance optimization.
How Didit Helps
Didit is engineered from the ground up to be developer-first, making integration with modern observability stacks not just possible, but seamless. Our modular architecture allows you to plug-and-play identity checks, each of which can be individually instrumented for superior monitoring. Didit's AI-native platform ensures that core processes like ID Verification, Passive & Active Liveness, and 1:1 Face Match & Face Search are highly performant and reliable, and our robust API design provides clear entry and exit points for your observability data.
We offer Free Core KYC, removing financial barriers to getting started with essential identity verification. Our platform generates structured identity data, which is ideal for feeding into your logging and metrics systems. Whether you're tracking the success rate of Didit's Age Estimation for compliance or monitoring the performance of our NFC Verification for high-security applications, Didit provides the transparency you need. There are no setup fees, and our pay-per-successful check model ensures you only pay for what you use, making it easy to scale your observability efforts alongside your business growth.
Ready to Get Started?
Ready to see Didit in action? Get a free demo today.
Start verifying identities for free with Didit's free tier.