We are currently building something exciting and will be launching soon. Registration is temporarily closed. Launching soon — registration temporarily closed.

Integrations / OpenTelemetry
Observability Tested reference

OpenTelemetry × Sentiqra

Capture operational metadata such as latency, status, request identifiers, taxonomy versions, and result metadata using OpenTelemetry. The reference architecture avoids recording raw submitted text by default.

Integration: OpenTelemetry spans Vendor: CNCF License: Apache 2.0 GitHub → Official Docs →

Why This Integration Matters

Operational question this answers:

"How do we monitor and trace Sentiqra calls in our observability stack?"

Every enterprise SRE and SOC team runs on observability data. If Sentiqra API calls are opaque in your OpenTelemetry stack, you lose visibility into detection latency, error rates, and the specific indicators being returned. This is table stakes for enterprise deployment - without clean OTel instrumentation, security engineers assume you don't support production observability and route to a competitor who does.

OpenTelemetry is the CNCF standard for distributed tracing, metrics, and logs. By instrumenting Sentiqra calls with OTel spans, every detection becomes traceable through your existing observability backend - Datadog, New Relic, Honeycomb, Grafana, or Jaeger. The spans capture request ID, indicator returned, signal-match score, configuration ID, and latency.

Beyond operations, the OTel spans become part of your audit trail. Every detection is now traceable through your existing observability infrastructure with the specific indicator and signal-match score attached - a compliance win, not just an ops win.

Reference Architecture

┌──────────────────────────────────────────────────────────────┐
│                   Your Application                            │
│                                                               │
│  ┌──────────┐    ┌──────────────┐    ┌──────────┐            │
│  │  Request  │───▶│ OTel Span    │───▶│ Sentiqra │            │
│  │  Handler  │    │ "sentiqra    │    │  API     │            │
│  │           │    │  .detect"    │    │          │            │
│  │           │    │              │    │          │            │
│  │           │    │ Attributes:  │    │          │            │
│  │           │    │ - text_hash  │    │          │            │
│  │           │    │ - language   │    │          │            │
│  │           │    │ - product    │    │          │            │
│  │           │    │              │    │          │            │
│  │           │◀───│ Result Attrs │◀───│          │            │
│  │           │    │ - top_signal  │    │          │            │
│  │           │    │ - confidence │    │          │            │
│  │           │    │ - latency_ms │    │          │            │
│  │           │    │ - tax_version│    │          │            │
│  └──────────┘    └──────┬───────┘    └──────────┘            │
│                         │                                      │
└─────────────────────────┼──────────────────────────────────────┘
                          │
                 ┌────────▼────────┐
                 │  OTel Collector │
                 │  (your infra)   │
                 └────────┬────────┘
                          │
          ┌───────────────┼───────────────┐
          │               │               │
     ┌────▼────┐   ┌─────▼─────┐   ┌────▼────┐
     │ Datadog │   │ Grafana / │   │ New     │
     │         │   │ Jaeger    │   │ Relic   │
     └─────────┘   └───────────┘   └─────────┘

Data flow: Your application creates an OTel span around each Sentiqra API call. The span captures request attributes (text hash, language, product) and response attributes (top group, confidence, latency, configuration ID). Spans are exported to your OTel Collector, which forwards to your existing observability backend. Sentiqra calls are now fully visible in traces, dashboards, and alerts.

Working Code

Actual, tested, copy-pasteable code. Not pseudocode. Not aspirational.

Python - OpenTelemetry + Sentiqra

import hashlib
import os
import requests
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter

# Initialise OTel
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
    BatchSpanProcessor(ConsoleSpanExporter())
)
tracer = trace.get_tracer("sentiqra.integration")

def analyze_with_tracing(text: str, language: str = "en"):
    text_hash = hashlib.sha256(text.encode()).hexdigest()[:16]

    with tracer.start_as_current_span("sentiqra.analyze") as span:
        # Request attributes
        span.set_attribute("sentiqra.text_hash", text_hash)
        span.set_attribute("sentiqra.language", language)
        span.set_attribute("sentiqra.analyzer", "trust-safety")

        response = requests.post(
            "https://sentiqra.tech/v1/analyze",
            headers={
                "Authorization": f"Bearer {os.environ['SENTIQRA_API_KEY']}",
                "Content-Type": "application/json",
            },
            json={"text": text, "language": language, "analyzers": ["trust-safety"]},
            timeout=10,
        )
        data = response.json()
        top = data["signals"][0] if data["signals"] else None

        # Response attributes - these become part of your audit trail
        span.set_attribute("sentiqra.top_signal", top["code"] if top else "")
        span.set_attribute("sentiqra.top_score", top["score"] if top else 0.0)
        span.set_attribute("sentiqra.config",
                         response.headers.get("X-Sentiqra-Analysis-Config", ""))

        return data

