Skip to main content

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.

Developer's Guide to Integrating Didit with Modern Observability Stacks

Contents

In this guide

Jump to the part you need.

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 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 Core KYC, and pay-per-use pricing lowers the 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.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Blog questions

Who writes the Didit blog?
The Didit team. Guides reviewed by Alberto Rosas, co-founder and CEO, carry his byline. The rest are published as Didit.
Which topics does the blog cover?
Eight topics: ID verification, business verification (KYB), AML, sanctions and compliance, fraud prevention, transaction monitoring and crypto, country guides, agents and developers, and product updates.
Is the blog available in my language?
Yes, in 15 languages: English, Spanish, French, German, Brazilian and European Portuguese, Catalan, Russian, Arabic, Chinese, Japanese, Hindi, Indonesian, Korean and Swahili. Not every post is translated, so each language shows the posts it has.
Where do I find product updates?
In the changelog at /changelog/ and under the Product updates topic.
Are these posts legal advice?
No. Regulation posts explain rules; your legal team decides how they apply.
How do I find posts on one topic?
Open one of the eight topics, or search the blog.
Are posts dated?
Yes. Every post shows when it was published and when it was last updated.
Do posts link to the docs?
Developer posts link to the matching page on docs.didit.me and to the API reference.
Is the blog the same as the docs?
No. The blog explains rules, markets and product changes for a general reader, while docs.didit.me holds the integration guides and the API reference. Developer posts link the matching docs page and the API reference they describe.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.