# Usage
data = analyze_with_tracing("you are a worthless idiot", "en")
# Span now visible in Datadog / Jaeger / Grafana with all attributes

JavaScript / Node.js - OpenTelemetry + Sentiqra

import { trace } from "@opentelemetry/api";
import crypto from "crypto";

const tracer = trace.getTracer("sentiqra.integration");

async function analyzeWithTracing(text, language = "en") {
  const textHash = crypto.createHash("sha256").update(text).digest("hex").slice(0, 16);

  return tracer.startActiveSpan("sentiqra.analyze", async (span) => {
    span.setAttribute("sentiqra.text_hash", textHash);
    span.setAttribute("sentiqra.language", language);
    span.setAttribute("sentiqra.analyzer", "trust-safety");

    try {
      const response = await fetch("https://sentiqra.tech/v1/analyze", {
        method: "POST",
        headers: {
          "Authorization": `Bearer ${process.env.SENTIQRA_API_KEY}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ text, language, analyzers: ["trust-safety"] }),
      });
      const data = await response.json();
      const top = data.signals[0];

      span.setAttribute("sentiqra.top_signal", top ? top.code : "");
      span.setAttribute("sentiqra.top_score", top ? top.score : 0.0);
      span.setAttribute("sentiqra.config",
                        response.headers.get("X-Sentiqra-Analysis-Config") ?? "");

      return data;
    } catch (err) {
      span.recordException(err);
      span.setStatus({ code: 2, message: err.message });
      throw err;
    } finally {
      span.end();
    }
  });
}

Install dependencies

# Python
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp requests

# JavaScript - only the API package is needed for manual spans like these
npm install @opentelemetry/api

# Export to your backend (examples):
# Datadog: pip install opentelemetry-exporter-datadog
# Jaeger:  pip install opentelemetry-exporter-jaeger
# OTLP:    pip install opentelemetry-exporter-otlp

Security & Compliance Posture

  • ✓
    SOC 2 Type II - CC7.2 - Monitoring: OTel spans provide evidence of continuous monitoring of detection calls, including latency, error rates, and detection outcomes.
  • ✓
    Audit Trail: Every detection is traceable with the specific indicator, signal-match score, and configuration ID attached. Spans are retained in your observability backend according to your retention policy.
  • ✓
    DSA Article 17 - Transparency: Detection traces can be exported as evidence that may support transparency reporting, showing which indicators were returned for each piece of moderated content.
  • ✓
    NIS2 Article 21 - Incident Reporting: OTel spans can provide timestamped evidence of detection events relevant to cybersecurity incident reporting requirements.
  • ✓
    Vendor Neutrality: OTel is CNCF-hosted and works with all major observability backends. No lock-in to a specific vendor's tracing format.

Deployment Notes

Latency Impact

OTel instrumentation adds <1ms per span. The overhead is negligible and the BatchSpanProcessor exports asynchronously, so tracing does not block your request path.

Span Cardinality

We recommend using text_hash (SHA-256, truncated to 16 chars) rather than the raw text as a span attribute. This prevents high-cardinality issues in your observability backend while still allowing correlation of identical requests.

Export Configuration

Configure the OTel Collector endpoint via OTEL_EXPORTER_OTLP_ENDPOINT environment variable. The same code works with any OTLP-compatible backend - no code changes needed when switching from Jaeger to Datadog or vice versa.

Error Handling

OTel exceptions are recorded on the span via span.recordException(err) and the span status is set to ERROR. This ensures failed Sentiqra calls appear as error traces in your observability dashboard, triggering alerts.

Cost Considerations

OTel is open source (Apache 2.0). The only cost is your existing observability backend ingestion. Span attributes add minimal data volume - approximately 200 bytes per Sentiqra call.

Questions about this integration?

Talk to Solutions Engineering - first response within 1 business day.

Talk to Solutions Engineering →

Related Integrations