# Backend Tracing (/docs/backend-tracing) LogDrop traces your backend services: the requests they handle and their calls to databases, caches, message brokers and other services. The panel shows distributed traces, service and endpoint health (APM) and the dependency map, and requests from apps that use the LogDrop mobile SDKs continue into your backend in the same trace. A LogDrop agent (for Go and Rust, a library) runs inside your service, records its spans, removes everything that could carry personal or secret data, and sends them to LogDrop over HTTPS with a traces ingest key. A span is the record of one operation, such as a request your service handles or a call it makes to a database. The spans of one request, across all the services it passes through, form one trace. Pick the guide for your service's language. ## Languages [#languages] Each language has its own guide, with the install steps and reference pages such as settings, limits and troubleshooting. - [Java](/docs/backend-tracing/java): The LogDrop Java agent: no code changes, on Kubernetes with one pod annotation or on any JVM host with one flag. - [Node.js](/docs/backend-tracing/nodejs): The LogDrop Node.js agent: no code changes, on Kubernetes with one pod annotation or on any host through `NODE_OPTIONS`. - [Python](/docs/backend-tracing/python): The LogDrop Python agent: no code changes, on Kubernetes with one pod annotation or on any host with `logdrop-run`. - [.NET](/docs/backend-tracing/dotnet): The LogDrop .NET agent: no code changes, on Kubernetes with one pod annotation. - [PHP](/docs/backend-tracing/php): The LogDrop PHP agent: no code changes, on Kubernetes with one pod annotation. - [Go](/docs/backend-tracing/go): The LogDrop Go package: `logdrop.Start` and one line per library; on Kubernetes one pod annotation gives the settings. - [Rust](/docs/backend-tracing/rust): The LogDrop Rust crate: one `tracing` layer and one line per library; on Kubernetes one pod annotation gives the settings. ## Before you start [#before-you-start] Every language needs the same three things from LogDrop: - A LogDrop project whose plan includes HTTP monitoring, with **HTTP Logging** turned on in **Settings → App Config → HTTP Monitoring**. Otherwise LogDrop refuses the project's traces. - A **traces ingest key**, the credential your agents send traces to LogDrop with. LogDrop stores the traces in the project the key belongs to. In the panel, open **Services & APM → Credentials**, select **Create credential** and keep the **Traces** signal selected. The key is shown once: put it straight into your secret store. Creating keys needs the **Manage ingest keys** permission. See [Ingest credentials](/docs/panel/tracing/ingest-credentials). - The traces endpoint, the address your agents send traces to: `https://otel.logdrop.io`. Use one key per cluster or environment, so you can rotate or revoke one without touching the others. A project can have at most 20 active keys. > **Warning: Keep the mobile app and the backend in one project** > > LogDrop links a mobile request to its backend spans only inside one project. If your apps use the LogDrop mobile SDKs and you want one trace from the device into the backend, create the backend's ingest key in the **mobile app's project**. Journeys across projects are not supported: the app's HTTP record then finds no backend spans, and the backend's trace starts with a missing parent. ## Related guides [#related-guides] - [Tracing & APM in the panel](/docs/panel/tracing): Trace Explorer, services and endpoints, the dependency map, alerts and service levels. - [Mobile end-to-end tracing](/docs/sdk/tracing): how the LogDrop mobile SDKs start a trace on the device. # Custom Spans (/docs/backend-tracing/dotnet/custom-spans) Most services need no code: the agent traces incoming requests and calls to databases, caches, brokers and other services on its own. For business operations you want to see as their own step in a trace, add the optional `LogDrop.Api` package. ## Add the package [#add-the-package] `LogDrop.Api` gives your code an API to create spans. The agent running in your service records and sends them. The package is published on NuGet. It has no dependencies and targets .NET 8 or newer. ```bash dotnet add package LogDrop.Api --version 0.1.0-alpha1 ``` ## Add a span [#add-a-span] A custom span is a span your code starts and ends around a step of its own work, such as pricing an order. That step then shows in the trace as its own row, with its duration. ```csharp using LogDrop.Api; using (var span = LogDropTracing.StartActiveSpan("checkout.price")) { span.Attribute("order.type", "delivery"); // custom keys need LOGDROP_ALLOWED_ATTRIBUTE_KEYS=order.type total = await pricing.TotalAsync(order); } ``` The span is current inside the `using` block, so the calls inside it (database, HTTP, messaging) appear under it in the same trace, also after an `await`. It ends when the block ends. An exception thrown in a `using` block is not recorded on its own: call `span.RecordException(e)` in a `catch`, or use `InSpan`. `InSpan` and `InSpanAsync` run your code in a new span, end it when the code returns, and record an exception (its type only) before passing it on: ```csharp var receipt = await LogDropTracing.InSpanAsync("checkout.pay", span => payments.PayAsync(order)); ``` For work that does not fit in one block, start the span yourself and end it: ```csharp var span = LogDropTracing.StartSpan("import.file", LogDropSpanKind.Consumer); try { span.Run(() => ImportFile(path)); // spans started inside are its children span.Success(); } catch (Exception e) { span.RecordException(e); throw; } finally { span.End(); } ``` ## Attributes and events [#attributes-and-events] Attributes add detail to a span as key and value pairs, such as `order.type` with the value `delivery`. Events mark a named moment inside a span, such as `payment.authorized`. What you add follows these rules: - A custom attribute is sent only when its key is listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` (comma-separated, at most 128 keys). A key starts with a letter and has at most 128 letters, digits, `_`, `.` or `-`. - Keys that contain `authorization`, `cookie`, `token`, `secret`, `password`, `credential`, `api_key`, `apikey` or `api-key` are always dropped, even when listed. - Values are `string`, `long`, `double` or `bool`. Text is cut to `LOGDROP_MAX_STRING_LENGTH` characters (256 by default). - Use constant event names, without request or user data: `span.Event("payment.authorized")`. - `RecordException` records only the exception type, for example `System.InvalidOperationException`, never its message or stack trace. - Span names are at most 256 characters and not empty. ## Other calls [#other-calls] The package also has calls to send pending spans, check the agent's status, switch the ingest key and work with the current span. Use them, for example, to send a batch job's spans before it exits. | Call | What it does | |---|---| | `LogDropTracing.Flush(timeout)` | Sends the spans that ended before the call, for example before a batch job exits. Returns `false` when it did not finish in time, an export failed, or no agent is attached. The timeout is more than 0 and at most 60 seconds | | `LogDropTracing.ExportStatus()` | Counts of exported, failed, rejected (refused as invalid, or dropped before sending because LogDrop would refuse them), pending, refused (over the active-span limit) and active spans, and whether the agent is attached | | `LogDropTracing.UpdateIngestCredential(key)` | Uses this key for later requests, without a restart, until the key file changes again | | `LogDropTracing.IsAgentAttached` | Whether the LogDrop .NET agent runs in this process | | `LogDropTracing.CurrentSpanContext` | The trace and span ID of the current span, or `null` | | `StartActiveSpan(name, kind, links)`, `StartSpan(name, kind, links)` | `kind` is `Internal` (default), `Server`, `Client`, `Producer` or `Consumer`; `links` points at related spans by their context | ## Without the agent [#without-the-agent] The package sends nothing to LogDrop by itself. Without the agent every call is safe and records nothing: spans and `InSpan` still run your code, `Flush` returns `false`, `ExportStatus()` reports that no agent is attached, and `UpdateIngestCredential` throws `InvalidOperationException`. # What LogDrop Records (/docs/backend-tracing/dotnet/data-collected) The agent removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. It applies the same rules as the Java, Node.js and Python agents. ## What a span carries [#what-a-span-carries] A span records one operation of your service, such as a request it handles or a query it sends, with its timing and result. The spans of one request across your services form a trace. Each span the agent sends can carry: - Route templates as ASP.NET Core declares them, such as `GET /orders/{id:int}`, HTTP methods and status codes. - Error types, for example an exception type such as `System.InvalidOperationException`, or a status code. - The hosts and ports your service calls. - Database systems, database names and operations; messaging systems, operations and destinations; RPC operation names. - SQL statements only as value-free templates, such as `SELECT id, total FROM orders WHERE id = ?`: every literal in the statement is replaced by `?` before it leaves the process. - Redis command names, such as `GET` or `INCRBY`, never their keys or values. - Your service's identity: service, service group, release, environment and instance. - Where it runs: the cluster, namespace, node, workload, pod and container. - [Custom attributes](/docs/backend-tracing/dotnet/custom-spans#attributes-and-events), only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, full URLs and query strings, request and response bodies, SQL values, Redis keys, message bodies, exception messages and stack traces. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. Command lines and environment variables never leave the process. The agent sends traces only: OpenTelemetry's own metrics and log collection are turned off. ## What is traced [#what-is-traced] These rules decide which operations the agent turns into spans. - Every span is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/dotnet/limits) applies instead. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced, together with the spans they cause. Other health checks are. # .NET (/docs/backend-tracing/dotnet) LogDrop traces .NET services without code changes. On Kubernetes, one pod annotation adds the LogDrop .NET agent to your pods; your images stay as they are. The agent is a distribution of OpenTelemetry .NET automatic instrumentation with LogDrop's plugin. It records the requests your service handles and its calls to databases, caches, message brokers and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. It removes the same data as the [Java](/docs/backend-tracing/java), [Node.js](/docs/backend-tracing/nodejs) and [Python](/docs/backend-tracing/python) agents, so a request that crosses services in these languages appears as one trace. Current release: LogDrop .NET agent `0.1.0-alpha1` (the image `registry.logdrop.io/logdrop-dotnet-agent` and the NuGet package `LogDrop.Api` `0.1.0-alpha1`) and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you install the agent, check that you have the LogDrop project and key, and that your platform, .NET version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - Kubernetes 1.28 or newer with Helm 3.8 or newer. The agent image `0.1.0-alpha1` runs on linux/amd64 nodes only. - **.NET 8, 9 or 10 on Linux.** They are tested on Debian-based images (the default) and on Alpine images, which need one more pod annotation. .NET Framework and Windows containers are not supported. - Traced libraries: the ones OpenTelemetry .NET automatic instrumentation v1.19.1 supports, among them ASP.NET Core, `HttpClient`, gRPC (`Grpc.Net.Client`), SQL Server (`Microsoft.Data.SqlClient`, `System.Data.SqlClient`), PostgreSQL (`Npgsql`), MySQL (`MySqlConnector`, `MySql.Data`), Entity Framework Core, MongoDB, Redis (`StackExchange.Redis`), RabbitMQ (`RabbitMQ.Client`) and Kafka (`Confluent.Kafka`). - Not supported: a service that already runs another APM's .NET profiler (for example Datadog, New Relic or Dynatrace). A process can load only one profiler, so such pods are left untraced. - Outside Kubernetes the agent is not packaged in this release. ## Install the agent [#install-the-agent] This release installs the agent on Kubernetes only, with the LogDrop Helm chart. - [Kubernetes](/docs/backend-tracing/dotnet/kubernetes): Install the LogDrop Helm chart and opt workloads in with one pod annotation. ## Reference [#reference] These pages hold the details behind the install guide. Use them to add your own spans, change a setting, plan for limits or fix a problem. - [Custom spans](/docs/backend-tracing/dotnet/custom-spans): Add spans for business operations with the optional `LogDrop.Api` package. - [Agent settings](/docs/backend-tracing/dotnet/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/dotnet/limits): What LogDrop accepts per request, per key and per project. - [Rotate the ingest key](/docs/backend-tracing/dotnet/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/dotnet/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/dotnet/verify): Check the signatures of the agent image, the chart and the NuGet package. - [Licences](/docs/backend-tracing/dotnet/licences): The licences of the agent and the API package. - [Troubleshooting](/docs/backend-tracing/dotnet/troubleshooting): Agent messages and what to do about them. # Rotate the Ingest Key (/docs/backend-tracing/dotnet/key-rotation) Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every agent that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] Rotating replaces the traces ingest key your agents use with a new one, for example before the old key expires. Follow these steps for a planned rotation: 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the agent re-reads the file every 10 seconds. Services that pass the key in `LOGDROP_INGEST_KEY` instead of the file need a restart. 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no agent logs `LogDrop rejected the ingest key`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] These points describe how agents react when a key changes or is revoked. - An agent whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - A running service can also switch keys in code with `LogDropTracing.UpdateIngestCredential(key)` from `LogDrop.Api`; see [Custom spans](/docs/backend-tracing/dotnet/custom-spans#other-calls). - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/dotnet/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: dotnet` is created, the injector adds an init container that copies the LogDrop .NET agent into the pod and sets the .NET startup hook and profiler variables, with the `LOGDROP_*` settings on your container. Your images and code stay unchanged. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [.NET requirements](/docs/backend-tracing/dotnet#requirements). Java, Node.js, Python, .NET, Go, PHP and Rust services use the same chart, the same values and the same key Secret: if you already trace services in another language, upgrade the chart to `0.1.1-alpha15` and go to [step 3](#3-opt-a-workload-in). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the agent sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the agent reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` The chart pulls the agent image (`registry.logdrop.io/logdrop-dotnet-agent`) and the injector's runtime from `registry.logdrop.io` by digest; see [Verify what you install](/docs/backend-tracing/dotnet/verify). One image serves .NET 8, 9 and 10, in Debian-based and Alpine application images. The `0.1.0-alpha1` agent image is built for linux/amd64 only: pods on arm64 nodes are not supported yet. With these values the chart installs one small webhook pod, the trace injector, and nothing else. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods are instrumented. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: dotnet` (or `java`, `nodejs`, `python`, `go`, `php`, `rust`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.dotnet.image` | LogDrop's published agent, by digest | Set your own repository and digest (or tag) when you mirror images. Do not clear it: pods are then skipped with `dotnet agent image not configured` | | `tracing.dotnet.imagePullSecrets` | empty | Pull Secrets for the agent image. They must exist in every traced namespace | | `tracing.dotnet.resources` | requests 10m / 16Mi, limits 100m / 64Mi | The init container that copies the agent. Your container keeps its own resources | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without tracing | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector adds the agent only to pods whose template carries the annotation `logdrop.io/trace: dotnet`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: dotnet # needed with requirePodLabel: true annotations: logdrop.io/trace: dotnet logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional logdrop.io/libc: musl # only for Alpine-based images ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: dotnet` | Opts the pod in. `dotnet`, `java`, `nodejs`, `python`, `go`, `php` and `rust` are supported; any other value is skipped with a status | | `logdrop.io/libc` | `glibc` (the default) or `musl`. Set `musl` for Alpine-based images | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to trace. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the agent is added when a pod is created. The injector sets these variables on the container: - `DOTNET_STARTUP_HOOKS`: the agent's startup hook goes **first**; if the container sets the variable in its `env`, your hooks are kept after the agent's. - The CLR profiler (`CORECLR_ENABLE_PROFILING`, `CORECLR_PROFILER`, `CORECLR_PROFILER_PATH`) for the pod's C library, the agent's plugin, and OpenTelemetry's own exporters, metrics and logs turned off. These are set even where the container has its own values. > **Warning: Alpine images need logdrop.io/libc: musl** > > The agent's profiler is built for one C library. Debian and Ubuntu images use glibc, the default; Alpine images use musl and need the annotation `logdrop.io/libc: musl`. With the wrong one, the profiler cannot load: your service runs normally, but untraced, and the log has no `[logdrop-agent]` line. Check the image's base before you opt the workload in: > > ```bash > docker run --rm --entrypoint cat /etc/os-release | grep '^ID=' > ``` > > `ID=alpine` needs the annotation; `debian` or `ubuntu` does not. A container that already configures a CLR profiler in its `env` (another APM) is skipped, because a process can load only one profiler. A profiler set only in your image (`ENV CORECLR_PROFILER=…` in a Dockerfile) is not seen by the injector and is replaced by the agent's. Check the image before you opt the workload in: ```bash docker image inspect --format '{{range .Config.Env}}{{println .}}{{end}}' | grep -E '^(CORECLR_|DOTNET_STARTUP_HOOKS=)' ``` ## 4. Check it [#4-check-it] Check that the injector added the agent to the new pods. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the agent is in. The container log then shows one line from the agent: ```text [logdrop-agent] INFO LogDrop .NET agent 0.1.0-alpha1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The agent was added | | `skipped: unsupported language` | The annotation value is not `dotnet`, `java`, `nodejs`, `python`, `go`, `php` or `rust`. On a `dotnet` pod: the installed chart is older than `0.1.1-alpha12`; upgrade it | | `skipped: dotnet agent image not configured` | Your values clear `tracing.dotnet.image`. Remove that override | | `skipped: another CLR profiler is configured` | The container's `env` sets `CORECLR_ENABLE_PROFILING`, `CORECLR_PROFILER` or `CORECLR_PROFILER_PATH` (another APM). Remove that APM, or do not opt the workload in | | `skipped: invalid logdrop.io/libc` | Use `glibc` (the default) or `musl` | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: DOTNET_STARTUP_HOOKS uses valueFrom` | The container takes `DOTNET_STARTUP_HOOKS` from a ConfigMap or Secret, which the injector never rewrites. Set it as a literal `value` | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume names, or the paths `/logdrop-agent` or `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section lists the network access the injector and the traced pods need, and the storage tracing uses in each pod. Check it when your cluster restricts network traffic, or when pods get no `trace-status` annotation. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: dotnet} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the agent starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories and no persistent volumes. The agent keeps the spans waiting to be sent in memory (at most 2,048 by default) and drops new spans when that queue is full. Each traced pod gets an `emptyDir` volume, limited to 64 MiB, that holds the agent's files (about 20 MB). ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** tracing and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot instrument is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected agent fits into your pods. Check them before you opt production workloads in. - `DOTNET_STARTUP_HOOKS` set only in the image is replaced by the pod-level value. Set your own hooks in the container's `env`; they are kept after the agent's. - `LOGDROP_*` variables that the container already sets win over the injected ones. - The agent sends traces only. OpenTelemetry's own exporters, metrics and log collection stay off, also where the container sets `OTEL_*` variables for them. - If the profiler cannot load (for example the wrong `logdrop.io/libc`), OpenTelemetry turns all instrumentation off and your service runs untraced; it never fails because of the agent. - Containers added by webhooks that run after the injector are not instrumented. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. Running pods keep the agent they started with until they are restarted, so roll your workloads to pick up a new agent version. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; instrumented pods keep their copy of the agent until they restart. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/dotnet/licences) The LogDrop .NET agent combines OpenTelemetry .NET automatic instrumentation, under the Apache License 2.0, with LogDrop's own parts, under the LogDrop Client Library License 1.0. ## LogDrop.Api package [#logdropapi-package] `LogDrop.Api` is licensed under the [LogDrop Client Library License 1.0](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.0.txt). In short, you may use it to send telemetry to LogDrop and include it, unmodified, in your applications; you may not modify it or distribute it on its own. The licence text is the authoritative version. The package carries it as `LICENSE`. ## LogDrop .NET agent [#logdrop-net-agent] The agent image is a distribution of OpenTelemetry .NET automatic instrumentation v1.19.1: - Its release bundles are included unmodified, without debug symbols, under the Apache License 2.0 (`LICENSE-OpenTelemetry`). The OpenTelemetry .NET packages and their dependencies keep their own licences (see the agent's `NOTICE`). - The LogDrop parts (`LogDrop.Agent.dll` and `LogDrop.Agent.Core.dll`: its plugin, its pipeline and its privacy rules) are under the LogDrop Client Library License 1.0 (`LICENSE-LogDrop.txt`). ## Licence versions [#licence-versions] The current release carries version 1.0 of the LogDrop Client Library License. Later releases carry [version 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt), which names the LogDrop agents and libraries of every language; its other terms are the same. Each release is under the version it carries. # Limits (/docs/backend-tracing/dotnet/limits) The agent keeps every request inside LogDrop's limits on its own. You only need these numbers if you change the agent's settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the agent sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The agent splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The agent drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Agent settings](/docs/backend-tracing/dotnet/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The agent retries for a few seconds, then drops the batch | | Active spans per process | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits count per key and per project, so they decide how many busy processes can share one key and one project. At the default settings, a .NET process sends a request about once a second while it has traffic, and one request per 128 spans when it records more than 128 spans a second. So one key carries about ten busy processes, or about 1,280 spans a second, and one project about fifty processes, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a process with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. # Agent Settings (/docs/backend-tracing/dotnet/settings) The LogDrop .NET agent is configured only with `LOGDROP_*` environment variables, the same settings as the Java agent. On Kubernetes the trace injector sets the required ones for you. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` / `LOGDROP_INGEST_KEY` | none | The traces ingest key, from a file (re-read every 10 seconds) or from a variable. Set one, not both | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it | Instance ID in APM | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated [custom attribute](/docs/backend-tracing/dotnet/custom-spans#attributes-and-events) keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA | | `LOGDROP_ENABLED` | `true` | `false` turns the agent off | | `LOGDROP_DEBUG` | `false` | Agent diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long spans wait before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_COMPRESSION` | `gzip` | `gzip` or `none` | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release and the pod's identity from the chart values and the pod's annotations, and adds the agent through `DOTNET_STARTUP_HOOKS` and the CLR profiler. Variables you set on the container win over the injected `LOGDROP_*` ones. See [Kubernetes](/docs/backend-tracing/dotnet/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The application always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own exporter, endpoint, sampler, header-capture and resource settings (`OTEL_*` variables) have no effect on what the agent sends: it always exports to LogDrop, never samples, propagates W3C trace context, never captures headers and sends only LogDrop's resource attributes. The injector sets the `OTEL_*` variables the agent needs, also where the container sets them itself. Configure the agent with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/dotnet/troubleshooting) The agent writes its messages to standard error with the prefix `[logdrop-agent]`. Each warning is logged at most once a minute per process, and no message ever contains the ingest key. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. | You see | Do this | |---|---| | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/dotnet/kubernetes#4-check-it)) and roll the pod | | `trace-status: skipped: unsupported language` on a `dotnet` pod | The installed chart is older than `0.1.1-alpha12` and does not know .NET. Upgrade the chart and roll the pod | | `trace-status: skipped: another CLR profiler is configured` | The container sets the variables of another .NET profiler (another APM). Only one profiler can run in a process: remove that APM, or do not opt the workload in | | No `trace-status` annotation and no `[logdrop-agent]` line | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `trace-status: injected`, a line from `[StartupHook]` that the CLR profiler was not loaded, and no `[logdrop-agent]` line | The profiler does not match the image's C library: an Alpine image without `logdrop.io/libc: musl`, or a Debian or Ubuntu image with it ([Kubernetes, step 3](/docs/backend-tracing/dotnet/kubernetes#3-opt-a-workload-in)). Fix the annotation and roll the pod. The service runs untraced until then | | `trace-status: injected` but no `[logdrop-agent]` line and no `[StartupHook]` line | Something replaced `DOTNET_STARTUP_HOOKS` after the injector, for example a start script that sets it, or the container's process is not a .NET application | | `ERROR LogDrop tracing is disabled: the agent could not start.` | Contact LogDrop support with the .NET version and, with `LOGDROP_DEBUG=true`, the lines that follow | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` naming a setting | The named setting is invalid. Fix it and restart | | `[logdrop-agent] INFO LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | Set the endpoint (`tracing.endpoint`) | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` is missing in that namespace, or empty | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The agent keeps the previous key until you fix it | | `LogDrop rejected the ingest key (HTTP 401).` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/dotnet/kubernetes) | | `LogDrop refused traces for this project (HTTP 403).` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `LogDrop rate-limited trace export (HTTP 429).` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/dotnet/limits)), or the project's trace storage is used up. Those batches are dropped | | `LogDrop is not reachable. Trace export failed.` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall, proxy or DNS). Before it warns, the agent resends a batch that could not connect for about 20 seconds, so a few seconds of network set-up while a pod starts lose nothing | | `LogDrop refused a trace batch as invalid (HTTP 400).` | Usually a clock far off (spans that start more than 5 minutes ahead), a `LOGDROP_MAX_*` setting above LogDrop's limits, or an outdated agent. The batch is dropped and counted as rejected in `LogDropTracing.ExportStatus()` | | `LogDrop rejected trace export (HTTP ).` | Any other answer. For 502, 503 and 504 the agent has already retried for a few seconds. If it persists, contact LogDrop support with the time and the code | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once, often spans that custom code never ends | | Requests appear without a route, or database spans are missing | The framework or the database client is not in the [traced libraries](/docs/backend-tracing/dotnet#requirements) | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If no trace appears and the agent logs none of the messages above, go through this checklist. 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The agent uses a key with the **Traces** signal whose status is **Active**. 3. The agent reports success: `logdrop.io/trace-status: injected` and its start line ([Check it](/docs/backend-tracing/dotnet/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the agent's default is `production`). 5. The agent's log shows no refusal from the table above. # Verify What You Install (/docs/backend-tracing/dotnet/verify) LogDrop signs the .NET agent image and its Helm chart with cosign, using its own key. The image also carries a CycloneDX SBOM. ## Image and chart [#image-and-chart] A signature check shows that the agent image, its SBOM (the list of software in the image) and the chart come from LogDrop and were not changed. Run it before you deploy, or let an admission policy in your cluster check the image. The signatures are not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub # The agent image (the image the chart uses by digest), its SBOM, and the chart. cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/logdrop-dotnet-agent:0.1.0-alpha1 cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true --type cyclonedx \ registry.logdrop.io/logdrop-dotnet-agent:0.1.0-alpha1 cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Admission policies that verify images in your cluster need the same two settings: LogDrop's public key, and the transparency log check turned off. The charts `0.1.1-alpha12` to `0.1.1-alpha15` use the agent image by digest: `registry.logdrop.io/logdrop-dotnet-agent@sha256:f3c20df38156b0c59286c3395f410963fb44c0a51b92524db991ff69ceee73ee`. ## NuGet package [#nuget-package] `LogDrop.Api` is published on nuget.org by the LogDrop organization, and nuget.org signs every package it serves. To check a downloaded package: ```bash dotnet nuget verify --all LogDrop.Api.0.1.0-alpha1.nupkg ``` To pin exactly what you restore, turn on NuGet lock files (`true` in your project) and restore with `--locked-mode` in CI: the lock file records each package's content hash, and a restore that gets a different package fails. # Custom Spans (/docs/backend-tracing/go/custom-spans) The libraries you wrap already record incoming requests and calls to databases, caches, brokers and other services. For business operations you want to see as their own step in a trace, add a custom span with the same `logdrop` package. ## Add a span [#add-a-span] Start a span where the operation begins, pass its context to the calls inside the operation, and end the span when the operation ends: ```go ctx, span := logdrop.StartSpan(ctx, "checkout.price") defer span.End() span.Attribute("order.type", "delivery") // custom keys need LOGDROP_ALLOWED_ATTRIBUTE_KEYS=order.type total, err := pricing.Total(ctx, order) // calls that get ctx appear under the span if err != nil { span.RecordError(err) return err } span.Success() ``` `StartSpan` returns a context that carries the new span: pass it to the calls inside the operation (database, HTTP, messaging) and they appear under it in the same trace. The span ends when you call `End`. `InSpan` runs your function in a new span, ends it when the function returns, records a returned error (its type only) and, on a panic, records it and panics again: ```go err := logdrop.InSpan(ctx, "checkout.pay", func(ctx context.Context, span *logdrop.Span) error { return payments.Pay(ctx, order) }) ``` For a span of another kind, or one that points at related spans: ```go ctx, span := logdrop.StartSpan(ctx, "import.file", logdrop.WithKind(logdrop.KindConsumer), logdrop.WithLinks(batchContext)) ``` `Kind` is `KindInternal` (the default), `KindServer`, `KindClient`, `KindProducer` or `KindConsumer`. ## Attributes and events [#attributes-and-events] An attribute is a key and value on a span, such as `order.type` = `delivery`. An event marks a named moment inside a span, such as `payment.authorized`. These rules apply to both, and to a span's errors, status and name: - A custom attribute is sent only when its key is listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` (comma-separated, at most 128 keys). A key starts with a letter and has at most 128 letters, digits, `_`, `.` or `-`. - Keys that contain `authorization`, `cookie`, `token`, `secret`, `password`, `credential`, `api_key`, `apikey` or `api-key` are always dropped, even when listed. - Values are a `string`, a `bool`, an integer or a float; other values are ignored. Text is cut to `LOGDROP_MAX_STRING_LENGTH` characters (256 by default). - Use constant event names, without request or user data: `span.Event("payment.authorized")`. - `RecordError` records only the error's type, for example `*fs.PathError`, never its message. - `Success` and `Error` set the span's status without an error. - Span names are at most 256 characters and not empty; a span with another name records nothing. ## Other calls [#other-calls] Besides spans, the package has calls to send queued spans, read its state and switch the ingest key without a restart. A batch job, for example, calls `logdrop.Flush` before it exits. | Call | What it does | |---|---| | `logdrop.Flush(timeout)` | Sends the spans that ended before the call, for example before a batch job exits. Returns `false` when it did not finish in time, an export failed, or tracing does not run. The timeout is more than 0 and at most one minute | | `logdrop.ExportStatus()` | Counts of exported, failed, rejected (refused as invalid, or dropped before sending because LogDrop would refuse them), pending, refused (over the active-span limit) and active spans, and whether tracing runs (`AgentAttached`) | | `logdrop.UpdateIngestCredential(key)` | Uses this key for later requests, without a restart, until the key file changes again. Returns `ErrNotAttached`, `ErrInvalidCredential` or `ErrClosed` when it cannot | | `logdrop.IsAgentAttached()` | Whether tracing runs in this process | | `logdrop.CurrentSpanContext(ctx)` | The trace and span ID of the span in `ctx`, and whether there is one | | `span.Context()` | The trace and span ID of this span, for example to link to it | | `logdrop.Shutdown()` | Sends the spans still queued, for at most 10 seconds, and stops tracing. The function `logdrop.Start` returns is the same | ## Without tracing [#without-tracing] Without settings, or before `logdrop.Start`, every call is safe and records nothing: spans and `InSpan` still run your code, `Flush` returns `false`, `ExportStatus()` reports that tracing does not run, and `UpdateIngestCredential` returns `ErrNotAttached`. # What LogDrop Records (/docs/backend-tracing/go/data-collected) The package removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. It applies the same rules as the Java, Node.js, Python and .NET agents, tested against the same cases. ## What a span carries [#what-a-span-carries] A span is one operation: a request your service handles, or a call it makes to a database, cache, message broker or another service. Besides its duration and whether it failed, a span carries: - Route templates as your router declares them, such as `GET /orders/{id}`, HTTP methods and status codes. - Error types, for example a Go error type such as `*fs.PathError`, or a status code. - The hosts and ports your service calls. - Database systems, database names and operations; messaging systems, operations and destinations; RPC operation names. - SQL statements only as value-free templates, such as `SELECT id, total FROM orders WHERE id = ?`: every literal in the statement is replaced by `?` before it leaves the process. - Redis command names, such as `GET` or `INCRBY`, never their keys or values. - Your service's identity: service, service group, release, environment and instance. - Where it runs: the cluster, namespace, node, workload, pod and container. - [Custom attributes](/docs/backend-tracing/go/custom-spans#attributes-and-events), only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, full URLs and query strings, request and response bodies, SQL values, Redis keys and values, message keys and bodies, error messages and stack traces. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. Command lines and environment variables never leave the process. The package sends traces only: it records no metrics and no logs. ## What is traced [#what-is-traced] These rules decide which operations are recorded as spans and which are left out. - Every span is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/go/limits) applies instead. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced, together with the spans they cause. Other health checks are. # Go (/docs/backend-tracing/go) LogDrop traces Go services with the LogDrop Go package. A Go binary cannot load an agent at run time, so your service adds the package, starts it in `main` and wraps the libraries it uses, one line each. On Kubernetes, one pod annotation then gives it its settings. The package is OpenTelemetry Go with LogDrop's pipeline. It records the requests your service handles and its calls to databases, caches, message brokers and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. It removes the same data as the [Java](/docs/backend-tracing/java), [Node.js](/docs/backend-tracing/nodejs), [Python](/docs/backend-tracing/python) and [.NET](/docs/backend-tracing/dotnet) agents, so a request that crosses services in these languages appears as one trace. Current release: LogDrop Go package `0.1.0-alpha2` (the Go module `github.com/initialcodess/LogDrop-Go-Agent` `v0.1.0-alpha2`) and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you add the package, check that you have the LogDrop project and key, and that your platform, Go version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - **Go 1.26 or newer** (OpenTelemetry Go 1.47 needs it). - On Kubernetes: Kubernetes 1.28 or newer with Helm 3.8 or newer. Go services run on any node architecture: there is no agent image. - Traced libraries, one line each ([Add the package](/docs/backend-tracing/go/install#2-wrap-the-libraries-you-use)): `net/http` (server and client, including chi and gorilla/mux), Gin, Echo v4 and v5, gRPC, `database/sql` (PostgreSQL, MySQL, SQL Server, SQLite and other drivers), pgx v5, go-redis v9, Kafka (`segmentio/kafka-go`) and RabbitMQ (`amqp091-go`). - Not supported: a service that sets up its own OpenTelemetry tracer provider. The package then stays off and says so; the service runs untraced. ## Set it up [#set-it-up] Add the package to your service first. Then give it its settings with the guide for where the service runs: on Kubernetes through the LogDrop chart and one pod annotation, elsewhere through environment variables. - [Add the package](/docs/backend-tracing/go/install): `go get`, `logdrop.Start` in `main` and one line per traced library. - [Kubernetes](/docs/backend-tracing/go/kubernetes): Install the LogDrop Helm chart; one pod annotation gives the service its settings. - [Other hosts](/docs/backend-tracing/go/other-hosts): Virtual machines, Docker and other platforms: set the settings as environment variables. ## Reference [#reference] These pages hold the details behind the set-up guides. Use them to add your own spans, change a setting, plan for limits or fix a problem. - [Custom spans](/docs/backend-tracing/go/custom-spans): Add spans for business operations. - [Settings](/docs/backend-tracing/go/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/go/limits): What LogDrop accepts per request, per key and per project. - [Rotate the ingest key](/docs/backend-tracing/go/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/go/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/go/verify): How Go checks the module, and the signature of the chart. - [Licences](/docs/backend-tracing/go/licences): The licence of the package and of what it uses. - [Troubleshooting](/docs/backend-tracing/go/troubleshooting): Package messages and what to do about them. # Add the Package (/docs/backend-tracing/go/install) Three changes to your service: add the module, call `logdrop.Start` at the beginning of `main`, and add one line for each library you want traced. Without settings the package does nothing, so the same build runs traced and untraced. ## 1. Add the package and start it [#1-add-the-package-and-start-it] Add the module to your service, then start the package at the beginning of `main`. Starting it sets up tracing for the whole process; the libraries you wrap in step 2 record into it. ```bash go get github.com/initialcodess/LogDrop-Go-Agent@v0.1.0-alpha2 ``` ```go import "github.com/initialcodess/LogDrop-Go-Agent/logdrop" func main() { defer logdrop.Start()() // reads LOGDROP_*; sends what is still queued when main returns mux := http.NewServeMux() mux.HandleFunc("GET /orders/{id}", getOrder) log.Fatal(http.ListenAndServe(":8080", logdrop.Handler(mux))) } ``` `logdrop.Start` reads the [settings](/docs/backend-tracing/go/settings), sets OpenTelemetry's global tracer provider and the W3C trace context and baggage propagators, and writes one start line. Call it before the code that creates servers, clients and database pools. The function it returns sends the spans still queued, for at most 10 seconds, when `main` returns. A service that stops through `os.Exit` or `log.Fatal` skips deferred calls: call `logdrop.Shutdown()` before it if the last spans matter. Without settings, with invalid settings or with `LOGDROP_ENABLED=false`, the service runs untraced, with one line on standard error that says why. No call of the package ever fails your service. ## 2. Wrap the libraries you use [#2-wrap-the-libraries-you-use] A span is one operation: a request your service handles, or a call it makes to a database, cache, message broker or another service. A Go binary cannot load an agent at run time, so the package sees only the libraries you wrap. Add the line for each library your service uses. The libraries outside the LogDrop modules use their own OpenTelemetry instrumentation; LogDrop's pipeline removes what they record the same way. | Library | Line | |---|---| | `net/http` server (`ServeMux`) | `http.ListenAndServe(addr, logdrop.Handler(mux))` | | chi | `router.Use(logdrop.Middleware(logdrop.RouteFrom(func(r *http.Request) string { return chi.RouteContext(r.Context()).RoutePattern() })))` | | gorilla/mux | `router.Use(otelmux.Middleware("orders"))` | | Gin | `router.Use(otelgin.Middleware("orders"))` | | Echo v4 or v5 | `e.Use(echootel.NewMiddleware("orders"))` | | Outgoing HTTP | `client := logdrop.HTTPClient()`, or `Transport: logdrop.Transport(nil)` on your own `http.Client` | | gRPC | Server: `grpc.NewServer(grpc.StatsHandler(otelgrpc.NewServerHandler()))`. Client: `grpc.NewClient(target, grpc.WithStatsHandler(otelgrpc.NewClientHandler()))` | | `database/sql` | `db, err := logdropsql.Open("pgx", dsn)` instead of `sql.Open` (or `logdropsql.OpenDB` instead of `sql.OpenDB`) | | pgx v5 pool | `config.ConnConfig.Tracer = otelpgx.NewTracer()` | | go-redis v9 | `logdropredis.Instrument(rdb)` | | Kafka (`segmentio/kafka-go`) | `logdropkafka.WriteMessages(ctx, writer, messages...)` and `logdropkafka.Process(ctx, message, handle)` | | RabbitMQ (`amqp091-go`) | `logdropamqp.Publish(ctx, ch, exchange, key, false, false, msg)` and `logdropamqp.Process(ctx, delivery, handle)` | `"orders"` stands for your service name; LogDrop uses `LOGDROP_SERVICE` either way. The packages for these lines: | Package | Module | |---|---| | `logdrop`, `logdropsql` | `github.com/initialcodess/LogDrop-Go-Agent` | | `logdropredis` | `github.com/initialcodess/LogDrop-Go-Agent/logdropredis@v0.1.0-alpha2` | | `logdropkafka` | `github.com/initialcodess/LogDrop-Go-Agent/logdropkafka@v0.1.0-alpha2` | | `logdropamqp` | `github.com/initialcodess/LogDrop-Go-Agent/logdropamqp@v0.1.0-alpha2` | | `otelmux`, `otelgin`, `otelgrpc` | `go.opentelemetry.io/contrib/instrumentation/…` (`github.com/gorilla/mux/otelmux`, `github.com/gin-gonic/gin/otelgin`, `google.golang.org/grpc/otelgrpc`), `v0.72.0` | | `echootel` | `github.com/labstack/echo-otel/v4` or `github.com/labstack/echo-otel/v5` | | `otelpgx` | `github.com/exaring/otelpgx` | Redis, Kafka and RabbitMQ are separate modules, so a service that does not use them gets none of their dependencies. Use the OpenTelemetry contrib packages at `v0.72.0` or newer, the release that matches OpenTelemetry Go 1.47. ### Things to know [#things-to-know] These details decide whether a call is recorded, how it is named and whether it joins the request's trace. - **Pass the request's `context.Context` on.** A database query, Redis command or outgoing call joins the request's trace only when it gets the request's context (`r.Context()`, `c.Request.Context()` in Gin, `c.Request().Context()` in Echo). - **chi** needs the middleware inside the router, as above: chi sets its route pattern only while it routes, so a handler around the router sees no route. - **pgx** records queries only inside a request or a [custom span](/docs/backend-tracing/go/custom-spans); a query outside both is not traced. - **database/sql**: `logdropsql` names the database system from the driver name (`pgx`, `postgres`, `mysql`, `sqlserver`, `sqlite3`, …). For another driver, pass `logdropsql.WithSystem("postgresql")`. The span name is the SQL operation, such as `SELECT`; the statement is sent only as a value-free template. - **go-redis**: commands that set up a connection (`AUTH`, `HELLO`, `CLIENT`, `SELECT`, `READONLY`) are not traced, only the commands your code sends. - **Kafka and RabbitMQ**: the producer line puts the trace in the message headers, and `Process` continues it, so the consumer's work appears in the same trace as the request that sent the message. ## 3. Give it its settings [#3-give-it-its-settings] The package does nothing until it has its settings: at least the traces endpoint, the ingest key and the service name. How you give them depends on where the service runs. - On Kubernetes, one pod annotation does it: [Kubernetes](/docs/backend-tracing/go/kubernetes). - Elsewhere, set the `LOGDROP_*` environment variables: [Other hosts](/docs/backend-tracing/go/other-hosts). # Rotate the Ingest Key (/docs/backend-tracing/go/key-rotation) Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every service that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] Rotating replaces the ingest key your services send with, for example before it expires. Both keys work until you revoke the old one in step 4, so no traces are lost. 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the package re-reads the file every 10 seconds. Outside Kubernetes, replace the content of the key file (`LOGDROP_INGEST_KEY_FILE`); the package picks it up within 10 seconds. Services that pass the key in `LOGDROP_INGEST_KEY` instead of a file need a restart. 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no service logs `LogDrop rejected the ingest key`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] These points describe how running services pick up a new key, and what cannot be undone. - A service whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - A running service can also switch keys in code with `logdrop.UpdateIngestCredential(key)`; see [Custom spans](/docs/backend-tracing/go/custom-spans#other-calls). - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/go/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: go` is created, the injector mounts the ingest key and sets the `LOGDROP_*` settings and the pod's identity on your container. The LogDrop Go package in your service reads them at start. There is no init container and no agent image. You need a service that [starts the LogDrop Go package](/docs/backend-tracing/go/install), a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start). Java, Node.js, Python, .NET, Go, PHP and Rust services use the same chart, the same values and the same key Secret: if you already trace services in another language, upgrade the chart to `0.1.1-alpha15` and go to [step 3](#3-opt-a-workload-in). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the package sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the package reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` With these values the chart installs one small webhook pod, the trace injector, and nothing else; its runtime comes from `registry.logdrop.io` by digest ([Verify what you install](/docs/backend-tracing/go/verify)). Go needs no value of its own: `go` is always accepted. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods get settings. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: go` (or `java`, `nodejs`, `python`, `dotnet`, `php`, `rust`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without settings, so untraced | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector gives settings only to pods whose template carries the annotation `logdrop.io/trace: go`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: go # needed with requirePodLabel: true annotations: logdrop.io/trace: go logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: go` | Opts the pod in. `go`, `java`, `nodejs`, `python`, `dotnet`, `php` and `rust` are supported; any other value is skipped with a status | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to give the settings to. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the settings are added when a pod is created. The annotation alone traces nothing: the service must call `logdrop.Start` ([Add the package](/docs/backend-tracing/go/install)). A Go service without the package runs as before, with the settings unused. ## 4. Check it [#4-check-it] Check that the injector gave the new pods their settings. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the settings are in. The container log then shows one line from the package: ```text [logdrop-agent] INFO LogDrop Go agent 0.1.0-alpha2 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The settings were added | | `skipped: unsupported language` | The annotation value is not `go`, `java`, `nodejs`, `python`, `dotnet`, `php` or `rust`. On a `go` pod: the installed chart is older than `0.1.1-alpha13`; upgrade it | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume name, or the path `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section covers the network access tracing needs and the storage it uses in each traced pod. You need it when your cluster restricts traffic with NetworkPolicies. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: go} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the package starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories, no persistent volumes and no extra volume besides the key mount. The package keeps the spans waiting to be sent in memory (at most 2,048 by default) and drops new spans when that queue is full. ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** settings, so untraced, and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot handle is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected settings fit into your pods. Check them before you opt in production workloads. - `LOGDROP_*` variables that the container already sets win over the injected ones. - The package sends traces only. A service that sets up its own OpenTelemetry tracer provider keeps it, and the package stays off. - Containers added by webhooks that run after the injector get no settings. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. A new version of the package arrives with your next build (`go get github.com/initialcodess/LogDrop-Go-Agent@`), not with the chart. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; running pods keep their settings until they restart, and restarted pods run untraced. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/go/licences) The LogDrop Go package is under the LogDrop Client Library License 1.1. The open-source modules it uses keep their own licences. ## LogDrop Go package [#logdrop-go-package] The modules `github.com/initialcodess/LogDrop-Go-Agent`, `…/logdropredis`, `…/logdropkafka` and `…/logdropamqp` are licensed under the [LogDrop Client Library License 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt). In short, you may use them to send telemetry to LogDrop and build them, unmodified, into your applications; you may not modify them or distribute them on their own. The licence text is the authoritative version. Each module carries it as `LICENSE`. The source is public because Go modules are distributed as source; that does not make it open source. ## Modules it uses [#modules-it-uses] Go downloads these as separate modules, each with its own licence, among them: - OpenTelemetry Go and its contrib instrumentation (`go.opentelemetry.io/otel`, `go.opentelemetry.io/contrib/…`): Apache License 2.0. - `github.com/XSAM/otelsql` (for `database/sql`): Apache License 2.0. - `github.com/dlclark/regexp2` (used to remove values from SQL statements): MIT. - The go-redis, kafka-go and amqp091-go instrumentation in the separate modules uses those libraries' own packages under their licences. `go list -m -json all` in your service lists every module with its version; licence scanners read their licence files from the module cache. ## Licence versions [#licence-versions] `v0.1.0-alpha2` and later carry version 1.1 of the LogDrop Client Library License, which names the LogDrop agents and libraries of every language and allows the Go modules, which are published as source, to be compiled from their unmodified source. `v0.1.0-alpha1` carries version 1.0; use `v0.1.0-alpha2` or later. # Limits (/docs/backend-tracing/go/limits) The package keeps every request inside LogDrop's limits on its own. You only need these numbers if you change its settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the package sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The package splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The package drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Settings](/docs/backend-tracing/go/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The package retries for a few seconds, then drops the batch | | Active spans per process | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits apply per key and per project, so they decide how many processes can share one key and one project. At the default settings, a Go process sends a request about once a second while it has traffic, and one request per 128 spans when it records more than 128 spans a second. So one key carries about ten busy processes, or about 1,280 spans a second, and one project about fifty processes, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a process with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. # Other Hosts (/docs/backend-tracing/go/other-hosts) Outside Kubernetes you give the service its settings as environment variables. The service must [start the LogDrop Go package](/docs/backend-tracing/go/install); nothing else is installed on the host. ## 1. Put the ingest key in a file [#1-put-the-ingest-key-in-a-file] The traces ingest key is the credential the package sends traces to LogDrop with. Keep the key in a file that only the service's user can read, not in a variable on a command line: ```bash sudo install -d -m 0750 -o root -g /etc/logdrop printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then printf '%s' "$LOGDROP_TRACE_KEY" | sudo install -m 0440 -o root -g /dev/stdin /etc/logdrop/trace-ingest-key else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` The package re-reads the file every 10 seconds, so you can [rotate the key](/docs/backend-tracing/go/key-rotation) without a restart. ## 2. Set the settings and start the service [#2-set-the-settings-and-start-the-service] The package reads its settings from `LOGDROP_*` environment variables when the service starts. Set them wherever your service gets its environment: in the shell that starts it, in a systemd unit or in a container. ```bash export LOGDROP_ENDPOINT=https://otel.logdrop.io export LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key export LOGDROP_SERVICE=orders export LOGDROP_ENVIRONMENT=production export LOGDROP_RELEASE=1.4.2 # optional ./orders ``` With systemd, put the same settings in the unit: ```ini title="/etc/systemd/system/orders.service.d/logdrop.conf" [Service] Environment=LOGDROP_ENDPOINT=https://otel.logdrop.io Environment=LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key Environment=LOGDROP_SERVICE=orders Environment=LOGDROP_ENVIRONMENT=production ``` With Docker, mount the key file read-only and pass the settings: ```bash docker run -d --name orders \ -v /etc/logdrop/trace-ingest-key:/run/secrets/trace-ingest-key:ro \ -e LOGDROP_ENDPOINT=https://otel.logdrop.io \ -e LOGDROP_INGEST_KEY_FILE=/run/secrets/trace-ingest-key \ -e LOGDROP_SERVICE=orders -e LOGDROP_ENVIRONMENT=production \ ``` Every setting is listed in [Settings](/docs/backend-tracing/go/settings). ## 3. Check it [#3-check-it] The service's standard error shows one line from the package: ```text [logdrop-agent] INFO LogDrop Go agent 0.1.0-alpha2 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute, and the service in **Services** within about two minutes. ## Things to know [#things-to-know] These points describe how the package fits into your host's network and your service's processes. Check them before you run traced services in production. - The host needs outgoing HTTPS (port 443) to `otel.logdrop.io`. The package does not use `HTTP_PROXY` or `HTTPS_PROXY`: it connects directly. - Outside Kubernetes each process gets a new instance ID when it starts. Set `LOGDROP_SERVICE_INSTANCE_ID` to keep one per host. - A batch job that exits right after its work should call `logdrop.Flush(5 * time.Second)` before it returns, or rely on the deferred `logdrop.Start()()` in `main`. # Settings (/docs/backend-tracing/go/settings) The LogDrop Go package is configured only with `LOGDROP_*` environment variables, the same settings as the other LogDrop agents. On Kubernetes the trace injector sets the required ones for you. The package reads them once, in `logdrop.Start`. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` / `LOGDROP_INGEST_KEY` | none | The traces ingest key, from a file (re-read every 10 seconds) or from a variable. Set one, not both | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it; elsewhere new for each process | Instance ID in APM | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated [custom attribute](/docs/backend-tracing/go/custom-spans#attributes-and-events) keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA | | `LOGDROP_ENABLED` | `true` | `false` turns the package off | | `LOGDROP_DEBUG` | `false` | Diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long spans wait before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_COMPRESSION` | `gzip` | `gzip` or `none` | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release and the pod's identity from the chart values and the pod's annotations. Variables you set on the container win over the injected `LOGDROP_*` ones. See [Kubernetes](/docs/backend-tracing/go/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The service always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own settings (`OTEL_*` variables) have no effect on what the package sends: it always exports to LogDrop, never samples, propagates W3C trace context and baggage, never captures headers and sends only LogDrop's resource attributes. Configure it with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/go/troubleshooting) The package writes its messages to standard error with the prefix `[logdrop-agent]`. Each warning is logged at most once a minute per process, and no message ever contains the ingest key. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. | You see | Do this | |---|---| | No `[logdrop-agent]` line at all | The service does not call `logdrop.Start`, or the build does not include it. See [Add the package](/docs/backend-tracing/go/install) | | `[logdrop-agent] INFO LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | On Kubernetes: the pod has no `logdrop.io/trace: go` annotation, its `trace-status` is `skipped: …`, or the chart is older than `0.1.1-alpha13`. Elsewhere: set the [settings](/docs/backend-tracing/go/other-hosts) | | `trace-status: skipped: unsupported language` on a `go` pod | The installed chart is older than `0.1.1-alpha13` and does not know Go. Upgrade the chart and roll the pod | | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/go/kubernetes#4-check-it)) and roll the pod | | No `trace-status` annotation | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `ERROR LogDrop tracing is disabled: the application sets its own OpenTelemetry tracer provider.` | The service sets up OpenTelemetry itself (`otel.SetTracerProvider`) before `logdrop.Start`. Remove that set-up, or do not use the LogDrop package in this service | | `ERROR LogDrop tracing is disabled: the agent could not start.` | Contact LogDrop support with the Go version and, with `LOGDROP_DEBUG=true`, the lines that follow | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` naming a setting | The named setting is invalid. Fix it and restart | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` is missing in that namespace, or empty; outside Kubernetes, the key file is missing or unreadable | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The package keeps the previous key until you fix it | | `LogDrop rejected the ingest key (HTTP 401).` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/go/kubernetes) | | `LogDrop refused traces for this project (HTTP 403).` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `LogDrop rate-limited trace export (HTTP 429).` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/go/limits)), or the project's trace storage is used up. Those batches are dropped | | `LogDrop is not reachable. Trace export failed.` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall or DNS). The package does not use an HTTP proxy. Before it warns, it resends a batch that could not connect for about 20 seconds, so a few seconds of network set-up while a pod starts lose nothing | | `LogDrop refused a trace batch as invalid (HTTP 400).` | Usually a clock far off (spans that start more than 5 minutes ahead), a `LOGDROP_MAX_*` setting above LogDrop's limits, or an outdated package. The batch is dropped and counted as rejected in `logdrop.ExportStatus()` | | `LogDrop rejected trace export (HTTP ).` | Any other answer. For 502, 503 and 504 the package has already retried for a few seconds. If it persists, contact LogDrop support with the time and the code | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once, often custom spans that are never ended | | Requests appear, but database, Redis or outgoing calls are missing, or show up as separate traces | The library is not wrapped ([Add the package](/docs/backend-tracing/go/install#2-wrap-the-libraries-you-use)), or the call does not get the request's `context.Context`. pgx queries are recorded only inside a request or a custom span | | Requests appear without a route (only `GET`) | With chi, the middleware must be inside the router; with other routers, use their line from [Add the package](/docs/backend-tracing/go/install#2-wrap-the-libraries-you-use) | | The last spans of a short job are missing | `main` exits through `os.Exit` or `log.Fatal`, which skips the deferred call. Call `logdrop.Shutdown()` or `logdrop.Flush(timeout)` before it | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If nothing shows up in the panel, check these in order: 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The service uses a key with the **Traces** signal whose status is **Active**. 3. The package reports success: its start line ([Check it](/docs/backend-tracing/go/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the default is `production`). 5. The service's log shows no refusal from the table above. # Verify What You Install (/docs/backend-tracing/go/verify) The LogDrop Go package is a Go module that Go downloads as source from its tagged release. Go itself checks that every download matches what everyone else gets. The Helm chart is signed by LogDrop with cosign. ## Go module [#go-module] Go records the hash of every module version in your `go.sum` and checks it against the public Go checksum database (`sum.golang.org`) the first time it downloads that version. A later download with different content fails, on your machine and in CI. Commit `go.sum`, and check it in CI with: ```bash go mod verify ``` The release tags are `v0.1.0-alpha2` for `github.com/initialcodess/LogDrop-Go-Agent` and `logdropredis/v0.1.0-alpha2`, `logdropkafka/v0.1.0-alpha2` and `logdropamqp/v0.1.0-alpha2` for the separate modules, all on the same commit. A released version never changes: a fix comes as a new version. The module is public, so it needs no private settings. Keep `GOSUMDB` on, and do not list `github.com/initialcodess` in `GOPRIVATE`, `GONOSUMDB` or `GOINSECURE`: the checksum database then keeps checking it, also through a private Go proxy. ## Chart [#chart] Checking the chart's signature shows that the chart you install is the one LogDrop published, unchanged. The chart's signature is not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Go pods use no agent image: the chart only adds settings and the key mount to them. The other images the chart uses are listed on the verify pages of the [Java](/docs/backend-tracing/java/verify), [Node.js](/docs/backend-tracing/nodejs/verify), [Python](/docs/backend-tracing/python/verify) and [.NET](/docs/backend-tracing/dotnet/verify) agents. # Custom Spans (/docs/backend-tracing/java/custom-spans) Most services need no code: the agent traces incoming requests and calls to databases, caches, brokers and other services on its own. For business operations you want to see as their own step in a trace, add the optional `io.logdrop:logdrop-api` library. ## Add the library [#add-the-library] The library is published in LogDrop's Maven repository. Use `io.logdrop:logdrop-api-coroutines` as well for Kotlin coroutines. ```kotlin title="build.gradle.kts" repositories { maven("https://artifactory.logdrop.io/repository/logdrop-java/") } dependencies { implementation("io.logdrop:logdrop-api:0.1.0-alpha5") } ``` ```xml title="pom.xml" logdrophttps://artifactory.logdrop.io/repository/logdrop-java/ io.logdroplogdrop-api0.1.0-alpha5 ``` The library runs on Java 8 and later. Every file is signed; see [Verify what you install](/docs/backend-tracing/java/verify). ## Add a span [#add-a-span] A custom span is a span your own code starts and ends, around an operation the agent cannot see on its own. Wrap the operation in `inSpan` and give the span a name: ```java String total = LogDrop.tracing().inSpan("checkout.price", span -> { span.attribute("order.type", "delivery"); // custom keys need LOGDROP_ALLOWED_ATTRIBUTE_KEYS=order.type return pricing.total(order); }); ``` `inSpan` makes the span current while your code runs, so the calls inside it (database, HTTP, messaging) appear under it in the same trace. It always ends the span, and records the exception class when your code throws. `withSpan` does the same for work without a result. With Kotlin coroutines, use `inSpanSuspend` from `logdrop-api-coroutines`; it keeps the span current across suspension and ends it on success, failure or cancellation: ```kotlin import io.logdrop.api.coroutines.inSpanSuspend val total = LogDrop.tracing().inSpanSuspend("checkout.price") { span -> span.attribute("order.type", "delivery") pricing.total(order) } ``` ## Attributes and events [#attributes-and-events] Attributes are key-value details that you add to a span, such as `order.type`. Events mark something that happened while the span ran. - A custom attribute is sent only when its key is listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` (comma-separated, at most 128 keys). A key starts with a letter and has at most 128 letters, digits, `_`, `.` or `-`. - Keys that contain `authorization`, `cookie`, `token`, `secret`, `password`, `credential`, `api_key`, `apikey` or `api-key` are always dropped, even when listed. - Values are strings, whole numbers, decimals or booleans. Text is cut to `LOGDROP_MAX_STRING_LENGTH` characters (256 by default). - Use constant event names, without request or user data. - `recordException` records only the exception class, never its message, stack trace or cause. ## Other calls [#other-calls] Besides spans, the library has calls that work with the running agent: send pending spans now, read the export counters, switch the ingest key, or check that the agent is attached. | Call | What it does | |---|---| | `LogDrop.flush(Duration)` | Sends the spans that ended before the call, for example before a batch job exits. `false` when it did not finish in time, an export failed, or no agent is attached. The timeout is at most 60 seconds | | `LogDrop.exportStatus()` | Counts of exported, failed, rejected (refused as invalid, or dropped before sending because LogDrop would refuse them), pending, refused (over the active-span limit) and active spans, and whether the agent is attached | | `LogDrop.updateIngestCredential(String)` | Uses this key for later requests, without a restart, until the key file changes again | | `LogDrop.isAgentAttached()` | Whether the LogDrop Java agent runs in this JVM | ## Without the agent [#without-the-agent] The library sends nothing to LogDrop by itself. Without the agent, `flush` returns `false`, `exportStatus()` reports that no agent is attached, and `updateIngestCredential` throws `IllegalStateException`. Spans you start are not sent to LogDrop. # What LogDrop Records (/docs/backend-tracing/java/data-collected) The agent removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. ## What a span carries [#what-a-span-carries] A span is the record of one operation, such as a request your service handles or a call it makes to a database. After the agent's filtering, a span can carry: - Route templates such as `GET /orders/{id}`, HTTP methods and status codes. - Error types, for example an exception class or a status code. - The hosts and ports your service calls. - Database systems, database names and operations; messaging systems, operations and destinations; RPC and GraphQL operation names. - Your service's identity: service, service group, release, environment and instance. - Where it runs: on Kubernetes the cluster, namespace, node, workload, pod and container; outside containers the host ID and host name. - [Custom attributes](/docs/backend-tracing/java/custom-spans#attributes-and-events), only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, full URLs and query strings, request and response bodies, SQL statements and their values, exception messages and stack traces. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. The agent sends traces only: it collects no logs and no metrics. ## What is traced [#what-is-traced] These rules decide which requests and calls become spans: - Every span is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/java/limits) applies instead. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced. Other health checks are. # Java (/docs/backend-tracing/java) LogDrop traces JVM services without code changes. On Kubernetes, one pod annotation adds the LogDrop Java agent; outside Kubernetes, you add one JVM flag. The agent is a distribution of OpenTelemetry Java instrumentation. It records the requests your service handles and its calls to databases, caches, message brokers and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. Current release: LogDrop Java agent `0.1.0-alpha5` and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you install the agent, check that you have the LogDrop project and key, and that your platform, Java version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - Kubernetes 1.28 or newer with Helm 3.8 or newer, or any host that runs a JVM. - Java 8 to 25. Tested with Spring Boot 2.7, 3.4, 3.5 and 4.1, servlet containers, Spring WebFlux, JDBC, Redis, Kafka, RabbitMQ and JMS clients. GraalVM native images are not supported. ## Install the agent [#install-the-agent] Choose the guide for where your service runs. Both add the same agent, configured with the same `LOGDROP_*` settings. - [Kubernetes](/docs/backend-tracing/java/kubernetes): Install the LogDrop Helm chart and opt workloads in with one pod annotation. - [Outside Kubernetes](/docs/backend-tracing/java/outside-kubernetes): Start the JVM with the agent on a host, as a systemd service or in a container. ## Reference [#reference] These pages hold the details behind the install guides. Use them to add your own spans, change a setting, plan for limits or fix a problem. - [Custom spans](/docs/backend-tracing/java/custom-spans): Add spans for business operations with the optional `logdrop-api` library. - [Agent settings](/docs/backend-tracing/java/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/java/limits): What LogDrop accepts per request, per key and per project. - [Rotate the ingest key](/docs/backend-tracing/java/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/java/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/java/verify): Check the signatures of the agent, its image and the chart. - [Licences](/docs/backend-tracing/java/licences): The licences of the agent and the API libraries. - [Troubleshooting](/docs/backend-tracing/java/troubleshooting): Agent messages and what to do about them. # Rotate the Ingest Key (/docs/backend-tracing/java/key-rotation) Rotating replaces the traces ingest key your agents use with a new one, for example before the old key expires. Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every agent that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the agent re-reads the file every 10 seconds. Outside Kubernetes, replace the key file in one step: write a new file next to it, then `mv` it over the old one. The agent reads it within 10 seconds. Services that pass the key in `LOGDROP_INGEST_KEY` need a restart. 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no agent logs `LogDrop rejected the ingest key`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] - An agent whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - A running service can also switch keys in code with `LogDrop.updateIngestCredential(String)`; see [Custom spans](/docs/backend-tracing/java/custom-spans#other-calls). - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/java/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: java` is created, the injector adds an init container that copies the LogDrop Java agent into the pod and sets `JAVA_TOOL_OPTIONS` and the `LOGDROP_*` settings on your container. Your images and code stay unchanged. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [Java requirements](/docs/backend-tracing/java#requirements). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the agent sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the agent reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` The chart pulls the agent image (`registry.logdrop.io/logdrop-javaagent`) and the injector's runtime from `registry.logdrop.io` by digest; see [Verify what you install](/docs/backend-tracing/java/verify). With these values it installs one small webhook pod, the trace injector, and nothing else. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods are instrumented. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: java` (or `nodejs`, `python`, `dotnet`, `go`, `php`, `rust`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.java.image` | LogDrop's published agent, by digest | Set your own repository and digest (or tag) when you mirror images | | `tracing.java.imagePullSecrets` | empty | Pull Secrets for the agent image. They must exist in every traced namespace | | `tracing.java.resources` | requests 10m / 16Mi, limits 100m / 64Mi | The init container that copies the agent. Your container keeps its own resources | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without tracing | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector adds the agent only to pods whose template carries the annotation `logdrop.io/trace: java`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: java # needed with requirePodLabel: true annotations: logdrop.io/trace: java logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: java` | Opts the pod in. `java`, [`nodejs`](/docs/backend-tracing/nodejs/kubernetes), [`python`](/docs/backend-tracing/python/kubernetes), [`dotnet`](/docs/backend-tracing/dotnet/kubernetes), [`go`](/docs/backend-tracing/go/kubernetes), [`php`](/docs/backend-tracing/php/kubernetes) and [`rust`](/docs/backend-tracing/rust/kubernetes) are supported; any other value is skipped with a status | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to trace. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the agent is added when a pod is created. ## 4. Check it [#4-check-it] Check that the injector added the agent to the new pods. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the agent is in. The container log then shows one line from the agent: ```text [logdrop-agent] INFO LogDrop Java agent 0.1.0-alpha5 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The agent was added | | `skipped: unsupported language` | The annotation value is not `java`, `nodejs`, `python`, `dotnet`, `go`, `php` or `rust` | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: JAVA_TOOL_OPTIONS uses valueFrom` | The container takes `JAVA_TOOL_OPTIONS` from a ConfigMap or Secret, which the injector never rewrites. Set it as a literal `value` | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume names, or the paths `/logdrop-agent` or `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section lists the network access the injector and the traced pods need, and the storage tracing uses in each pod. Check it when your cluster restricts network traffic, or when pods get no `trace-status` annotation. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: java} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the agent starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories and no persistent volumes. The agent keeps the spans waiting to be sent in memory (at most 2,048 by default) and drops new spans when that queue is full. Each traced pod gets an `emptyDir` volume, limited to 64 MiB, that holds the agent jar of about 25 MB. ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** tracing and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot instrument is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected agent fits into your pods. Check them before you opt production workloads in. - `JAVA_TOOL_OPTIONS` set in the image (`ENV` in a Dockerfile) is replaced by the pod-level value the injector adds. Move such options into the pod spec, where the injector appends `-javaagent` to them. A value from `envFrom` is overridden the same way. - Size the container for about 100 MiB more memory and about one second more startup time with the agent. - `LOGDROP_*` variables that the container already sets win over the injected ones. - Containers added by webhooks that run after the injector are not instrumented. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. Running pods keep the agent they started with until they are restarted, so roll your workloads to pick up a new agent version. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; instrumented pods keep their copy of the agent until they restart. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/java/licences) The LogDrop Java agent combines OpenTelemetry Java Instrumentation, under the Apache License 2.0, with LogDrop's own parts, under the LogDrop Client Library License 1.0. ## LogDrop API libraries [#logdrop-api-libraries] `logdrop-api`, `logdrop-api-coroutines` and `logdrop-tracing-core` are licensed under the [LogDrop Client Library License 1.0](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.0.txt). In short, you may use them to send telemetry to LogDrop and include them, unmodified, in your applications; you may not modify them or distribute them on their own. The licence text is the authoritative version. Each jar carries it as `META-INF/LICENSE`. ## LogDrop Java agent [#logdrop-java-agent] The agent is a distribution of OpenTelemetry Java Instrumentation: - The upstream parts stay under the Apache License 2.0 (`META-INF/LICENSE`, with the upstream `META-INF/NOTICE`). - The LogDrop parts (its start-up entry point, its bridge and its extension, which includes `logdrop-tracing-core`) are under the LogDrop Client Library License 1.0 (`META-INF/LICENSE-LogDrop.txt`). ## Licence versions [#licence-versions] The current release carries version 1.0 of the LogDrop Client Library License. Later releases carry [version 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt), which names the LogDrop agents and libraries of every language; its other terms are the same. Each release is under the version it carries. # Limits (/docs/backend-tracing/java/limits) The agent keeps every request inside LogDrop's limits on its own. You only need these numbers if you change the agent's settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the agent sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The agent splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The agent drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Agent settings](/docs/backend-tracing/java/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The agent retries for a few seconds, then drops the batch | | Active spans per JVM | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits apply per key and per project, so they decide how many JVMs can share one key or one project. At the default settings, a JVM sends a request about once a second while it has traffic, and one request per 128 spans when it records more than 128 spans a second. So one key carries about ten busy JVMs, or about 1,280 spans a second, and one project about fifty JVMs, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a JVM with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. # Outside Kubernetes (/docs/backend-tracing/java/outside-kubernetes) Outside Kubernetes you start the JVM with one extra flag, `-javaagent`, and configure the agent with `LOGDROP_*` environment variables. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [Java requirements](/docs/backend-tracing/java#requirements). ## 1. Download the agent and store the key [#1-download-the-agent-and-store-the-key] The agent is one jar file that the JVM loads when it starts, and it reads the traces ingest key from a file. Download the agent, [verify it](/docs/backend-tracing/java/verify), and store the key in a file that only the service user can read: ```bash sudo mkdir -p /opt/logdrop /etc/logdrop sudo curl -fsSLo /opt/logdrop/logdrop-javaagent.jar \ https://artifactory.logdrop.io/repository/logdrop-java/io/logdrop/logdrop-javaagent/0.1.0-alpha5/logdrop-javaagent-0.1.0-alpha5.jar printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then printf '%s' "$LOGDROP_TRACE_KEY" | sudo tee /etc/logdrop/trace-ingest-key >/dev/null else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY sudo chown /etc/logdrop/trace-ingest-key && sudo chmod 600 /etc/logdrop/trace-ingest-key ``` ## 2. Start the JVM with the agent [#2-start-the-jvm-with-the-agent] The `-javaagent` flag loads the agent into the JVM. The `LOGDROP_*` variables tell it where to send traces, which key file to read and how your service appears in APM: ```bash export LOGDROP_ENDPOINT=https://otel.logdrop.io export LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key export LOGDROP_SERVICE=orders export LOGDROP_ENVIRONMENT=production export LOGDROP_RELEASE=1.4.2 java -javaagent:/opt/logdrop/logdrop-javaagent.jar -jar orders.jar ``` The process then writes one line to standard error: ```text [logdrop-agent] INFO LogDrop Java agent 0.1.0-alpha5 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` ### As a systemd service [#as-a-systemd-service] If systemd runs your service, set the same variables in its unit file and add the agent through `JAVA_TOOL_OPTIONS`, which the JVM reads when it starts: ```ini title="/etc/systemd/system/orders.service (excerpt)" [Service] Environment=LOGDROP_ENDPOINT=https://otel.logdrop.io Environment=LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key Environment=LOGDROP_SERVICE=orders Environment=LOGDROP_ENVIRONMENT=production Environment=JAVA_TOOL_OPTIONS=-javaagent:/opt/logdrop/logdrop-javaagent.jar ExecStart=/usr/bin/java -jar /opt/orders/orders.jar ``` ### In a container without Kubernetes [#in-a-container-without-kubernetes] Mount the jar and the key file read-only and set the same variables: ```bash docker run -v /opt/logdrop/logdrop-javaagent.jar:/logdrop/logdrop-javaagent.jar:ro \ -v /etc/logdrop/trace-ingest-key:/run/secrets/logdrop-trace-ingest-key:ro \ -e JAVA_TOOL_OPTIONS=-javaagent:/logdrop/logdrop-javaagent.jar \ -e LOGDROP_ENDPOINT=https://otel.logdrop.io -e LOGDROP_INGEST_KEY_FILE=/run/secrets/logdrop-trace-ingest-key \ -e LOGDROP_SERVICE=orders -e LOGDROP_ENVIRONMENT=production ``` ## The key in a file or in a variable [#the-key-in-a-file-or-in-a-variable] `LOGDROP_INGEST_KEY` (the key itself in a variable) works too, but prefer the file: - the agent re-reads the file every 10 seconds, so you can [rotate the key](/docs/backend-tracing/java/key-rotation) without a restart; - a variable is visible to anyone who can read the process environment. Set one of the two, not both. ## Things to know [#things-to-know] - Outside containers, the agent adds the host ID and host name to every trace. - Each process gets a new instance ID in APM. Set `LOGDROP_SERVICE_INSTANCE_ID` to a stable value if restarts should count as the same instance. - The agent keeps the spans waiting to be sent in memory (at most 2,048 by default), not on disk. - Size the host for about 100 MiB more memory per JVM and about one second more startup time. All settings are listed in [Agent settings](/docs/backend-tracing/java/settings). # Agent Settings (/docs/backend-tracing/java/settings) The LogDrop Java agent is configured only with `LOGDROP_*` environment variables. On Kubernetes the trace injector sets the required ones for you; outside Kubernetes you set them yourself. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` / `LOGDROP_INGEST_KEY` | none | The traces ingest key, from a file (re-read every 10 seconds) or from a variable. Set one, not both | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it; elsewhere new for each process | Instance ID in APM. Outside Kubernetes, set a stable value if restarts should count as the same instance | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated [custom attribute](/docs/backend-tracing/java/custom-spans#attributes-and-events) keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA | | `LOGDROP_ENABLED` | `true` | `false` turns the agent off | | `LOGDROP_DEBUG` | `false` | Agent diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long spans wait before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_COMPRESSION` | `gzip` | `gzip` or `none` | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release and the pod's identity from the chart values and the pod's annotations. Variables you set on the container win over the injected ones. See [Kubernetes](/docs/backend-tracing/java/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The application always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own exporter, endpoint, sampler, propagator, header-capture and resource settings (`OTEL_*` variables and `-Dotel.*` properties) have no effect on the agent: it always exports to LogDrop, never samples, propagates W3C trace context and never captures headers. Configure it with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/java/troubleshooting) The agent writes its messages to standard error with the prefix `[logdrop-agent]`. Each warning is logged at most once a minute, and no message ever contains the ingest key. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. | You see | Do this | |---|---| | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/java/kubernetes#4-check-it)) and roll the pod | | No `trace-status` annotation and no `[logdrop-agent]` line | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `trace-status: injected` but no `[logdrop-agent]` line | Something replaced `JAVA_TOOL_OPTIONS` after the injector (an image `ENV` does not; a wrapper script that sets it does), or the process is not a JVM | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` | The named setting is invalid. Fix it and restart | | `[logdrop-agent] LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | Set the endpoint (on Kubernetes: `tracing.endpoint`) | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` (or your key file) is missing in that namespace, or empty | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The agent keeps the previous key until you fix it | | `LogDrop rejected the ingest key (HTTP 401).` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/java/kubernetes) | | `LogDrop refused traces for this project (HTTP 403).` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `LogDrop rate-limited trace export (HTTP 429).` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/java/limits)), or the project's trace storage is used up. Those batches are dropped | | `LogDrop is not reachable. Trace export failed.` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall, proxy or DNS). Before it warns, the agent resends a batch that could not connect for about 20 seconds (a name that does not resolve is looked up again after about 10 and 20 seconds), so a few seconds of network or DNS set-up while a pod starts lose nothing. A request that timed out after it was sent is resent once | | `LogDrop refused a trace batch as invalid (HTTP 400).` | Usually a clock far off (spans that start more than 5 minutes ahead), a `LOGDROP_MAX_*` setting above LogDrop's limits, or an outdated agent. The batch is dropped and counted as rejected in `LogDrop.exportStatus()` | | `LogDrop rejected trace export (HTTP ).` | Any other answer. For 502, 503 and 504 the agent has already retried for a few seconds. If it persists, contact LogDrop support with the time and the code | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once, often spans that custom code never ends | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If no trace appears and the table did not point to the cause, check each of these: 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The agent uses a key with the **Traces** signal whose status is **Active**. 3. The agent reports success: `logdrop.io/trace-status: injected` and its start line ([Check it](/docs/backend-tracing/java/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the agent's default is `production`). 5. The agent's log shows no refusal from the table above. # Verify What You Install (/docs/backend-tracing/java/verify) LogDrop signs its container images and its Helm chart with cosign, and its Maven files with GPG, using its own keys. Every artifact also comes with a CycloneDX SBOM. A valid signature shows that a file comes from LogDrop and has not changed since LogDrop signed it. The SBOM (software bill of materials) lists the components inside an artifact. ## Images and the chart [#images-and-the-chart] Check the chart and the agent image it pulls when you install on Kubernetes. The signatures are not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub # The agent image (the image the chart uses by digest), its SBOM, and the chart. cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/logdrop-javaagent:0.1.0-alpha5 cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true --type cyclonedx \ registry.logdrop.io/logdrop-javaagent:0.1.0-alpha5 cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Admission policies that verify images in your cluster need the same two settings: LogDrop's public key, and the transparency log check turned off. ## Maven files [#maven-files] Check these when you download the agent jar to run it outside Kubernetes, or when you add the `logdrop-api` library. Every file in LogDrop's Maven repository has a GPG signature (`.asc`) next to it: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-java/io/logdrop/logdrop-javaagent/0.1.0-alpha5/logdrop-javaagent-0.1.0-alpha5.jar curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-java/io/logdrop/logdrop-javaagent/0.1.0-alpha5/logdrop-javaagent-0.1.0-alpha5.jar.asc curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/logdrop-release.asc gpg --import logdrop-release.asc gpg --verify logdrop-javaagent-0.1.0-alpha5.jar.asc logdrop-javaagent-0.1.0-alpha5.jar ``` The CycloneDX SBOM of each Maven artifact sits next to it as `-cyclonedx.json`, for example `logdrop-javaagent-0.1.0-alpha5-cyclonedx.json`. # Bundled Applications (/docs/backend-tracing/nodejs/bundled-applications) The agent traces a library when your service loads it from `node_modules`. A bundler (esbuild, webpack, ncc and similar) copies the libraries into one output file, so that never happens and most spans are lost. Keep the libraries outside the bundle and the agent traces them again. ## What is lost [#what-is-lost] A bundled service still sends traces, but they lose detail: | Still traced in a bundle | Lost in a bundle | |---|---| | Incoming and outgoing HTTP (`http`, `https`, `fetch`), [custom spans](/docs/backend-tracing/nodejs/custom-spans) | Route names (`GET` instead of `GET /orders/:id`), and the database, Redis, RabbitMQ and Kafka spans | When the agent sees HTTP requests but none of the libraries it traces, it prints one warning: ```text [logdrop-agent] WARN HTTP requests are traced, but the application looks bundled: … ``` A Docker image is not a bundle: an image with your code and its `node_modules` is traced fully. ## Fix it in your build [#fix-it-in-your-build] Ship `node_modules` with the service (`npm ci --omit=dev`) and use one of these: 1. **Do not bundle the server.** Compile TypeScript with `tsc` and run the output next to `node_modules`. 2. **Keep packages outside the bundle.** Your own code is still bundled: - esbuild: `esbuild src/server.ts --bundle --platform=node --packages=external --outfile=dist/server.js` - webpack: `externals: [require('webpack-node-externals')()]` with `target: 'node'` - ncc: `ncc build src/server.js -e express -e pg …` 3. **Keep only the traced packages outside**: `express`, `fastify`, `koa`, `@koa/router`, `graphql`, `@grpc/grpc-js`, `pg`, `mysql`, `mysql2`, `tedious`, `mongodb`, `ioredis`, `redis`, `amqplib` and `kafkajs`. Mark them as external in your bundler and install them in the image. Restart the service. The warning is gone, and route names and dependency spans appear in the next traces. # Custom Spans (/docs/backend-tracing/nodejs/custom-spans) Most services need no code: the agent traces incoming requests and calls to databases, caches, brokers and other services on its own. For business operations you want to see as their own step in a trace, add the optional `@log-drop/api` package. ## Add the package [#add-the-package] The package is published on npm. It has no dependencies and includes its TypeScript types. ```bash npm install @log-drop/api@0.1.0-alpha1 ``` It works in CommonJS and ECMAScript modules (`require('@log-drop/api')` or `import { LogDrop } from '@log-drop/api'`). ## Add a span [#add-a-span] A custom span is a span your own code starts and ends, around an operation the agent cannot see on its own. Wrap the operation in `inSpan` and give the span a name: ```js import { LogDrop } from '@log-drop/api'; const total = await LogDrop.tracing().inSpan('checkout.price', async (span) => { span.attribute('order.type', 'delivery'); // custom keys need LOGDROP_ALLOWED_ATTRIBUTE_KEYS=order.type return pricing.total(order); }); ``` `inSpan` makes the span current while your code runs, so the calls inside it (database, HTTP, messaging) appear under it in the same trace, also after an `await`. It ends the span when your function returns or, for an async function, when its promise settles, and records the error type when it throws or rejects. The result or the error is passed on unchanged. For work that does not fit in one function, start the span yourself and end it: ```js const span = LogDrop.tracing().startSpan('import.file', { kind: 'CONSUMER' }); try { await span.run(() => importFile(path)); // spans started inside are its children span.success(); } catch (error) { span.recordException(error); throw error; } finally { span.end(); } ``` ## Attributes and events [#attributes-and-events] Attributes are key-value details that you add to a span, such as `order.type`. Events mark something that happened while the span ran. - A custom attribute is sent only when its key is listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` (comma-separated, at most 128 keys). A key starts with a letter and has at most 128 letters, digits, `_`, `.` or `-`. - Keys that contain `authorization`, `cookie`, `token`, `secret`, `password`, `credential`, `api_key`, `apikey` or `api-key` are always dropped, even when listed. - Values are strings, numbers or booleans. Text is cut to `LOGDROP_MAX_STRING_LENGTH` characters (256 by default). - Use constant event names, without request or user data: `span.event('payment.authorized')`. - `recordException` records only the error type, never its message or stack trace. - Span names are at most 256 characters and not empty. ## Other calls [#other-calls] Besides spans, the package has calls that work with the running agent and the current span: send pending spans now, read the export counters, switch the ingest key, check that the agent is attached, or carry the current span into code the agent does not trace. | Call | What it does | |---|---| | `LogDrop.flush(ms)` | Sends the spans that ended before the call, for example before a batch job exits. Resolves `false` when it did not finish in time, an export failed, or no agent is attached. The timeout is at most 60,000 ms | | `LogDrop.exportStatus()` | Counts of exported, failed, rejected (refused as invalid, or dropped before sending because LogDrop would refuse them), pending, refused (over the active-span limit) and active spans, and whether the agent is attached | | `LogDrop.updateIngestCredential(key)` | Uses this key for later requests, without a restart, until the key file changes again | | `LogDrop.isAgentAttached()` | Whether the LogDrop Node.js agent runs in this process | | `tracing.currentSpanContext()` | The trace and span ID of the current span, or `null` | | `tracing.captureContext()` | Keeps the current span for later: `run(fn)` or `wrap(fn)` runs code with it as current, for example in a callback of a library the agent does not trace | | `startSpan(name, { kind, links })` | `kind` is `INTERNAL` (default), `SERVER`, `CLIENT`, `PRODUCER` or `CONSUMER`; `links` points at related spans by their context | ## Without the agent [#without-the-agent] The package sends nothing to LogDrop by itself. Without the agent every call is safe and records nothing: `inSpan` still runs your code and returns its result, `flush` resolves `false`, `exportStatus()` reports that no agent is attached, and `updateIngestCredential` throws an `Error`. # What LogDrop Records (/docs/backend-tracing/nodejs/data-collected) The agent removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. It applies the same rules as the Java agent. ## What a span carries [#what-a-span-carries] A span is the record of one operation, such as a request your service handles or a call it makes to a database. After the agent's filtering, a span can carry: - Route templates such as `GET /orders/:id`, HTTP methods and status codes. - Error types, for example an error class or a status code. - The hosts and ports your service calls. - Database systems, database names and operations; messaging systems, operations and destinations; RPC and GraphQL operation names. - SQL statements only as value-free templates, such as `SELECT * FROM orders WHERE id = $1`: every literal in the statement is replaced by `?` before it leaves the process. - Redis command names, such as `GET` or `HSET`, never their keys or values. - Your service's identity: service, service group, release, environment and instance. - Where it runs: on Kubernetes the cluster, namespace, node, workload, pod and container; outside containers the host ID and host name. - [Custom attributes](/docs/backend-tracing/nodejs/custom-spans#attributes-and-events), only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, full URLs and query strings, request and response bodies, SQL values, Redis keys, message bodies, error messages and stack traces. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. The agent sends traces only: it collects no logs and no metrics. ## What is traced [#what-is-traced] These rules decide which requests and calls become spans: - Every span is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/nodejs/limits) applies instead. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced. Other health checks are. - Express and Koa middleware record no spans of their own. Fastify adds one internal `request` span per request. - In a [bundled application](/docs/backend-tracing/nodejs/bundled-applications) only HTTP and custom spans are recorded. # Node.js (/docs/backend-tracing/nodejs) LogDrop traces Node.js services without code changes. On Kubernetes, one pod annotation adds the LogDrop Node.js agent; outside Kubernetes, you add it to `NODE_OPTIONS`. The agent is a distribution of OpenTelemetry JS. It records the requests your service handles and its calls to databases, caches, message brokers and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. It removes the same data as the [Java agent](/docs/backend-tracing/java), so a request that crosses Java and Node.js services appears as one trace. Current release: LogDrop Node.js agent `0.1.0-alpha1` (the image `registry.logdrop.io/logdrop-node-agent` and the npm packages `@log-drop/node-agent` and `@log-drop/api`) and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you install the agent, check that you have the LogDrop project and key, and that your platform, Node.js version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - Kubernetes 1.28 or newer with Helm 3.8 or newer, or any host that runs Node.js. On Kubernetes, the agent image `0.1.0-alpha1` runs on linux/amd64 nodes only. - **Node.js 22.15 or newer.** Node.js 22, 24 and 26 are tested, on glibc and Alpine images. On an older Node.js the agent prints one line and your service runs untraced. - CommonJS and ECMAScript module applications, JavaScript or compiled TypeScript. Traced libraries: `http`, `https` and `fetch`, Express, Fastify, Koa, GraphQL, gRPC, PostgreSQL (`pg`), MySQL (`mysql`, `mysql2`), SQL Server (`tedious`), MongoDB, Redis (`ioredis`, `redis`), RabbitMQ (`amqplib`) and Kafka (`kafkajs`). - Next.js is not supported. If your build bundles the server into one file (esbuild, webpack, ncc), read [Bundled applications](/docs/backend-tracing/nodejs/bundled-applications) first. ## Install the agent [#install-the-agent] Choose the guide for where your service runs. Both add the same agent, configured with the same `LOGDROP_*` settings. - [Kubernetes](/docs/backend-tracing/nodejs/kubernetes): Install the LogDrop Helm chart and opt workloads in with one pod annotation. - [Outside Kubernetes](/docs/backend-tracing/nodejs/outside-kubernetes): Install the agent from npm and start Node.js with it, on a host, with pm2 or systemd, or in a container. ## Reference [#reference] These pages hold the details behind the install guides. Use them to keep a bundled service traced, add your own spans, change a setting, plan for limits or fix a problem. - [Bundled applications](/docs/backend-tracing/nodejs/bundled-applications): What a bundler hides from the agent, and how to keep your libraries traced. - [Custom spans](/docs/backend-tracing/nodejs/custom-spans): Add spans for business operations with the optional `@log-drop/api` package. - [Agent settings](/docs/backend-tracing/nodejs/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/nodejs/limits): What LogDrop accepts per request, per key and per project. - [Rotate the ingest key](/docs/backend-tracing/nodejs/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/nodejs/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/nodejs/verify): Check the signatures of the agent image and the chart. - [Licences](/docs/backend-tracing/nodejs/licences): The licences of the agent and the API package. - [Troubleshooting](/docs/backend-tracing/nodejs/troubleshooting): Agent messages and what to do about them. # Rotate the Ingest Key (/docs/backend-tracing/nodejs/key-rotation) Rotating replaces the traces ingest key your agents use with a new one, for example before the old key expires. Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every agent that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the agent re-reads the file every 10 seconds. Outside Kubernetes, replace the key file in one step: write a new file next to it, then `mv` it over the old one. The agent reads it within 10 seconds. Services that pass the key in `LOGDROP_INGEST_KEY` need a restart. 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no agent logs `LogDrop rejected the ingest key`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] - An agent whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - A running service can also switch keys in code with `LogDrop.updateIngestCredential(key)` from `@log-drop/api`; see [Custom spans](/docs/backend-tracing/nodejs/custom-spans#other-calls). - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/nodejs/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: nodejs` is created, the injector adds an init container that copies the LogDrop Node.js agent into the pod and adds it to `NODE_OPTIONS` with the `LOGDROP_*` settings on your container. Your images and code stay unchanged. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [Node.js requirements](/docs/backend-tracing/nodejs#requirements). Java and Node.js services use the same chart, the same values and the same key Secret: if you already trace Java services, upgrade the chart to `0.1.1-alpha15` and go to [step 3](#3-opt-a-workload-in). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the agent sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the agent reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` The chart pulls the agent image (`registry.logdrop.io/logdrop-node-agent`) and the injector's runtime from `registry.logdrop.io` by digest; see [Verify what you install](/docs/backend-tracing/nodejs/verify). The agent is plain JavaScript, so it works in glibc and Alpine application images. The `0.1.0-alpha1` agent image is built for linux/amd64 only: pods on arm64 nodes are not supported yet. With these values the chart installs one small webhook pod, the trace injector, and nothing else. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods are instrumented. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: nodejs` (or `java`, `python`, `dotnet`, `go`, `php`, `rust`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.nodejs.image` | LogDrop's published agent, by digest | Set your own repository and digest (or tag) when you mirror images. Do not clear it: pods are then skipped with `nodejs agent image not configured` | | `tracing.nodejs.imagePullSecrets` | empty | Pull Secrets for the agent image. They must exist in every traced namespace | | `tracing.nodejs.resources` | requests 10m / 16Mi, limits 100m / 64Mi | The init container that copies the agent. Your container keeps its own resources | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without tracing | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector adds the agent only to pods whose template carries the annotation `logdrop.io/trace: nodejs`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: nodejs # needed with requirePodLabel: true annotations: logdrop.io/trace: nodejs logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: nodejs` | Opts the pod in. `nodejs`, `java`, `python`, `dotnet`, `go`, `php` and `rust` are supported; any other value is skipped with a status | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to trace. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the agent is added when a pod is created. The injector adds `--require /logdrop-agent/nodejs/register.js` to the container's `NODE_OPTIONS`. If the container sets `NODE_OPTIONS` in its `env`, your value is kept and the agent is appended to it. > **Warning: NODE_OPTIONS from the image is replaced** > > A `NODE_OPTIONS` set only in your image (`ENV NODE_OPTIONS=--max-old-space-size=…` in a Dockerfile) is replaced by the pod-level value the injector adds, so its flags are lost. Move it to the container's `env` in the pod spec before you opt the workload in. ## 4. Check it [#4-check-it] Check that the injector added the agent to the new pods. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the agent is in. The container log then shows one line from the agent: ```text [logdrop-agent] INFO LogDrop Node.js agent 0.1.0-alpha1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The agent was added | | `skipped: unsupported language` | The annotation value is not `nodejs`, `java`, `python`, `dotnet`, `go`, `php` or `rust`. On a `nodejs` pod: the installed chart is older than `0.1.1-alpha10`; upgrade it | | `skipped: nodejs agent image not configured` | Your values clear `tracing.nodejs.image`. Remove that override | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: NODE_OPTIONS uses valueFrom` | The container takes `NODE_OPTIONS` from a ConfigMap or Secret, which the injector never rewrites. Set it as a literal `value` | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume names, or the paths `/logdrop-agent` or `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section lists the network access the injector and the traced pods need, and the storage tracing uses in each pod. Check it when your cluster restricts network traffic, or when pods get no `trace-status` annotation. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: nodejs} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the agent starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories and no persistent volumes. The agent keeps the spans waiting to be sent in memory (at most 2,048 by default) and drops new spans when that queue is full. Each traced pod gets an `emptyDir` volume, limited to 64 MiB, that holds the agent's files. ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** tracing and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot instrument is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected agent fits into your pods. Check them before you opt production workloads in. - `NODE_OPTIONS` set in the image is replaced, as described in [step 3](#3-opt-a-workload-in). A value from `envFrom` is overridden the same way. - `LOGDROP_*` variables that the container already sets win over the injected ones. - Package manager processes (`npm`, `npx`, `yarn`, `pnpm`, `corepack`) inherit `NODE_OPTIONS` but are never traced. If your container starts with `npm start`, only your server process is traced. - If your service starts its own OpenTelemetry SDK, the agent stays off and logs why. Remove the service's own SDK, or do not opt the workload in. - Containers added by webhooks that run after the injector are not instrumented. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. Running pods keep the agent they started with until they are restarted, so roll your workloads to pick up a new agent version. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; instrumented pods keep their copy of the agent until they restart. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/nodejs/licences) The LogDrop Node.js agent combines OpenTelemetry JS, under the Apache License 2.0, with LogDrop's own parts, under the LogDrop Client Library License 1.0. ## LogDrop API package [#logdrop-api-package] `@log-drop/api` is licensed under the [LogDrop Client Library License 1.0](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.0.txt). In short, you may use it to send telemetry to LogDrop and include it, unmodified, in your applications; you may not modify it or distribute it on its own. The licence text is the authoritative version. The package carries it as `LICENSE`. ## LogDrop Node.js agent [#logdrop-nodejs-agent] The agent is a distribution of OpenTelemetry JS and OpenTelemetry JS Contrib: - The upstream packages stay unmodified under the Apache License 2.0, each with its own licence file (see the agent's `NOTICE`). - The LogDrop parts of `@log-drop/node-agent` (its start-up entry point, its pipeline and its privacy rules) are under the LogDrop Client Library License 1.0 (`LICENSE`). ## Licence versions [#licence-versions] The current release carries version 1.0 of the LogDrop Client Library License. Later releases carry [version 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt), which names the LogDrop agents and libraries of every language; its other terms are the same. Each release is under the version it carries. # Limits (/docs/backend-tracing/nodejs/limits) The agent keeps every request inside LogDrop's limits on its own. You only need these numbers if you change the agent's settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the agent sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The agent splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The agent drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Agent settings](/docs/backend-tracing/nodejs/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The agent retries for a few seconds, then drops the batch | | Active spans per process | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits apply per key and per project, so they decide how many Node.js processes can share one key or one project. At the default settings, a Node.js process sends a request about once a second while it has traffic, and one request per 128 spans when it records more than 128 spans a second. So one key carries about ten busy processes, or about 1,280 spans a second, and one project about fifty processes, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a process with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. # Outside Kubernetes (/docs/backend-tracing/nodejs/outside-kubernetes) Outside Kubernetes you install the agent from npm, add it to `NODE_OPTIONS`, and configure it with `LOGDROP_*` environment variables. Your code does not change. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [Node.js requirements](/docs/backend-tracing/nodejs#requirements). ## 1. Install the agent and store the key [#1-install-the-agent-and-store-the-key] The agent is the npm package `@log-drop/node-agent`, which Node.js loads when it starts, and it reads the traces ingest key from a file. Add the agent to your service, next to its other dependencies: ```bash npm install @log-drop/node-agent@0.1.0-alpha1 ``` Store the key in a file that only the service user can read: ```bash sudo mkdir -p /etc/logdrop printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then printf '%s' "$LOGDROP_TRACE_KEY" | sudo tee /etc/logdrop/trace-ingest-key >/dev/null else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY sudo chown /etc/logdrop/trace-ingest-key && sudo chmod 600 /etc/logdrop/trace-ingest-key ``` ## 2. Start Node.js with the agent [#2-start-nodejs-with-the-agent] `--require` in `NODE_OPTIONS` makes Node.js load the agent before your code. The `LOGDROP_*` variables tell it where to send traces, which key file to read and how your service appears in APM. Run this in the service's directory, where `node_modules` is: ```bash export LOGDROP_ENDPOINT=https://otel.logdrop.io export LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key export LOGDROP_SERVICE=orders export LOGDROP_ENVIRONMENT=production export LOGDROP_RELEASE=1.4.2 NODE_OPTIONS="--require @log-drop/node-agent/register.js" node server.js ``` The process then writes one line to standard error: ```text [logdrop-agent] INFO LogDrop Node.js agent 0.1.0-alpha1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Use `--require` for both CommonJS and ECMAScript module applications: the agent registers the module hooks that ES modules need on its own. If `NODE_OPTIONS` already holds flags, add the agent to them, for example `NODE_OPTIONS="--max-old-space-size=512 --require @log-drop/node-agent/register.js"`. ### With pm2 [#with-pm2] If pm2 runs your service, set `NODE_OPTIONS` and the `LOGDROP_*` variables in the app's `env`: ```js title="ecosystem.config.js (excerpt)" module.exports = { apps: [{ name: 'orders', script: 'server.js', env: { NODE_OPTIONS: '--require @log-drop/node-agent/register.js', LOGDROP_ENDPOINT: 'https://otel.logdrop.io', LOGDROP_INGEST_KEY_FILE: '/etc/logdrop/trace-ingest-key', LOGDROP_SERVICE: 'orders', LOGDROP_ENVIRONMENT: 'production', }, }], }; ``` In cluster mode, each pm2 worker is traced as its own instance of the service. ### As a systemd service [#as-a-systemd-service] If systemd runs your service, set the same variables in its unit file. `WorkingDirectory` must be the directory that holds `node_modules`, so that `--require` finds the agent: ```ini title="/etc/systemd/system/orders.service (excerpt)" [Service] WorkingDirectory=/opt/orders Environment=LOGDROP_ENDPOINT=https://otel.logdrop.io Environment=LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key Environment=LOGDROP_SERVICE=orders Environment=LOGDROP_ENVIRONMENT=production Environment="NODE_OPTIONS=--require @log-drop/node-agent/register.js" ExecStart=/usr/bin/node /opt/orders/server.js ``` ### In a container without Kubernetes [#in-a-container-without-kubernetes] Install the agent in the image with your other dependencies (`npm ci --omit=dev`), mount the key file read-only and set the same variables: ```bash docker run -v /etc/logdrop/trace-ingest-key:/run/secrets/logdrop-trace-ingest-key:ro \ -e NODE_OPTIONS="--require @log-drop/node-agent/register.js" \ -e LOGDROP_ENDPOINT=https://otel.logdrop.io -e LOGDROP_INGEST_KEY_FILE=/run/secrets/logdrop-trace-ingest-key \ -e LOGDROP_SERVICE=orders -e LOGDROP_ENVIRONMENT=production ``` The image's working directory must be the one that holds `node_modules`, or give the full path: `--require /app/node_modules/@log-drop/node-agent/register.js`. ## The key in a file or in a variable [#the-key-in-a-file-or-in-a-variable] `LOGDROP_INGEST_KEY` (the key itself in a variable) works too, but prefer the file: - the agent re-reads the file every 10 seconds, so you can [rotate the key](/docs/backend-tracing/nodejs/key-rotation) without a restart; - a variable is visible to anyone who can read the process environment. Set one of the two, not both. ## Things to know [#things-to-know] - Package manager processes (`npm`, `npx`, `yarn`, `pnpm`, `corepack`) inherit `NODE_OPTIONS` but are never traced, so `npm start` traces only your server. - If your build bundles the server into one file, read [Bundled applications](/docs/backend-tracing/nodejs/bundled-applications). - Outside containers, the agent adds the host ID and host name to every trace. - Each process gets a new instance ID in APM. Set `LOGDROP_SERVICE_INSTANCE_ID` to a stable value if restarts should count as the same instance. - The agent keeps the spans waiting to be sent in memory (at most 2,048 by default), not on disk. When the process runs out of work and exits on its own, the agent sends what is left for up to 10 seconds first. A process that ends with `process.exit()` or a signal does not wait: call [`LogDrop.flush`](/docs/backend-tracing/nodejs/custom-spans#other-calls) before it exits, for example at the end of a batch job. All settings are listed in [Agent settings](/docs/backend-tracing/nodejs/settings). # Agent Settings (/docs/backend-tracing/nodejs/settings) The LogDrop Node.js agent is configured only with `LOGDROP_*` environment variables, the same settings as the Java agent. On Kubernetes the trace injector sets the required ones for you; outside Kubernetes you set them yourself. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` / `LOGDROP_INGEST_KEY` | none | The traces ingest key, from a file (re-read every 10 seconds) or from a variable. Set one, not both | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it; elsewhere new for each process | Instance ID in APM. Outside Kubernetes, set a stable value if restarts should count as the same instance | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated [custom attribute](/docs/backend-tracing/nodejs/custom-spans#attributes-and-events) keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA | | `LOGDROP_ENABLED` | `true` | `false` turns the agent off | | `LOGDROP_DEBUG` | `false` | Agent diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long spans wait before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_COMPRESSION` | `gzip` | `gzip` or `none` | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release and the pod's identity from the chart values and the pod's annotations, and adds the agent to `NODE_OPTIONS`. Variables you set on the container win over the injected ones. See [Kubernetes](/docs/backend-tracing/nodejs/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The application always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own exporter, endpoint, sampler, propagator, header-capture and resource settings (`OTEL_*` variables) have no effect on the agent: it always exports to LogDrop, never samples, propagates W3C trace context and never captures headers. Configure it with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/nodejs/troubleshooting) The agent writes its messages to standard error with the prefix `[logdrop-agent]`. Each warning is logged at most once a minute, and no message ever contains the ingest key. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. | You see | Do this | |---|---| | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/nodejs/kubernetes#4-check-it)) and roll the pod | | `trace-status: skipped: unsupported language` on a `nodejs` pod | The installed chart is older than `0.1.1-alpha10` and knows only Java. Upgrade the chart and roll the pod | | No `trace-status` annotation and no `[logdrop-agent]` line | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `trace-status: injected` but no `[logdrop-agent]` line | Something replaced `NODE_OPTIONS` after the injector (a wrapper script that sets it), or the container's main process is not Node.js | | Out of memory after you enabled tracing, or other Node.js flags are gone | Your image sets `NODE_OPTIONS` in its Dockerfile, and the injector's value replaced it. Move it to the container's `env` ([Kubernetes, step 3](/docs/backend-tracing/nodejs/kubernetes#3-opt-a-workload-in)) | | `LogDrop tracing is disabled: Node.js … is not supported (22.15 or newer is).` | Move the service to Node.js 22.15 or newer. Until then it runs untraced | | `WARN HTTP requests are traced, but the application looks bundled: …` | See [Bundled applications](/docs/backend-tracing/nodejs/bundled-applications) | | `ERROR LogDrop tracing is disabled: another OpenTelemetry tracer provider is already registered in this process.` | The service starts its own OpenTelemetry SDK. Remove it, or do not opt the workload in | | `ERROR LogDrop tracing is disabled: the agent could not start.` | Contact LogDrop support with the Node.js version and, with `LOGDROP_DEBUG=true`, the lines that follow | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` naming a setting | The named setting is invalid. Fix it and restart | | `[logdrop-agent] INFO LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | Set the endpoint (on Kubernetes: `tracing.endpoint`) | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` (or your key file) is missing in that namespace, or empty | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The agent keeps the previous key until you fix it | | `LogDrop rejected the ingest key (HTTP 401).` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/nodejs/kubernetes) | | `LogDrop refused traces for this project (HTTP 403).` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `LogDrop rate-limited trace export (HTTP 429).` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/nodejs/limits)), or the project's trace storage is used up. Those batches are dropped | | `LogDrop is not reachable. Trace export failed.` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall, proxy or DNS). Before it warns, the agent resends a batch that could not connect for about 20 seconds, so a few seconds of network or DNS set-up while a pod starts lose nothing | | `LogDrop refused a trace batch as invalid (HTTP 400).` | Usually a clock far off (spans that start more than 5 minutes ahead), a `LOGDROP_MAX_*` setting above LogDrop's limits, or an outdated agent. The batch is dropped and counted as rejected in `LogDrop.exportStatus()` | | `LogDrop rejected trace export (HTTP ).` | Any other answer. For 502, 503 and 504 the agent has already retried for a few seconds. If it persists, contact LogDrop support with the time and the code | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once, often spans that custom code never ends | | Requests appear as `GET` without a route, and database spans are missing | The application is bundled, or its framework is not in the [traced libraries](/docs/backend-tracing/nodejs#requirements) | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If no trace appears and the table did not point to the cause, check each of these: 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The agent uses a key with the **Traces** signal whose status is **Active**. 3. The agent reports success: `logdrop.io/trace-status: injected` and its start line ([Check it](/docs/backend-tracing/nodejs/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the agent's default is `production`). 5. The agent's log shows no refusal from the table above. # Verify What You Install (/docs/backend-tracing/nodejs/verify) LogDrop signs the Node.js agent image and its Helm chart with cosign, using its own key. The image also carries a CycloneDX SBOM. A valid signature shows that a file comes from LogDrop and has not changed since LogDrop signed it. The SBOM (software bill of materials) lists the components inside the image. ## Image and chart [#image-and-chart] Check the chart and the agent image it pulls when you install on Kubernetes. The signatures are not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub # The agent image (the image the chart uses by digest), its SBOM, and the chart. cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/logdrop-node-agent:0.1.0-alpha1 cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true --type cyclonedx \ registry.logdrop.io/logdrop-node-agent:0.1.0-alpha1 cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Admission policies that verify images in your cluster need the same two settings: LogDrop's public key, and the transparency log check turned off. The charts `0.1.1-alpha10` to `0.1.1-alpha15` use the agent image by digest: `registry.logdrop.io/logdrop-node-agent@sha256:142d9230decc96da0a37bc749823f3d4ddd9cddc54ce764e119a177bd666b20d`. ## npm packages [#npm-packages] You install these packages to run the agent outside Kubernetes or to add custom spans. `@log-drop/node-agent` and `@log-drop/api` are published on the public npm registry, which signs every package. Check the signatures of the packages in your project with: ```bash npm audit signatures ``` # What LogDrop Records (/docs/backend-tracing/php/data-collected) The agent removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. It applies the same rules as the Java, Node.js, Python, .NET and Go agents, tested against the same cases. ## What a span carries [#what-a-span-carries] A span records one operation of your service, such as a request it handles or a query it sends, with its timing and result. The spans of one request across your services form a trace. Each span the agent sends can carry: - Route templates as Laravel declares them, such as `GET /orders/{id}`, HTTP methods and status codes. Without a framework route, a request is named by its method alone (`GET`): the raw path is never sent. - Error types, for example an exception class such as `App\Exceptions\PaymentFailed`, also for an exception that ends the request, or a status code. - The hosts and ports your service calls. - Database systems, database names and operations; messaging systems, operations and destinations; RPC operation names. - SQL statements only as value-free templates, such as `SELECT id, total FROM orders WHERE id = ?`: every literal in the statement is replaced by `?` before it leaves the process. - Redis command names in Laravel, such as `GET` or `INCRBY`, never their keys or values. - Your service's identity: service, service group, release, environment and instance. - Where it runs: the cluster, namespace, node, workload, pod and container. - Custom attributes of your own OpenTelemetry spans, only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, full URLs and query strings, request and response bodies, SQL values, Redis keys, message bodies, exception messages and stack traces. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. Command lines and environment variables never leave the process. The agent sends traces only: the distro's metrics and logs are turned off. The process command line, which holds the query string under a web server, is never part of the resource. ## What is traced [#what-is-traced] These rules decide which operations the agent turns into spans. - Every span is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/php/limits) applies instead. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced, together with the spans they cause. Other health checks are. # PHP (/docs/backend-tracing/php) LogDrop traces PHP services without code changes. On Kubernetes, one pod annotation adds the LogDrop PHP agent to your pods; your images stay as they are. The agent is a distribution of the OpenTelemetry PHP Distro with LogDrop's pipeline. It records the requests your service handles and its calls to databases and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key, from a background thread, off the request path. It removes the same data as the [Java](/docs/backend-tracing/java), [Node.js](/docs/backend-tracing/nodejs), [Python](/docs/backend-tracing/python), [.NET](/docs/backend-tracing/dotnet) and [Go](/docs/backend-tracing/go) agents, so a request that crosses services in these languages appears as one trace. Current release: LogDrop PHP agent `0.1.0-alpha2` (the image `registry.logdrop.io/logdrop-php-agent`) and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you install the agent, check that you have the LogDrop project and key, and that your platform, PHP version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - Kubernetes 1.28 or newer with Helm 3.8 or newer. The agent image `0.1.0-alpha2` runs on linux/amd64 nodes only. - **PHP 8.1 to 8.5 on Linux**, with php-fpm, Apache with mod_php (prefork) or the CLI. Debian-based images (the default) and Alpine images, which need one more pod annotation. - Traced libraries: Laravel 6 to 13 (requests with their route, database queries, queue jobs), Slim 4, PDO, MySQLi, PostgreSQL (`pgsql`), cURL and PSR-18 HTTP clients (Guzzle and Laravel's HTTP client included). - Not traced yet: Symfony's routes, and Redis outside Laravel. Their requests and queries are still traced, without a route name. - Not supported: a service that runs another APM's PHP extension (for example Datadog, New Relic or Elastic). Pods with another OpenTelemetry PHP setup of their own run untraced by LogDrop. - Outside Kubernetes the agent is not packaged in this release. ## Install the agent [#install-the-agent] This release installs the agent on Kubernetes only, with the LogDrop Helm chart. - [Kubernetes](/docs/backend-tracing/php/kubernetes): Install the LogDrop Helm chart and opt workloads in with one pod annotation. ## Reference [#reference] These pages hold the details behind the install guide. Use them to change a setting, plan for limits or fix a problem. - [Agent settings](/docs/backend-tracing/php/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/php/limits): What LogDrop accepts per request, per key and per project, and how PHP workers batch their spans. - [Rotate the ingest key](/docs/backend-tracing/php/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/php/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/php/verify): Check the signatures of the agent image and the chart. - [Licences](/docs/backend-tracing/php/licences): The licences of the agent's parts. - [Troubleshooting](/docs/backend-tracing/php/troubleshooting): Agent messages and what to do about them. # Rotate the Ingest Key (/docs/backend-tracing/php/key-rotation) Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every agent that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] Rotating replaces the traces ingest key your agents use with a new one, for example before the old key expires. Follow these steps for a planned rotation: 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the agent reads the file again for every request (a long-running CLI worker every 10 seconds). 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no service logs `server returned with code 401`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] These points describe how agents react when a key changes or is revoked. - An agent whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/php/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: php` is created, the injector adds an init container that copies the LogDrop PHP agent into the pod, adds the agent's ini directory to `PHP_INI_SCAN_DIR` and sets the `LOGDROP_*` settings on your container. Your images and code stay unchanged. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [PHP requirements](/docs/backend-tracing/php#requirements). Java, Node.js, Python, .NET, Go, PHP and Rust services use the same chart, the same values and the same key Secret: if you already trace services in another language, upgrade the chart to `0.1.1-alpha15` and go to [step 3](#3-opt-a-workload-in). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the agent sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the agent reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` The chart pulls the agent image (`registry.logdrop.io/logdrop-php-agent`) and the injector's runtime from `registry.logdrop.io` by digest; see [Verify what you install](/docs/backend-tracing/php/verify). One image serves PHP 8.1 to 8.5, in Debian-based and Alpine application images. The `0.1.0-alpha2` agent image is built for linux/amd64 only: pods on arm64 nodes are not supported yet. With these values the chart installs one small webhook pod, the trace injector, and nothing else. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods are instrumented. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: php` (or `java`, `nodejs`, `python`, `dotnet`, `go`, `rust`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.php.image` | LogDrop's published agent, by digest | Set your own repository and digest (or tag) when you mirror images. Do not clear it: pods are then skipped with `php agent image not configured` | | `tracing.php.imagePullSecrets` | empty | Pull Secrets for the agent image. They must exist in every traced namespace | | `tracing.php.resources` | requests 10m / 16Mi, limits 100m / 64Mi | The init container that copies the agent. Your container keeps its own resources | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without tracing | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector adds the agent only to pods whose template carries the annotation `logdrop.io/trace: php`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: php # needed with requirePodLabel: true annotations: logdrop.io/trace: php logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional logdrop.io/libc: musl # only for Alpine-based images ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: php` | Opts the pod in. `php`, `java`, `nodejs`, `python`, `dotnet`, `go` and `rust` are supported; any other value is skipped with a status | | `logdrop.io/libc` | `glibc` (the default) or `musl`. Set `musl` for Alpine-based images | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to trace. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the agent is added when a pod is created. The injector sets these on the container: - `PHP_INI_SCAN_DIR`: the agent's ini directory `/logdrop-agent/php/ini` is added after the directories already listed. When the container does not set the variable, it becomes `:/logdrop-agent/php/ini`; the leading `:` keeps PHP's own scan directory, so your image's ini files still load. - `LOGDROP_SPOOL_DIR` and a small writable volume at `/var/run/logdrop.io/spool`: PHP keeps nothing between requests, so the container's workers batch their spans there and send them together, about once a second (see [Limits](/docs/backend-tracing/php/limits#sizing-a-fleet)). - The `LOGDROP_*` settings. The agent's ini reads them when PHP starts, so php-fpm workers get them although php-fpm hides the environment from its workers (`clear_env`). > **Warning: Alpine images need logdrop.io/libc: musl** > > The agent's extension is built for one C library. Debian and Ubuntu images use glibc, the default; Alpine images use musl and need the annotation `logdrop.io/libc: musl`. With the wrong one, PHP cannot load the extension: your service runs normally, but untraced, and PHP logs `Unable to load dynamic library '/logdrop-agent/php/opentelemetry_php_distro_loader.so'` when it starts. Check the image's base before you opt the workload in: > > ```bash > docker run --rm --entrypoint cat /etc/os-release | grep '^ID=' > ``` > > `ID=alpine` needs the annotation; `debian` or `ubuntu` does not. A PHP_INI_SCAN_DIR set only in your image (`ENV PHP_INI_SCAN_DIR=…` in a Dockerfile) is not seen by the injector and is replaced: set it in the container's `env` instead, and the injector keeps your directories. ## 4. Check it [#4-check-it] Check that the injector added the agent to the new pods. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the agent is in. The container log then shows one line from the agent, once per PHP worker process: ```text [logdrop-agent] INFO LogDrop PHP agent 0.1.0-alpha2 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The agent was added | | `skipped: unsupported language` | The annotation value is not `php`, `java`, `nodejs`, `python`, `dotnet`, `go` or `rust`. On a `php` pod: the installed chart is older than `0.1.1-alpha14`; upgrade it | | `skipped: php agent image not configured` | Your values clear `tracing.php.image`. Remove that override | | `skipped: invalid logdrop.io/libc` | Use `glibc` (the default) or `musl` | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: PHP_INI_SCAN_DIR uses valueFrom` | The container takes `PHP_INI_SCAN_DIR` from a ConfigMap or Secret, which the injector never rewrites. Set it as a literal `value` | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume names, or the paths `/logdrop-agent`, `/var/run/logdrop.io/spool` or `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section lists the network access the injector and the traced pods need, and the storage tracing uses in each pod. Check it when your cluster restricts network traffic, or when pods get no `trace-status` annotation. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: php} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the agent starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories and no persistent volumes. Each traced pod gets an `emptyDir` volume, limited to 160 MiB, that holds the agent's files (about 90 MB: the extension for every PHP version from 8.1 to 8.5), and one limited to 16 MiB for the spool, which holds at most about a second of spans. ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** tracing and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot instrument is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected agent fits into your pods. Check them before you opt production workloads in. - `LOGDROP_*` variables that the container already sets win over the injected ones. - The agent sends traces only. The distro's own exporters, metrics and logs stay off, also where the container sets `OTEL_*` variables for them. - A Laravel request gets one server span, Laravel's, named by its route; queries are Laravel's query spans. Other applications get the request span the agent opens, named by the method alone (`GET`), because the raw path can carry IDs or personal data. - Spans leave the process from a background thread: an unreachable endpoint never slows your requests down. - Containers added by webhooks that run after the injector are not instrumented. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. Running pods keep the agent they started with until they are restarted, so roll your workloads to pick up a new agent version. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; instrumented pods keep their copy of the agent until they restart. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/php/licences) The LogDrop PHP agent combines the OpenTelemetry PHP Distro, under the Apache License 2.0, with LogDrop's own parts, under the LogDrop Client Library License 1.1. ## LogDrop PHP agent [#logdrop-php-agent] The agent image is a distribution of the OpenTelemetry PHP Distro v0.7.1: - Its native extension, its PHP code and the OpenTelemetry PHP packages are included unmodified, except that the unscoped copy of its dependencies and its documentation are left out, under the Apache License 2.0 (`LICENSE-OpenTelemetry`, with `NOTICE-OpenTelemetry`). The packages under `php/scoped/*/vendor` keep their own licences. - The LogDrop parts (`php/logdrop_bootstrap_php_part.php`, `php/logdrop/` and the ini file: its bootstrap, its pipeline and its privacy rules) are under the [LogDrop Client Library License 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt) (`LICENSE-LogDrop.txt`). The image's `NOTICE` says which parts are which. # Limits (/docs/backend-tracing/php/limits) The agent keeps every request inside LogDrop's limits on its own. You only need these numbers if you change the agent's settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the agent sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The agent splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The agent drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Agent settings](/docs/backend-tracing/php/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The agent retries for a few seconds, then drops the batch | | Active spans per process | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits count per key and per project, so they decide how many busy containers can share one key and one project. PHP keeps nothing from one request to the next, so the workers of a container (php-fpm or Apache children, and CLI runs) put their spans in one spool file (on Kubernetes a small volume the trace injector adds) and send it together: about once a second while the container has traffic, and one request per 128 spans when it records more than 128 spans a second. The first request after a quiet second is sent at once. So one key carries about ten busy containers, or about 1,280 spans a second, and one project about fifty containers, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a container with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. What a burst leaves in the spool (at most its last second) is sent by the container's next request; the kubelet's probes come every few seconds, so on Kubernetes it waits seconds. Outside Kubernetes the spool is in the temporary directory (or `LOGDROP_SPOOL_DIR`); where neither is writable, each request sends its own spans, and one key then carries about ten requests a second. # Agent Settings (/docs/backend-tracing/php/settings) The LogDrop PHP agent is configured only with `LOGDROP_*` settings, the same as the Java agent. On Kubernetes the trace injector sets the required ones for you as environment variables; the agent's ini file reads them when PHP starts, so php-fpm workers get them too. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` | none | The file with the traces ingest key, read again for every request (a long-running CLI worker every 10 seconds). The key itself (`LOGDROP_INGEST_KEY`) works only where PHP sees the environment (the CLI, Apache), never in php-fpm workers: use the file | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it; all the container's PHP workers share it | Instance ID in APM | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated custom attribute keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA; contact LogDrop support to set it up for PHP | | `LOGDROP_ENABLED` | `true` | `false` turns the agent off | | `LOGDROP_DEBUG` | `false` | Agent diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time in one PHP process (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent from one request (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long the container's spool collects spans before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_SPOOL_DIR` | the temporary directory | Where the container's PHP workers batch their spans. The trace injector sets it to a small volume of its own | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release, the spool and the pod's identity from the chart values and the pod's annotations, and adds the agent through `PHP_INI_SCAN_DIR`. Variables you set on the container win over the injected `LOGDROP_*` ones. See [Kubernetes](/docs/backend-tracing/php/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The line appears once per PHP worker process. The application always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own exporter, endpoint, sampler, header-capture and resource settings (`OTEL_*` variables) have no effect on what the agent sends: it always exports to LogDrop, never samples, propagates W3C trace context and baggage, never captures headers and sends only LogDrop's resource attributes. Configure the agent with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/php/troubleshooting) The agent writes its own messages to standard error with the prefix `[logdrop-agent]`, once per PHP worker process, and no message ever contains the ingest key. Refusals from LogDrop come from the sender the agent is built on, with the prefix `[OTEL]`. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. Under php-fpm, worker output reaches the container log when `catch_workers_output = yes` (the default of the official images). | You see | Do this | |---|---| | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/php/kubernetes#4-check-it)) and roll the pod | | `trace-status: skipped: unsupported language` on a `php` pod | The installed chart is older than `0.1.1-alpha14` and does not know PHP. Upgrade the chart and roll the pod | | No `trace-status` annotation and no `[logdrop-agent]` line | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `PHP Warning: PHP Startup: Unable to load dynamic library '/logdrop-agent/php/opentelemetry_php_distro_loader.so'` | The agent does not match the image's C library: an Alpine image without `logdrop.io/libc: musl`, or a Debian or Ubuntu image with it ([Kubernetes, step 3](/docs/backend-tracing/php/kubernetes#3-opt-a-workload-in)). Fix the annotation and roll the pod. The service runs untraced until then | | `trace-status: injected` but no `[logdrop-agent]` line | PHP did not read the agent's ini: something replaced `PHP_INI_SCAN_DIR` after the injector (a start script, or an `ENV` in the image when the container sets none), or the container's process is not PHP. Check with `php --ini` in the container | | `ERROR LogDrop tracing is disabled: the agent could not start.` | Contact LogDrop support with the PHP version and, with `LOGDROP_DEBUG=true`, the lines that follow | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` naming a setting | The named setting is invalid. Fix it and roll the pod | | `[logdrop-agent] INFO LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | Set the endpoint (`tracing.endpoint`) | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` is missing in that namespace, or empty | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The agent keeps the previous key until you fix it | | `[OTEL] … server returned with code 401` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/php/kubernetes) | | `[OTEL] … server returned with code 403` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `[OTEL] … server returned with code 429` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/php/limits)), or the project's trace storage is used up | | `[OTEL] … server returned with code 400` | Usually a clock far off (spans that start more than 5 minutes ahead) or a `LOGDROP_MAX_*` setting above LogDrop's limits. The batch is dropped | | `[OTEL] … sendPayload failed: Timeout was reached` or `Could not resolve host` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall, proxy or DNS). The sender retries a few times in the background; your requests are not slowed down | | `LogDrop could not use its spool in the temporary directory; each request is sent on its own.` | Outside Kubernetes: make the temporary directory (or `LOGDROP_SPOOL_DIR`) writable for the PHP user. Without the spool, a busy service can reach the request rate per key | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once in one PHP process, for example in a long-running worker whose spans never end | | Requests appear as `GET` without a route | Only Laravel's requests carry a route. Other frameworks' requests are named by their method, never by their path | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If no trace appears and the container log shows none of the messages above, go through this checklist. 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The agent uses a key with the **Traces** signal whose status is **Active**. 3. The agent reports success: `logdrop.io/trace-status: injected` and its start line ([Check it](/docs/backend-tracing/php/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the agent's default is `production`). 5. The container log shows no `[OTEL]` refusal from the table above. # Verify What You Install (/docs/backend-tracing/php/verify) LogDrop signs the PHP agent image and its Helm chart with cosign, using its own key. The image also carries a CycloneDX SBOM. ## Image and chart [#image-and-chart] A signature check shows that the agent image, its SBOM (the list of software in the image) and the chart come from LogDrop and were not changed. Run it before you deploy, or let an admission policy in your cluster check the image. The signatures are not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub # The agent image (the image the chart uses by digest), its SBOM, and the chart. cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/logdrop-php-agent:0.1.0-alpha2 cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true --type cyclonedx \ registry.logdrop.io/logdrop-php-agent:0.1.0-alpha2 cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Admission policies that verify images in your cluster need the same two settings: LogDrop's public key, and the transparency log check turned off. The charts `0.1.1-alpha14` and `0.1.1-alpha15` use the agent image by digest: `registry.logdrop.io/logdrop-php-agent@sha256:3879ec2a885c4cb9a6161c83d3217be9cbd82691e8340110469f709aed4b5b82`. ## What the image contains [#what-the-image-contains] The OpenTelemetry PHP Distro v0.7.1 release packages (its `.deb` for glibc and `.apk` for musl), checked by their published checksums when the image is built, with LogDrop's pipeline added. Nothing is downloaded when a pod starts: the init container only copies files from the image. # Custom Spans (/docs/backend-tracing/python/custom-spans) Most services need no code: the agent traces incoming requests and calls to databases, caches, brokers and other services on its own. For business operations you want to see as their own step in a trace, add the optional `logdrop-api` package. ## Add the package [#add-the-package] `logdrop-api` gives your code an API to create spans. The agent running in your service records and sends them. The package is published on PyPI. It has no dependencies, includes type hints and runs on Python 3.8 or newer. ```bash pip install logdrop-api==0.1.0a1 ``` ## Add a span [#add-a-span] A custom span is a span your code starts and ends around a step of its own work, such as pricing an order. That step then shows in the trace as its own row, with its duration. ```python from logdrop_api import LogDrop tracing = LogDrop.tracing() with tracing.span("checkout.price") as span: span.attribute("order.type", "delivery") # custom keys need LOGDROP_ALLOWED_ATTRIBUTE_KEYS=order.type total = pricing.total(order) ``` The span is current inside the `with` block, so the calls inside it (database, HTTP, messaging) appear under it in the same trace, also after an `await` (`async with` works too). It ends when the block ends. An exception raised in the block is recorded with its type only and passed on unchanged. For a whole function, use the decorator. It works for functions and coroutine functions: ```python @tracing.traced("checkout.validate") async def validate(order): ... ``` For work that does not fit in one block, start the span yourself and end it: ```python span = tracing.start_span("import.file", kind="CONSUMER") try: span.run(lambda: import_file(path)) # spans started inside are its children span.success() except Exception as error: span.record_exception(error) raise finally: span.end() ``` `tracing.in_span(name, work)` and `await tracing.in_span_async(name, work)` run a function that receives the span. ## Attributes and events [#attributes-and-events] Attributes add detail to a span as key and value pairs, such as `order.type` with the value `delivery`. Events mark a named moment inside a span, such as `payment.authorized`. What you add follows these rules: - A custom attribute is sent only when its key is listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` (comma-separated, at most 128 keys). A key starts with a letter and has at most 128 letters, digits, `_`, `.` or `-`. - Keys that contain `authorization`, `cookie`, `token`, `secret`, `password`, `credential`, `api_key`, `apikey` or `api-key` are always dropped, even when listed. - Values are strings, integers, floats or booleans. Text is cut to `LOGDROP_MAX_STRING_LENGTH` characters (256 by default). - Use constant event names, without request or user data: `span.event("payment.authorized")`. - `record_exception` records only the exception type, never its message or traceback. - Span names are at most 256 characters and not empty. ## Other calls [#other-calls] The package also has calls to send pending spans, check the agent's status, switch the ingest key and work with the current span. Use them, for example, to send a batch job's spans before it exits. | Call | What it does | |---|---| | `LogDrop.flush(seconds)` | Sends the spans that ended before the call, for example before a batch job exits. Returns `False` when it did not finish in time, an export failed, or no agent is attached. The timeout is more than 0 and at most 60 seconds | | `LogDrop.export_status()` | Counts of exported, failed, rejected (refused as invalid, or dropped before sending because LogDrop would refuse them), pending, refused (over the active-span limit) and active spans, and whether the agent is attached | | `LogDrop.update_ingest_credential(key)` | Uses this key for later requests, without a restart, until the key file changes again | | `LogDrop.is_agent_attached()` | Whether the LogDrop Python agent runs in this process | | `tracing.current_span_context()` | The trace and span ID of the current span, or `None` | | `tracing.capture_context()` | Keeps the current span for later: `run(fn)` or `wrap(fn)` runs code with it as current, for example in a thread pool or a callback | | `start_span(name, kind=..., links=[...])` | `kind` is `INTERNAL` (default), `SERVER`, `CLIENT`, `PRODUCER` or `CONSUMER`; `links` points at related spans by their context | ## Without the agent [#without-the-agent] The package sends nothing to LogDrop by itself. Without the agent every call is safe and records nothing: `with tracing.span(...)` and the decorator still run your code, `flush` returns `False`, `export_status()` reports that no agent is attached, and `update_ingest_credential` raises `RuntimeError`. # What LogDrop Records (/docs/backend-tracing/python/data-collected) The agent removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. It applies the same rules as the Java and Node.js agents. ## What a span carries [#what-a-span-carries] A span records one operation of your service, such as a request it handles or a query it sends, with its timing and result. The spans of one request across your services form a trace. Each span the agent sends can carry: - Route templates such as `GET /orders/{order_id}` (Django: `GET orders/`), HTTP methods and status codes. - Error types, for example an exception class or a status code. - The hosts and ports your service calls. - Database systems, database names and operations; messaging systems, operations and destinations; RPC operation names. - SQL statements only as value-free templates, such as `SELECT id, total FROM orders WHERE id = %s`: every literal in the statement is replaced by `?` before it leaves the process. - Redis command names, such as `GET` or `INCRBY`, never their keys or values. - Your service's identity: service, service group, release, environment and instance. - Where it runs: on Kubernetes the cluster, namespace, node, workload, pod and container; outside containers the host ID and host name. - [Custom attributes](/docs/backend-tracing/python/custom-spans#attributes-and-events), only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, full URLs and query strings, request and response bodies, SQL values, Redis keys, message bodies, exception messages and tracebacks. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. Command lines and environment variables never leave the process. The agent sends traces only: it collects no logs and no metrics. ## What is traced [#what-is-traced] These rules decide which operations the agent turns into spans. - Every span is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/python/limits) applies instead. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced. Other health checks are. - One server span per request: FastAPI's internal ASGI send and receive steps record no spans of their own. - SQLAlchemy queries are recorded once, by their database driver. # Python (/docs/backend-tracing/python) LogDrop traces Python services without code changes. On Kubernetes, one pod annotation adds the LogDrop Python agent; outside Kubernetes, you start your service with `logdrop-run`. The agent is a distribution of OpenTelemetry Python. It records the requests your service handles and its calls to databases, caches, message brokers and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. It removes the same data as the [Java agent](/docs/backend-tracing/java) and the [Node.js agent](/docs/backend-tracing/nodejs), so a request that crosses Java, Node.js and Python services appears as one trace. Current release: LogDrop Python agent `0.1.0-alpha1` (the image `registry.logdrop.io/logdrop-python-agent`, and `logdrop-agent` and `logdrop-api` `0.1.0a1` on PyPI) and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you install the agent, check that you have the LogDrop project and key, and that your platform, Python version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - Kubernetes 1.28 or newer with Helm 3.8 or newer, or any host that runs Python. On Kubernetes, the agent image `0.1.0-alpha1` runs on linux/amd64 nodes only. - **CPython 3.10 or newer.** Python 3.10 to 3.14 are tested, on Debian and Alpine images. On an older Python the agent prints one line and your service runs untraced. - Traced libraries: Django, Flask and FastAPI; outgoing HTTP with `requests`, `httpx`, `urllib3`, `urllib` and `aiohttp`; PostgreSQL (`psycopg`, `psycopg2`, `asyncpg`), MySQL (`PyMySQL`, `mysqlclient`, `mysql-connector`), MongoDB (`pymongo`), Redis (`redis`), RabbitMQ (`pika`, `aio-pika`), Kafka (`kafka-python`, `confluent-kafka`), Celery and gRPC. SQLAlchemy is traced through its database driver. - Servers: tested with gunicorn, with sync and uvicorn workers. Worker processes forked by the server are traced. - Not supported yet: gevent and eventlet workers, PyPy, frozen applications (PyInstaller) and Python started with `-I` or `-E` (both ignore `PYTHONPATH`). ## Install the agent [#install-the-agent] Choose the guide for where your service runs. Both add the same agent, configured with the same `LOGDROP_*` settings. - [Kubernetes](/docs/backend-tracing/python/kubernetes): Install the LogDrop Helm chart and opt workloads in with one pod annotation. - [Outside Kubernetes](/docs/backend-tracing/python/outside-kubernetes): Install the agent from PyPI and start your service with `logdrop-run`, on a host, with systemd or in a container. ## Reference [#reference] These pages hold the details behind the install guides. Use them to add your own spans, change a setting, plan for limits or fix a problem. - [Your packages and the agent's](/docs/backend-tracing/python/packages): How the agent's packages sit next to your service's, and when the agent stays off. - [Custom spans](/docs/backend-tracing/python/custom-spans): Add spans for business operations with the optional `logdrop-api` package. - [Agent settings](/docs/backend-tracing/python/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/python/limits): What LogDrop accepts per request, per key and per project. - [Rotate the ingest key](/docs/backend-tracing/python/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/python/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/python/verify): Check the signatures of the agent image, the chart and the PyPI packages. - [Licences](/docs/backend-tracing/python/licences): The licences of the agent and the API package. - [Troubleshooting](/docs/backend-tracing/python/troubleshooting): Agent messages and what to do about them. # Rotate the Ingest Key (/docs/backend-tracing/python/key-rotation) Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every agent that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] Rotating replaces the traces ingest key your agents use with a new one, for example before the old key expires. Follow these steps for a planned rotation: 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the agent re-reads the file every 10 seconds. Outside Kubernetes, replace the key file in one step: write a new file next to it, then `mv` it over the old one. The agent reads it within 10 seconds. Services that pass the key in `LOGDROP_INGEST_KEY` need a restart. 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no agent logs `LogDrop rejected the ingest key`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] These points describe how agents react when a key changes or is revoked. - An agent whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - A running service can also switch keys in code with `LogDrop.update_ingest_credential(key)` from `logdrop-api`; see [Custom spans](/docs/backend-tracing/python/custom-spans#other-calls). - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/python/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: python` is created, the injector adds an init container that copies the LogDrop Python agent into the pod and puts its start-up directory first on `PYTHONPATH`, with the `LOGDROP_*` settings on your container. Your images and code stay unchanged. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [Python requirements](/docs/backend-tracing/python#requirements). Java, Node.js, Python, .NET, Go, PHP and Rust services use the same chart, the same values and the same key Secret: if you already trace services in another language, upgrade the chart to `0.1.1-alpha15` and go to [step 3](#3-opt-a-workload-in). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the agent sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the agent reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` The chart pulls the agent image (`registry.logdrop.io/logdrop-python-agent`) and the injector's runtime from `registry.logdrop.io` by digest; see [Verify what you install](/docs/backend-tracing/python/verify). The agent is plain Python, so one image serves every Python version from 3.10 on, in glibc and Alpine application images. The `0.1.0-alpha1` agent image is built for linux/amd64 only: pods on arm64 nodes are not supported yet. With these values the chart installs one small webhook pod, the trace injector, and nothing else. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods are instrumented. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: python` (or `java`, `nodejs`, `dotnet`, `go`, `php`, `rust`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.python.image` | LogDrop's published agent, by digest | Set your own repository and digest (or tag) when you mirror images. Do not clear it: pods are then skipped with `python agent image not configured` | | `tracing.python.imagePullSecrets` | empty | Pull Secrets for the agent image. They must exist in every traced namespace | | `tracing.python.resources` | requests 10m / 16Mi, limits 100m / 64Mi | The init container that copies the agent. Your container keeps its own resources | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without tracing | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector adds the agent only to pods whose template carries the annotation `logdrop.io/trace: python`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: python # needed with requirePodLabel: true annotations: logdrop.io/trace: python logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: python` | Opts the pod in. `python`, `nodejs`, `java`, `dotnet`, `go`, `php` and `rust` are supported; any other value is skipped with a status | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to trace. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the agent is added when a pod is created. The injector puts `/logdrop-agent/python/boot` first on the container's `PYTHONPATH`; Python then starts the agent before your code. If the container sets `PYTHONPATH` in its `env`, your entries are kept after the agent's. > **Warning: PYTHONPATH from the image is replaced** > > A `PYTHONPATH` set only in your image (`ENV PYTHONPATH=/app/src` in a Dockerfile) is replaced by the pod-level value the injector adds, and your service may then no longer find its own modules. Check the image before you opt the workload in, and if it prints a value, set the same value in the container's `env`: > > ```bash > docker image inspect --format '{{range .Config.Env}}{{println .}}{{end}}' | grep '^PYTHONPATH=' > ``` Also check that your image's packages fit the agent: [Your packages and the agent's](/docs/backend-tracing/python/packages). ## 4. Check it [#4-check-it] Check that the injector added the agent to the new pods. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the agent is in. The container log then shows one line from the agent (a gunicorn master prints it once, before it forks its workers): ```text [logdrop-agent] INFO LogDrop Python agent 0.1.0a1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The agent was added | | `skipped: unsupported language` | The annotation value is not `python`, `nodejs`, `java`, `dotnet`, `go`, `php` or `rust`. On a `python` pod: the installed chart is older than `0.1.1-alpha11`; upgrade it | | `skipped: python agent image not configured` | Your values clear `tracing.python.image`. Remove that override | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: PYTHONPATH uses valueFrom` | The container takes `PYTHONPATH` from a ConfigMap or Secret, which the injector never rewrites. Set it as a literal `value` | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume names, or the paths `/logdrop-agent` or `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section lists the network access the injector and the traced pods need, and the storage tracing uses in each pod. Check it when your cluster restricts network traffic, or when pods get no `trace-status` annotation. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: python} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the agent starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories and no persistent volumes. The agent keeps the spans waiting to be sent in memory (at most 2,048 by default) and drops new spans when that queue is full. Each traced pod gets an `emptyDir` volume, limited to 64 MiB, that holds the agent's files (about 27 MB). ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** tracing and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot instrument is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected agent fits into your pods. Check them before you opt production workloads in. - `PYTHONPATH` set in the image is replaced, as described in [step 3](#3-opt-a-workload-in). A value from `envFrom` is overridden the same way. - `LOGDROP_*` variables that the container already sets win over the injected ones. - Package managers and tools (`pip`, `poetry`, `uv`, `pipenv` and others) inherit `PYTHONPATH` but are never traced. - If your image installs its own OpenTelemetry SDK, the agent stays off and logs why; see [Your packages and the agent's](/docs/backend-tracing/python/packages). - Worker processes of pre-fork servers (gunicorn) are traced and count as one instance of the pod in APM. - Size the container for about 15 MiB more memory per Python process. - Containers added by webhooks that run after the injector are not instrumented. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. Running pods keep the agent they started with until they are restarted, so roll your workloads to pick up a new agent version. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; instrumented pods keep their copy of the agent until they restart. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/python/licences) The LogDrop Python agent combines OpenTelemetry Python, under the Apache License 2.0, with LogDrop's own parts, under the LogDrop Client Library License 1.0. ## LogDrop API package [#logdrop-api-package] `logdrop-api` is licensed under the [LogDrop Client Library License 1.0](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.0.txt). In short, you may use it to send telemetry to LogDrop and include it, unmodified, in your applications; you may not modify it or distribute it on its own. The licence text is the authoritative version. The package carries it as `LICENSE`. ## LogDrop Python agent [#logdrop-python-agent] The agent is a distribution of OpenTelemetry Python and OpenTelemetry Python Contrib: - The upstream packages stay unmodified under the Apache License 2.0, each with its own licence file (see the agent's `NOTICE`). - The LogDrop parts of `logdrop-agent` (its start-up hook, its pipeline and its privacy rules) are under the LogDrop Client Library License 1.0 (`LICENSE`). - The agent ships the Mozilla CA certificate bundle as published by certifi, under the Mozilla Public License 2.0. It is used only when the system has no CA certificates. ## Licence versions [#licence-versions] The current release carries version 1.0 of the LogDrop Client Library License. Later releases carry [version 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt), which names the LogDrop agents and libraries of every language; its other terms are the same. Each release is under the version it carries. # Limits (/docs/backend-tracing/python/limits) The agent keeps every request inside LogDrop's limits on its own. You only need these numbers if you change the agent's settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the agent sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The agent splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The agent drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Agent settings](/docs/backend-tracing/python/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The agent retries for a few seconds, then drops the batch | | Active spans per process (each gunicorn worker is one) | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits count per key and per project, so they decide how many busy processes can share one key and one project. At the default settings, a Python process sends a request about once a second while it has traffic, and one request per 128 spans when it records more than 128 spans a second. So one key carries about ten busy processes, or about 1,280 spans a second, and one project about fifty processes, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a process with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. # Outside Kubernetes (/docs/backend-tracing/python/outside-kubernetes) Outside Kubernetes you install the agent from PyPI next to your service's dependencies, start the service with `logdrop-run`, and configure the agent with `LOGDROP_*` environment variables. Your code does not change. You need a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start), and the [Python requirements](/docs/backend-tracing/python#requirements). ## 1. Install the agent and store the key [#1-install-the-agent-and-store-the-key] The agent is the PyPI package `logdrop-agent`. It sends traces to LogDrop with your traces ingest key, which you keep in a file. Install the agent in the same environment (virtualenv) as your service: ```bash pip install logdrop-agent==0.1.0a1 ``` Store the key in a file that only the service user can read: ```bash sudo mkdir -p /etc/logdrop printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then printf '%s' "$LOGDROP_TRACE_KEY" | sudo tee /etc/logdrop/trace-ingest-key >/dev/null else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY sudo chown /etc/logdrop/trace-ingest-key && sudo chmod 600 /etc/logdrop/trace-ingest-key ``` ## 2. Start your service with `logdrop-run` [#2-start-your-service-with-logdrop-run] `logdrop-run` comes with `logdrop-agent` and starts your service with the agent loaded. The agent takes its settings from `LOGDROP_*` environment variables. Put `logdrop-run` in front of the command that starts your service: ```bash export LOGDROP_ENDPOINT=https://otel.logdrop.io export LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key export LOGDROP_SERVICE=orders export LOGDROP_ENVIRONMENT=production export LOGDROP_RELEASE=1.4.2 logdrop-run gunicorn app:app # or: logdrop-run python app.py, logdrop-run uvicorn main:app ``` The process then writes one line to standard error: ```text [logdrop-agent] INFO LogDrop Python agent 0.1.0a1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` `logdrop-run` puts the agent's start-up directory first on `PYTHONPATH`, keeps the entries you already have there, and replaces itself with your command, so signals, the exit code and the process ID stay your command's. A pre-fork server such as gunicorn prints the line once; its worker processes are traced too. ### As a systemd service [#as-a-systemd-service] When systemd starts your service, set the `LOGDROP_*` variables with `Environment=` lines and put `logdrop-run` in front of the command in `ExecStart`: ```ini title="/etc/systemd/system/orders.service (excerpt)" [Service] WorkingDirectory=/opt/orders Environment=LOGDROP_ENDPOINT=https://otel.logdrop.io Environment=LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key Environment=LOGDROP_SERVICE=orders Environment=LOGDROP_ENVIRONMENT=production ExecStart=/opt/orders/.venv/bin/logdrop-run /opt/orders/.venv/bin/gunicorn app:app ``` ### In a container without Kubernetes [#in-a-container-without-kubernetes] Install `logdrop-agent` in the image with your other dependencies, put `logdrop-run` in front of the command, mount the key file read-only and set the same variables: ```dockerfile title="Dockerfile (excerpt)" RUN pip install --no-cache-dir -r requirements.txt logdrop-agent==0.1.0a1 CMD ["logdrop-run", "gunicorn", "app:app"] ``` ```bash docker run -v /etc/logdrop/trace-ingest-key:/run/secrets/logdrop-trace-ingest-key:ro \ -e LOGDROP_ENDPOINT=https://otel.logdrop.io -e LOGDROP_INGEST_KEY_FILE=/run/secrets/logdrop-trace-ingest-key \ -e LOGDROP_SERVICE=orders -e LOGDROP_ENVIRONMENT=production ``` ## The key in a file or in a variable [#the-key-in-a-file-or-in-a-variable] `LOGDROP_INGEST_KEY` (the key itself in a variable) works too, but prefer the file: - the agent re-reads the file every 10 seconds, so you can [rotate the key](/docs/backend-tracing/python/key-rotation) without a restart; - a variable is visible to anyone who can read the process environment. Set one of the two, not both. ## Things to know [#things-to-know] These points describe how the agent fits into your service's environment and processes. Check them before you run traced services in production. - pip installs the agent's OpenTelemetry packages in exact versions. If your service already pins other versions of them, pip reports the conflict when you install; see [Your packages and the agent's](/docs/backend-tracing/python/packages). - Package managers and tools (`pip`, `poetry`, `uv`, `pipenv` and others) that inherit `PYTHONPATH` are never traced. - Outside containers, the agent adds the host ID and host name to every trace. - Each process gets a new instance ID in APM. Set `LOGDROP_SERVICE_INSTANCE_ID` to a stable value if restarts should count as the same instance. - The agent keeps the spans waiting to be sent in memory (at most 2,048 by default), not on disk. When the process exits normally, the agent sends what is left for up to 10 seconds first. A process killed by a signal it does not handle does not wait: call [`LogDrop.flush`](/docs/backend-tracing/python/custom-spans#other-calls) before a batch job exits. - Overhead, measured with a FastAPI service on Python 3.13: about 0.05 s more start-up and about 15 MiB more memory per process. All settings are listed in [Agent settings](/docs/backend-tracing/python/settings). # Your Packages and the Agent's (/docs/backend-tracing/python/packages) Python loads every package of a process from one import path, so the agent's packages and your service's meet there. The agent is built so that your service never changes: on Kubernetes it brings its own copies and keeps out of your packages' way, and it stays off rather than run with packages it cannot use. ## On Kubernetes [#on-kubernetes] The agent image brings two sets of packages and puts them on the import path around yours: | Packages | Where | Effect | |---|---|---| | OpenTelemetry (`opentelemetry-api`, `opentelemetry-sdk` and the instrumentations) | Before your packages | Every library in your service uses the agent's OpenTelemetry API | | `typing_extensions`, `wrapt`, `packaging`, `asgiref` | After your packages | Where your image has one of them, your copy is used | Libraries that depend on `opentelemetry-api` keep working: FastAPI does, for example, and the API stays backwards compatible across 1.x. The agent stays off, with one line in your service's log that says why, in these cases: | Your image installs | Line | |---|---| | Its own OpenTelemetry SDK (`opentelemetry-sdk`), so it sets up its own pipeline | `the application installs its own OpenTelemetry SDK (opentelemetry-sdk )` | | An `opentelemetry-api` newer than the agent's | `the application's opentelemetry-api is newer than the agent's ()` | | `typing_extensions` older than 4.5, `wrapt` 3 or newer, `packaging` older than 18, or `asgiref` outside 3.x | `the application's does not fit the agent (it needs …)` | Your service then runs exactly as without the agent: the agent leaves the import path as it found it. ## Outside Kubernetes [#outside-kubernetes] `pip install logdrop-agent` installs the agent's packages into your service's environment, in the exact versions the agent was tested with. If your service pins other versions of them, pip reports the conflict when you install, before anything runs. The same rules apply: a service that sets up its own OpenTelemetry SDK should not also run the agent. ## Check an image before you opt it in [#check-an-image-before-you-opt-it-in] This command lists the packages in an image that decide whether the agent runs. Run it before a rollout to know whether the service will be traced or the agent will stay off. ```bash docker run --rm --entrypoint python -m pip list 2>/dev/null | grep -iE '^(opentelemetry|typing.extensions|wrapt|packaging|asgiref) ' ``` No line, or only `opentelemetry-api` in version `1.45.2` or older together with the four packages in the versions above, means the agent can run. # Agent Settings (/docs/backend-tracing/python/settings) The LogDrop Python agent is configured only with `LOGDROP_*` environment variables, the same settings as the Java agent. On Kubernetes the trace injector sets the required ones for you; outside Kubernetes you set them yourself. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` / `LOGDROP_INGEST_KEY` | none | The traces ingest key, from a file (re-read every 10 seconds) or from a variable. Set one, not both | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it; elsewhere new for each process | Instance ID in APM. Outside Kubernetes, set a stable value if restarts should count as the same instance | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated [custom attribute](/docs/backend-tracing/python/custom-spans#attributes-and-events) keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA | | `LOGDROP_ENABLED` | `true` | `false` turns the agent off | | `LOGDROP_DEBUG` | `false` | Agent diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long spans wait before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_COMPRESSION` | `gzip` | `gzip` or `none` | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release and the pod's identity from the chart values and the pod's annotations, and puts the agent first on `PYTHONPATH`. Variables you set on the container win over the injected ones. See [Kubernetes](/docs/backend-tracing/python/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The application always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own exporter, endpoint, sampler, propagator, header-capture and resource settings (`OTEL_*` variables) have no effect on the agent: it always exports to LogDrop, never samples, propagates W3C trace context and never captures headers. Configure it with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/python/troubleshooting) The agent writes its messages to standard error with the prefix `[logdrop-agent]`. Each warning is logged at most once a minute per process, and no message ever contains the ingest key. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. | You see | Do this | |---|---| | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/python/kubernetes#4-check-it)) and roll the pod | | `trace-status: skipped: unsupported language` on a `python` pod | The installed chart is older than `0.1.1-alpha11` and does not know Python. Upgrade the chart and roll the pod | | No `trace-status` annotation and no `[logdrop-agent]` line | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `trace-status: injected` but no `[logdrop-agent]` line | Something replaced `PYTHONPATH` after the injector (a wrapper script that sets it), or Python runs with `-I`, `-E` or `-S`, or the container's process is not Python | | `ModuleNotFoundError` for your own modules after you opted in | Your image sets `PYTHONPATH` in its Dockerfile, and the injector's value replaced it. Set the same value in the container's `env` ([Kubernetes, step 3](/docs/backend-tracing/python/kubernetes#3-opt-a-workload-in)) | | `LogDrop tracing is disabled: Python … is not supported (3.10 or newer is).` | Move the service to Python 3.10 or newer. Until then it runs untraced | | `ERROR LogDrop tracing is disabled: the application installs its own OpenTelemetry SDK …`, `… is newer than the agent's …` or `… does not fit the agent …` | See [Your packages and the agent's](/docs/backend-tracing/python/packages). The service runs untraced | | `ERROR LogDrop tracing is disabled: the agent could not start.` | Contact LogDrop support with the Python version and, with `LOGDROP_DEBUG=true`, the lines that follow | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` naming a setting | The named setting is invalid. Fix it and restart | | `[logdrop-agent] INFO LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | Set the endpoint (on Kubernetes: `tracing.endpoint`) | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` (or your key file) is missing in that namespace, or empty | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The agent keeps the previous key until you fix it | | `LogDrop rejected the ingest key (HTTP 401).` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/python/kubernetes) | | `LogDrop refused traces for this project (HTTP 403).` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `LogDrop rate-limited trace export (HTTP 429).` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/python/limits)), or the project's trace storage is used up. Those batches are dropped | | `LogDrop is not reachable. Trace export failed.` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall, proxy or DNS). Before it warns, the agent resends a batch that could not connect for about 20 seconds, so a few seconds of network set-up while a pod starts lose nothing | | `LogDrop refused a trace batch as invalid (HTTP 400).` | Usually a clock far off (spans that start more than 5 minutes ahead), a `LOGDROP_MAX_*` setting above LogDrop's limits, or an outdated agent. The batch is dropped and counted as rejected in `LogDrop.export_status()` | | `LogDrop rejected trace export (HTTP ).` | Any other answer. For 502, 503 and 504 the agent has already retried for a few seconds. If it persists, contact LogDrop support with the time and the code | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once, often spans that custom code never ends | | Requests appear without a route, or database spans are missing | The framework or the database driver is not in the [traced libraries](/docs/backend-tracing/python#requirements) | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If no trace appears and the agent logs none of the messages above, go through this checklist. 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The agent uses a key with the **Traces** signal whose status is **Active**. 3. The agent reports success: `logdrop.io/trace-status: injected` and its start line ([Check it](/docs/backend-tracing/python/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the agent's default is `production`). 5. The agent's log shows no refusal from the table above. # Verify What You Install (/docs/backend-tracing/python/verify) LogDrop signs the Python agent image and its Helm chart with cosign, using its own key. The image also carries a CycloneDX SBOM. ## Image and chart [#image-and-chart] A signature check shows that the agent image, its SBOM (the list of software in the image) and the chart come from LogDrop and were not changed. Run it before you deploy, or let an admission policy in your cluster check the image. The signatures are not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub # The agent image (the image the chart uses by digest), its SBOM, and the chart. cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/logdrop-python-agent:0.1.0-alpha1 cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true --type cyclonedx \ registry.logdrop.io/logdrop-python-agent:0.1.0-alpha1 cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Admission policies that verify images in your cluster need the same two settings: LogDrop's public key, and the transparency log check turned off. The charts `0.1.1-alpha11` to `0.1.1-alpha15` use the agent image by digest: `registry.logdrop.io/logdrop-python-agent@sha256:767446a8b50d10aedd7e2885b50606fb84a020a865c61cc2c96db404bad1632b`. ## PyPI packages [#pypi-packages] `logdrop-agent` and `logdrop-api` are published on PyPI. pip checks each file against the SHA-256 hash PyPI publishes for it. To pin exactly what you install, use hashes in your requirements file: ```bash pip download --no-deps logdrop-agent==0.1.0a1 logdrop-api==0.1.0a1 -d logdrop pip hash logdrop/*.whl ``` Put the printed `--hash=sha256:…` values next to the two packages in your requirements file and install with `pip install --require-hashes -r requirements.txt`. # Custom Spans (/docs/backend-tracing/rust/custom-spans) The traced libraries already record incoming requests and calls to databases and other services. For business operations you want to see as their own step in a trace, use `tracing` spans: the LogDrop layer records every span at INFO level and above. ## Add a span [#add-a-span] Create a span at INFO level around the operation and run the operation inside it: ```rust use tracing::Instrument; let span = tracing::info_span!("checkout.price", order.kind = "delivery"); // custom keys need LOGDROP_ALLOWED_ATTRIBUTE_KEYS=order.kind let total = async { pricing::total(&order).await }.instrument(span).await; ``` Calls made inside the span (database statements, outgoing requests, other spans) appear under it in the same trace. For synchronous code use `span.in_scope(|| ...)`. DEBUG and TRACE spans are not recorded. Special fields set what OpenTelemetry records: | Field | Meaning | |---|---| | `otel.name = %name` | The span name, when it is not the static name in the macro. Use templates, never request or user data | | `otel.kind = "client"` | `internal` (the default), `server`, `client`, `producer` or `consumer` | | `otel.status_code = "ERROR"` | Marks the span as failed (`OK` or `ERROR`) | ## Attributes and errors [#attributes-and-errors] An attribute is a key and value on a span; in `tracing` it is a span field, such as `order.kind = "delivery"`. An error is recorded from an ERROR event inside the span. These rules apply to both, and to span names: - A custom attribute is sent only when its key is listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` (comma-separated, at most 128 keys). A key starts with a letter and has at most 128 letters, digits, `_`, `.` or `-`. Every other field of a span stays in the process. - Keys that contain `authorization`, `cookie`, `token`, `secret`, `password`, `credential`, `api_key`, `apikey` or `api-key` are always dropped, even when listed. - Values are a string, a `bool`, an integer or a float; other values are ignored. Text is cut to `LOGDROP_MAX_STRING_LENGTH` characters (256 by default). - Log events inside a span (`tracing::info!` and others) are never sent: their messages can carry anything. An ERROR event becomes an exception event with only the allowed fields, for example `tracing::error!(error.type = "PaymentDeclined", "declined")`; its message stays in the process. - Span names are at most 256 characters. ## Other calls [#other-calls] Besides spans, the crate has calls to send queued spans, read its state and switch the ingest key without a restart. A batch job, for example, calls `logdrop::flush` before it exits. | Call | What it does | |---|---| | `logdrop::flush(timeout)` | Sends the spans that ended before the call, for example before a batch job exits. Returns `false` when it did not finish in time, an export failed, or tracing does not run. The timeout is more than 0 and at most one minute | | `logdrop::export_status()` | Counts of exported, failed, rejected (refused as invalid, or dropped before sending because LogDrop would refuse them), pending, refused (over the active-span limit) and active spans, and whether tracing runs (`agent_attached`) | | `logdrop::update_ingest_credential(key)` | Uses this key for later requests, without a restart, until the key file changes again. Returns `CredentialError::NotAttached`, `InvalidCredential` or `Closed` when it cannot | | `logdrop::is_agent_attached()` | Whether tracing runs in this process | | `logdrop::shutdown()` | Sends the spans still queued, for at most 10 seconds, and stops tracing. `ShutdownGuard` calls it when dropped | ## Without tracing [#without-tracing] Without settings every call is safe and records nothing: spans still run your code, `flush` returns `false`, `export_status()` reports that tracing does not run, and `update_ingest_credential` returns `NotAttached`. # What LogDrop Records (/docs/backend-tracing/rust/data-collected) The crate removes everything that could carry personal or secret data before a span is queued for sending. What is left describes the shape of a request: which operation ran, where it went, how long it took and whether it failed. It applies the same rules as the Java, Node.js, Python, .NET, Go and PHP agents, tested against the same cases. ## What a span carries [#what-a-span-carries] A span is one operation: a request your service handles, or a call it makes to a database or another service. Besides its duration and whether it failed, a span carries: - Route templates as your router declares them, such as `GET /orders/{id}`, HTTP methods and status codes. - gRPC services, methods and status codes. - Error types you record, such as `error.type = "PaymentDeclined"`, or a status code. - The hosts and ports your service calls. - Database systems, database names and operations. - SQL statements only as value-free templates, such as `SELECT id, total FROM orders WHERE id = $1`: every literal in the statement is replaced by `?` before it leaves the process. - Your service's identity: service, service group, release, environment and instance. - Where it runs: the cluster, namespace, node, workload, pod and container. - [Custom attributes](/docs/backend-tracing/rust/custom-spans#attributes-and-errors), only for the keys you list in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS`. ## What is never sent [#what-is-never-sent] Request and response headers, cookies, URL paths and query strings, request and response bodies, SQL values, log messages, error messages and stack traces, and the user, password and parameters of `DATABASE_URL`. Span fields that are not standard and not listed in `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` stay in the process. Attribute keys that can carry secrets (for example `authorization`, `token` or `password`) are dropped even when you list them. W3C baggage is passed on to the services you call, but never recorded in a span. Command lines and environment variables never leave the process. The crate sends traces only: it records no metrics and no logs. ## What is traced [#what-is-traced] These rules decide which operations are recorded as spans and which are left out. - Every span at INFO level and above is recorded, without sampling, because APM counts calls and errors from the spans it receives. Under very high load the [active span limit](/docs/backend-tracing/rust/limits) applies instead. DEBUG and TRACE spans, such as those of HTTP and database libraries, are never recorded. - Kubernetes liveness, readiness and startup probes (requests with the User-Agent `kube-probe/…`) are not traced, together with the spans they cause. Other health checks are. # Rust (/docs/backend-tracing/rust) LogDrop traces Rust services with the LogDrop Rust crate, `logdrop` on crates.io. A Rust binary cannot load an agent at run time, so your service adds the crate, puts its layer into the `tracing` subscriber in `main` and adds one line per library it wants traced. On Kubernetes, one pod annotation then gives it its settings. The crate is a [`tracing`](https://docs.rs/tracing) layer with OpenTelemetry Rust and LogDrop's pipeline. It records the requests your service handles and its calls to databases and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. It removes the same data as the [Java](/docs/backend-tracing/java), [Node.js](/docs/backend-tracing/nodejs), [Python](/docs/backend-tracing/python), [.NET](/docs/backend-tracing/dotnet), [Go](/docs/backend-tracing/go) and [PHP](/docs/backend-tracing/php) agents, so a request that crosses services in these languages appears as one trace. Current release: LogDrop Rust crate `logdrop` `0.1.0-alpha1` and Helm chart `logdrop-infrastructure` `0.1.1-alpha15`. ## Requirements [#requirements] Before you add the crate, check that you have the LogDrop project and key, and that your platform, Rust version and libraries are supported. - The project, the traces ingest key and the endpoint from [Before you start](/docs/backend-tracing#before-you-start). - **Rust 1.85 or newer** and a service that uses `tracing` (the crate brings `tracing-subscriber` 0.3). - On Kubernetes: Kubernetes 1.28 or newer with Helm 3.8 or newer. Rust services run on any node architecture: there is no agent image. - Traced libraries ([Add the crate](/docs/backend-tracing/rust/install#2-trace-the-libraries-you-use)): axum 0.8 and other tower HTTP servers, tonic gRPC servers, reqwest 0.13 through reqwest-middleware 0.5, and sqlx 0.9 (PostgreSQL, MySQL, MariaDB, SQLite). Your own `tracing` spans at INFO level and above are recorded too. - Not supported yet: Redis clients, message brokers, actix-web and outgoing tonic calls. Their work appears inside the request's span, not as its own call. ## Set it up [#set-it-up] Add the crate to your service first. Then give it its settings with the guide for where the service runs: on Kubernetes through the LogDrop chart and one pod annotation, elsewhere through environment variables. - [Add the crate](/docs/backend-tracing/rust/install): `logdrop` in `Cargo.toml`, its layer in `main` and one line per traced library. - [Kubernetes](/docs/backend-tracing/rust/kubernetes): Install the LogDrop Helm chart; one pod annotation gives the service its settings. - [Other hosts](/docs/backend-tracing/rust/other-hosts): Virtual machines, Docker and other platforms: set the settings as environment variables. ## Reference [#reference] These pages hold the details behind the set-up guides. Use them to add your own spans, change a setting, plan for limits or fix a problem. - [Custom spans](/docs/backend-tracing/rust/custom-spans): Add spans for business operations with `tracing`. - [Settings](/docs/backend-tracing/rust/settings): Every `LOGDROP_*` setting, its default and its range. - [Limits](/docs/backend-tracing/rust/limits): What LogDrop accepts per request, per key and per project. - [Rotate the ingest key](/docs/backend-tracing/rust/key-rotation): Replace a key without losing traces. - [What LogDrop records](/docs/backend-tracing/rust/data-collected): The data a span carries, and what never leaves your service. - [Verify what you install](/docs/backend-tracing/rust/verify): How Cargo checks the crate, and the signature of the chart. - [Licences](/docs/backend-tracing/rust/licences): The licence of the crate and of what it uses. - [Troubleshooting](/docs/backend-tracing/rust/troubleshooting): Crate messages and what to do about them. # Add the Crate (/docs/backend-tracing/rust/install) Three changes to your service: add the crate, add its layer to your `tracing` subscriber at the beginning of `main`, and add one line for each library you want traced. Without settings the layer does nothing, so the same build runs traced and untraced. ## 1. Add the crate and its layer [#1-add-the-crate-and-its-layer] In `tracing`, a subscriber receives the spans and events that your code and its libraries create, and passes them to its layers. Add the crate to `Cargo.toml`, then add the LogDrop layer to your subscriber at the beginning of `main`: ```toml title="Cargo.toml" [dependencies] logdrop = { version = "0.1.0-alpha1", features = ["axum", "reqwest"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] } ``` ```rust use tracing_subscriber::prelude::*; #[tokio::main] async fn main() { tracing_subscriber::registry() .with(tracing_subscriber::fmt::layer().with_filter(tracing_subscriber::EnvFilter::new("info"))) .with(logdrop::layer()) // reads LOGDROP_*; no filter of its own .init(); let _logdrop = logdrop::ShutdownGuard; // sends what is still queued when main returns // build the router, clients and database pool here } ``` `logdrop::layer()` reads the [settings](/docs/backend-tracing/rust/settings), sets OpenTelemetry's global tracer provider and the W3C trace context and baggage propagators, and writes one start line. Create it before the code that creates servers, clients and database pools. A service without a subscriber of its own can call `logdrop::init()` instead, which installs one with only the LogDrop layer. `ShutdownGuard` sends the spans still queued, for at most 10 seconds, when it is dropped at the end of `main`. A service that stops through `std::process::exit` skips that: call `logdrop::shutdown()` before it if the last spans matter. Without settings, with invalid settings or with `LOGDROP_ENABLED=false`, the service runs untraced, with one line on standard error that says why. No call of the crate ever fails your service. ### Filters [#filters] A filter decides which spans and events a layer sees. Put your log filter on the log layer, as above, not on the whole subscriber. The LogDrop layer chooses on its own: it records spans at INFO level and above (never the DEBUG and TRACE spans of libraries), error events and sqlx's statement events. A filter on the whole subscriber that hides DEBUG events of `sqlx::query` hides the database statements from LogDrop too. ## 2. Trace the libraries you use [#2-trace-the-libraries-you-use] A span is one operation: a request your service handles, or a call it makes to a database or another service. A Rust binary cannot load an agent at run time, so each library below needs the line shown, with the `logdrop` feature in the last column. | Library | Line | Feature | |---|---|---| | axum | `Router::new().route(...).layer(logdrop::axum::TraceLayer)` | `axum` | | tonic server | `Server::builder().layer(logdrop::axum::TraceLayer)` | `axum` | | Other tower HTTP servers | `ServiceBuilder::new().layer(logdrop::axum::TraceLayer)` | `axum` | | reqwest | `reqwest_middleware::ClientBuilder::new(client).with(logdrop::reqwest::TraceMiddleware).build()` | `reqwest` | | sqlx | nothing: statements are recorded | none | ### Things to know [#things-to-know] These details decide whether a call is recorded, how it is named and whether it joins the request's trace. - **axum**: add the layer with `Router::layer` (or `route_layer`), so a request is named by its route template, such as `GET /orders/{id}`. A layer outside the router sees no route and names the request by its method only. - **tonic**: a gRPC request is named `package.Service/Method` and carries its gRPC status code when the answer has it in its headers. - **reqwest**: the middleware sends the trace context to the service it calls, so that service's spans join the same trace. Use the `ClientWithMiddleware` it builds for every call. - **sqlx**: sqlx reports each statement when it finishes; the crate records it as a call of the current span, from its start to its end. The database comes from `DATABASE_URL`, sqlx's own convention: its system (`postgres`, `mysql`, `mariadb`, `sqlite`), host, port and database name, never the user, password or parameters. Without `DATABASE_URL`, statements are recorded with the system `other_sql`. The statement is sent only as a value-free template. - **Your own spans**: work inside a request joins the request's trace when it runs in the request's span, for example through `.instrument(span)` on a future you spawn. See [Custom spans](/docs/backend-tracing/rust/custom-spans). ## 3. Give it its settings [#3-give-it-its-settings] The layer does nothing until it has its settings: at least the traces endpoint, the ingest key and the service name. How you give them depends on where the service runs. - On Kubernetes, one pod annotation does it: [Kubernetes](/docs/backend-tracing/rust/kubernetes). - Elsewhere, set the `LOGDROP_*` environment variables: [Other hosts](/docs/backend-tracing/rust/other-hosts). # Rotate the Ingest Key (/docs/backend-tracing/rust/key-rotation) Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it. > **Warning: Do not use Rotate for a planned rotation** > > The panel's **Rotate** action issues a replacement and **revokes the current key in the same step**. Every service that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep **Rotate** for a key that leaked, where stopping the old key at once matters more. ## Steps [#steps] Rotating replaces the ingest key your services send with, for example before it expires. Both keys work until you revoke the old one in step 4, so no traces are lost. 1. Create a second traces key in the panel (**Services & APM → Credentials → Create credential**). 2. Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace: ```bash printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in ; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the crate re-reads the file every 10 seconds. Outside Kubernetes, replace the content of the key file (`LOGDROP_INGEST_KEY_FILE`); the crate picks it up within 10 seconds. Services that pass the key in `LOGDROP_INGEST_KEY` instead of a file need a restart. 3. Wait until the new key is in use everywhere: the panel shows its **Last used** time (updated at most every 5 minutes), and no service logs `LogDrop rejected the ingest key`. Allow at least 10 minutes. 4. **Revoke** the old key. ## Things to know [#things-to-know] These points describe how running services pick up a new key, and what cannot be undone. - A service whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key. - If you mount the Secret yourself instead of through the injector, do not use `subPath`: a `subPath` mount never sees Secret updates. - A running service can also switch keys in code with `logdrop::update_ingest_credential(key)`; see [Custom spans](/docs/backend-tracing/rust/custom-spans#other-calls). - Revoking a key cannot be undone. # Kubernetes (/docs/backend-tracing/rust/kubernetes) The LogDrop Helm chart installs a small admission webhook, the trace injector. When a pod whose template carries the annotation `logdrop.io/trace: rust` is created, the injector mounts the ingest key and sets the `LOGDROP_*` settings and the pod's identity on your container. The LogDrop Rust crate in your service reads them at start. There is no init container and no agent image. You need a service that [adds the LogDrop Rust crate](/docs/backend-tracing/rust/install), a traces ingest key and the other items in [Before you start](/docs/backend-tracing#before-you-start). Java, Node.js, Python, .NET, Go, PHP and Rust services use the same chart, the same values and the same key Secret: if you already trace services in another language, upgrade the chart to `0.1.1-alpha15` and go to [step 3](#3-opt-a-workload-in). ## 1. Store the ingest key in each namespace you trace [#1-store-the-ingest-key-in-each-namespace-you-trace] The traces ingest key is the credential the crate sends traces to LogDrop with. On Kubernetes it lives in a Secret named `logdrop-trace-ingest-key` in each traced namespace. Create the Secret with: ```bash printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then kubectl -n create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The check refuses a key pasted twice or cut short; LogDrop answers such a key with `401`. The commands work in bash and zsh. The Secret must exist in **every** traced namespace; the chart never creates it. A pod in a namespace without the Secret still starts, but sends nothing (its log says `LogDrop ingest key file is missing or invalid`). The key never appears in pod specs or logs: the injector mounts the Secret as a read-only file and the crate reads it from there. With a GitOps tool, keep the Secret in your usual secret workflow (for example Sealed Secrets, External Secrets or SOPS), never as plain text in Git. ## 2. Install the LogDrop chart with tracing on [#2-install-the-logdrop-chart-with-tracing-on] The LogDrop Helm chart installs the trace injector in your cluster. The values below turn tracing on and set where traces go, which namespaces are traced and the environment shown in APM. ```yaml title="logdrop-values.yaml" enabled: true clusterName: cluster: uid: # optional; adds the cluster identity to every trace tracing: enabled: true endpoint: https://otel.logdrop.io namespaces: [] # every namespace whose pods you want to trace environment: production requirePodLabel: true # only labelled pods ever reach the injector networkPolicy: apiServerCIDRs: [/32] ``` Find the API server addresses and the cluster UID with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server addresses kubectl get namespace kube-system -o jsonpath='{.metadata.uid}' # cluster UID ``` Managed control planes that call webhooks through an in-cluster proxy also need that proxy as a source. On DigitalOcean Kubernetes, for example, the calls come from the konnectivity agents: ```yaml tracing: injector: sourcePeers: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} podSelector: {matchLabels: {k8s-app: konnectivity-agent}} ``` Install the chart: ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system --create-namespace -f logdrop-values.yaml ``` With these values the chart installs one small webhook pod, the trace injector, and nothing else; its runtime comes from `registry.logdrop.io` by digest ([Verify what you install](/docs/backend-tracing/rust/verify)). Rust needs no value of its own: `rust` is always accepted. The same chart also installs the infrastructure metrics agent, which links each trace to its cluster and pod: add its values to this release ([Infrastructure Monitoring](/docs/infrastructure/kubernetes#already-tracing-with-the-same-chart)). On DigitalOcean Kubernetes with Helm 4, a later `helm upgrade` can stop with a conflict on the injector webhook's `objectSelector`, because the platform adds its own rule there. Run the upgrade again with `--server-side=true --force-conflicts`. | Value | Default | Meaning | |---|---|---| | `tracing.endpoint` | none | The traces endpoint, `https://otel.logdrop.io`: an HTTPS base URL without path, query or credentials | | `tracing.namespaces` | none | Namespaces whose annotated pods get settings. Pods in other namespaces are never sent to the webhook | | `tracing.environment` | `production` | Environment shown in APM | | `tracing.serviceNamespace` | empty | Default service group in APM. The pod annotation `logdrop.io/service-namespace` overrides it | | `tracing.requirePodLabel` | `false` | Also require the pod label `logdrop.io/trace: rust` (or `java`, `nodejs`, `python`, `dotnet`, `go`, `php`), so other pods in a traced namespace never reach the webhook. Recommended | | `tracing.ingestKeySecret.name` / `.key` | `logdrop-trace-ingest-key` / `trace-ingest-key` | The key Secret in each traced namespace | | `tracing.caSecret` / `tracing.caSecretKey` | empty / `ca.crt` | A Secret with a private CA. Only needed for an on-premises LogDrop installation with its own CA | | `tracing.injector.timeoutSeconds` | `5` | How long the API server waits for the injector. After that the pod is created without settings, so untraced | | `tracing.injector.sourceCIDRs` / `sourcePeers` | empty | Extra webhook callers besides `networkPolicy.apiServerCIDRs` | | `tracing.injector.tls.existingSecret` / `caBundle` | empty | Your own webhook certificate (for example from cert-manager) and the CA that signed it. Empty: the chart generates one, reuses it on upgrades and renews it 60 days before it expires | | `networkPolicy.apiServerCIDRs` | none | The API server addresses allowed to call the injector. Required while `networkPolicy.enabled` is `true`, the default | | `clusterName`, `cluster.uid` | empty | The cluster name and UID added to every trace | With Argo CD or `helm template` (no cluster access while rendering), the generated webhook certificate changes on every render. Give the chart a certificate with `tracing.injector.tls.existingSecret` and the CA that signed it in `tracing.injector.tls.caBundle`. ## 3. Opt a workload in [#3-opt-a-workload-in] A pod annotation is a key and value in a pod's metadata. The injector gives settings only to pods whose template carries the annotation `logdrop.io/trace: rust`, so you choose which workloads are traced. Add the label and the annotations to the **pod template** and roll the workload: ```yaml spec: template: metadata: labels: logdrop.io/trace: rust # needed with requirePodLabel: true annotations: logdrop.io/trace: rust logdrop.io/service: orders # optional logdrop.io/release: "1.4.2" # optional ``` | Annotation | Meaning | |---|---| | `logdrop.io/trace: rust` | Opts the pod in. `rust`, `java`, `nodejs`, `python`, `dotnet`, `go` and `php` are supported; any other value is skipped with a status | | `logdrop.io/service` | Service name. Default: the label `app.kubernetes.io/name`, then the owning Deployment, StatefulSet, DaemonSet or Job, then the container name | | `logdrop.io/service-namespace` | Service group in APM. Default: `tracing.serviceNamespace` | | `logdrop.io/release` | Release shown in APM. Default: the label `app.kubernetes.io/version` | | `logdrop.io/container` | The container to give the settings to. Default: the first container | | `logdrop.io/trace-status` | Written by the injector: `injected` or `skipped: ` | Annotation values are at most 128 characters, without control characters. Pods that already run are not changed: the settings are added when a pod is created. The annotation alone traces nothing: the service must add the LogDrop layer ([Add the crate](/docs/backend-tracing/rust/install)). A Rust service without the crate runs as before, with the settings unused. ## 4. Check it [#4-check-it] Check that the injector gave the new pods their settings. It records the result in the pod annotation `logdrop.io/trace-status`: ```bash kubectl -n get pod -o jsonpath='{.metadata.annotations.logdrop\.io/trace-status}' ``` `injected` means the settings are in. The container log then shows one line from the crate: ```text [logdrop-agent] INFO LogDrop Rust library 0.1.0-alpha1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute; the service, its endpoints and dependencies appear in **Services** and the **Dependency map** within about two minutes. See [Tracing & APM](/docs/panel/tracing). | `trace-status` | Meaning | |---|---| | `injected` | The settings were added | | `skipped: unsupported language` | The annotation value is not `rust`, `java`, `nodejs`, `python`, `dotnet`, `go` or `php`. On a `rust` pod: the installed chart is older than `0.1.1-alpha15`; upgrade it | | `skipped: container not found` | `logdrop.io/container` names no container of the pod | | `skipped: no containers`, `skipped: invalid container name` | The pod spec cannot be instrumented | | `skipped: invalid logdrop.io/service` (or `service-namespace`, `release`) | The annotation value is empty, longer than 128 characters or has control characters | | `skipped: volume name conflict`, `skipped: mount path conflict` | The pod already uses the injector's volume name, or the path `/var/run/secrets/logdrop.io/trace` | | missing | The webhook did not see the pod: its namespace is not in `tracing.namespaces`, the pod label is missing with `requirePodLabel: true`, the pod was created before the chart was installed, or the injector was unavailable | ## Network and disk [#network-and-disk] This section covers the network access tracing needs and the storage it uses in each traced pod. You need it when your cluster restricts traffic with NetworkPolicies. **The injector** runs in the pod network. The chart gives it a NetworkPolicy that admits only the API server addresses in `networkPolicy.apiServerCIDRs`, plus `tracing.injector.sourceCIDRs` and `sourcePeers`, on the webhook port, and allows it no egress. It has no access to the Kubernetes API. If pods are created without a `logdrop.io/trace-status` annotation after you install the chart, the control plane probably reaches the webhook from an address you have not listed. **Traced pods** send to the traces endpoint on port 443 and need DNS. In namespaces with a default-deny egress policy, allow it: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: allow-logdrop-trace-export, namespace: } spec: podSelector: matchLabels: {logdrop.io/trace: rust} # without the pod label: podSelector: {} policyTypes: [Egress] egress: - to: [{ipBlock: {cidr: /32}}] ports: [{protocol: TCP, port: 443}] ``` A NetworkPolicy matches IP addresses, not host names. Allow the addresses that `otel.logdrop.io` resolves to, and check them again if the crate starts to log `LogDrop is not reachable`. **Disk.** Tracing uses no node directories, no persistent volumes and no extra volume besides the key mount. The crate keeps the spans waiting to be sent in memory (at most 2,048 by default) and drops new spans when that queue is full. ## When the injector is unavailable [#when-the-injector-is-unavailable] The webhook never blocks a deploy. When the injector is down, slow or unreachable, pods are created **without** settings, so untraced, and without a `trace-status` annotation; restart them once the injector is back. The injector never refuses a pod: a pod it cannot handle is created unchanged except for `trace-status: skipped: `. ## Things to know [#things-to-know] These points describe how the injected settings fit into your pods. Check them before you opt in production workloads. - `LOGDROP_*` variables that the container already sets win over the injected ones. - The crate sends traces only. It sets OpenTelemetry's global tracer provider; a service that also exports with its own OpenTelemetry pipeline should not add the LogDrop layer. - Containers added by webhooks that run after the injector get no settings. - The webhook receives the full spec of every pod created in the traced namespaces (with `requirePodLabel: true`, only of labelled pods). Its logs carry only the pod name, the namespace and the result, never environment values. ## Upgrade, roll back, remove [#upgrade-roll-back-remove] `helm upgrade` keeps the webhook certificate and restarts the injector when its configuration changes. A new version of the crate arrives with your next build (the `logdrop` version in `Cargo.toml`), not with the chart. `helm rollback` restores the previous webhook, configuration and certificate together. `helm uninstall` removes the injector; running pods keep their settings until they restart, and restarted pods run untraced. To stop tracing one workload, remove the annotation and roll it out. # Licences (/docs/backend-tracing/rust/licences) The LogDrop Rust crate is under the LogDrop Client Library License 1.1. The open-source crates it uses keep their own licences. ## LogDrop Rust crate [#logdrop-rust-crate] The crate `logdrop` is licensed under the [LogDrop Client Library License 1.1](https://artifactory.logdrop.io/repository/logdrop-public/licenses/LogDrop-Client-Library-License-1.1.txt). In short, you may use it to send telemetry to LogDrop and build it, unmodified, into your applications; you may not modify it or distribute it on its own. The licence text is the authoritative version. The crate carries it as `LICENSE`. The source is public because crates are distributed as source; that does not make it open source. ## Crates it uses [#crates-it-uses] Cargo downloads these as separate crates, each with its own licence, among them: - OpenTelemetry Rust (`opentelemetry`, `opentelemetry_sdk`, `opentelemetry-proto`) and `tracing-opentelemetry`: Apache License 2.0. - `tracing` and `tracing-subscriber`: MIT. - `ureq`, `rustls`, `flate2`, `prost` and `md-5`: MIT or Apache License 2.0; `ring`: Apache License 2.0 and ISC. - `fancy-regex` (used to remove values from SQL statements): MIT. - With the `axum` and `reqwest` features, `axum`, `tower`, `reqwest` and `reqwest-middleware` under their own licences. `cargo tree` in your service lists every crate with its version; `cargo metadata` gives their licence fields for licence scanners. # Limits (/docs/backend-tracing/rust/limits) The crate keeps every request inside LogDrop's limits on its own. You only need these numbers if you change its settings or plan a large fleet. | Limit | Value | What happens | |---|---|---| | Spans per request | 256 (the crate sends at most 128 by default) | A larger request is refused with 400 | | Distinct span start minutes per request | 32 | The crate splits a batch by start minute | | Span start time | At most 5 minutes ahead of LogDrop's clock and at most 7 days old | The crate drops such spans before sending and counts them as rejected. Keep the host clock in sync | | Request size | 128 KiB, compressed and uncompressed | The request is refused. See `LOGDROP_MAX_EXPORT_BATCH_SIZE` in [Settings](/docs/backend-tracing/rust/settings) | | Attributes | 24 on the resource, 48 per span, 24 per event or link; keys up to 128 bytes, text values up to 2,048 bytes; 16 events and 16 links per span; span names up to 256 bytes | The whole request is refused with 400 | | Requests | 600 per minute per key, 3,000 per minute per project | 429. The crate retries for a few seconds, then drops the batch | | Active spans per process | 1,024 (`LOGDROP_MAX_ACTIVE_SPANS`) | New spans are not recorded until others end. Spans open longer than 15 minutes stop counting | ## Sizing a fleet [#sizing-a-fleet] The request limits apply per key and per project, so they decide how many processes can share one key and one project. At the default settings, a Rust process sends a request about once a second while it has traffic, and one request per 128 spans when it records more than 128 spans a second. So one key carries about ten busy processes, or about 1,280 spans a second, and one project about fifty processes, or about 6,400 spans a second. For larger fleets, use one key per workload, or set `LOGDROP_SCHEDULE_DELAY=5s`: a process with little traffic then sends about twelve requests a minute, and traces appear a few seconds later. # Other Hosts (/docs/backend-tracing/rust/other-hosts) Outside Kubernetes you give the service its settings as environment variables. The service must [add the LogDrop Rust crate](/docs/backend-tracing/rust/install); nothing else is installed on the host. ## 1. Put the ingest key in a file [#1-put-the-ingest-key-in-a-file] The traces ingest key is the credential the crate sends traces to LogDrop with. Keep the key in a file that only the service's user can read, not in a variable on a command line: ```bash sudo install -d -m 0750 -o root -g /etc/logdrop printf 'Traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then printf '%s' "$LOGDROP_TRACE_KEY" | sudo install -m 0440 -o root -g /dev/stdin /etc/logdrop/trace-ingest-key else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEY ``` The crate re-reads the file every 10 seconds, so you can [rotate the key](/docs/backend-tracing/rust/key-rotation) without a restart. ## 2. Set the settings and start the service [#2-set-the-settings-and-start-the-service] The crate reads its settings from `LOGDROP_*` environment variables when the service starts. Set them wherever your service gets its environment: in the shell that starts it, in a systemd unit or in a container. ```bash export LOGDROP_ENDPOINT=https://otel.logdrop.io export LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key export LOGDROP_SERVICE=orders export LOGDROP_ENVIRONMENT=production export LOGDROP_RELEASE=1.4.2 # optional ./orders ``` With systemd, put the same settings in the unit: ```ini title="/etc/systemd/system/orders.service.d/logdrop.conf" [Service] Environment=LOGDROP_ENDPOINT=https://otel.logdrop.io Environment=LOGDROP_INGEST_KEY_FILE=/etc/logdrop/trace-ingest-key Environment=LOGDROP_SERVICE=orders Environment=LOGDROP_ENVIRONMENT=production ``` With Docker, mount the key file read-only and pass the settings: ```bash docker run -d --name orders \ -v /etc/logdrop/trace-ingest-key:/run/secrets/trace-ingest-key:ro \ -e LOGDROP_ENDPOINT=https://otel.logdrop.io \ -e LOGDROP_INGEST_KEY_FILE=/run/secrets/trace-ingest-key \ -e LOGDROP_SERVICE=orders -e LOGDROP_ENVIRONMENT=production \ ``` Every setting is listed in [Settings](/docs/backend-tracing/rust/settings). ## 3. Check it [#3-check-it] The service's standard error shows one line from the crate: ```text [logdrop-agent] INFO LogDrop Rust library 0.1.0-alpha1 is tracing service "orders" (environment "production") to otel.logdrop.io. ``` Send a request to the service. The trace appears in **Trace Explorer** within about a minute, and the service in **Services** within about two minutes. ## Things to know [#things-to-know] These points describe how the crate fits into your host's network and your service's processes. Check them before you run traced services in production. - The host needs outgoing HTTPS (port 443) to `otel.logdrop.io`. The crate does not use `HTTP_PROXY` or `HTTPS_PROXY`: it connects directly. - Outside Kubernetes each process gets a new instance ID when it starts. Set `LOGDROP_SERVICE_INSTANCE_ID` to keep one per host. - A batch job that exits right after its work should call `logdrop::flush(Duration::from_secs(5))` before it returns, or rely on `ShutdownGuard` in `main`. # Settings (/docs/backend-tracing/rust/settings) The LogDrop Rust crate is configured only with `LOGDROP_*` environment variables, the same settings as the other LogDrop agents. On Kubernetes the trace injector sets the required ones for you. The crate reads them once, when `logdrop::layer()` is first called. | Setting | Default | Meaning | |---|---|---| | `LOGDROP_ENDPOINT` | none | The traces endpoint, `https://otel.logdrop.io`. HTTPS, without credentials, query or fragment. Empty turns tracing off | | `LOGDROP_INGEST_KEY_FILE` / `LOGDROP_INGEST_KEY` | none | The traces ingest key, from a file (re-read every 10 seconds) or from a variable. Set one, not both | | `LOGDROP_SERVICE` | none, required | Service name | | `LOGDROP_SERVICE_NAMESPACE` | empty | Service group in APM | | `LOGDROP_ENVIRONMENT` | `production` | Environment | | `LOGDROP_RELEASE` | empty | Release or version of your service | | `LOGDROP_SERVICE_INSTANCE_ID` | On Kubernetes stable per pod and container, so restarts keep it; elsewhere new for each process | Instance ID in APM | | `LOGDROP_ALLOWED_ATTRIBUTE_KEYS` | empty | Comma-separated [custom attribute](/docs/backend-tracing/rust/custom-spans#attributes-and-errors) keys to send, at most 128 | | `LOGDROP_CA_FILE` | empty | A PEM file with a private CA, at most 1 MiB. Only needed for an on-premises LogDrop installation with its own CA | | `LOGDROP_ENABLED` | `true` | `false` turns the crate off | | `LOGDROP_DEBUG` | `false` | Diagnostics on standard error. They never include the ingest key or span contents | | `LOGDROP_MAX_ATTRIBUTES` | 24 | Attributes kept per span, and per event and link (1 to 128). LogDrop refuses more than 48 per span and more than 24 per event or link, so raise it only for spans without events and links, and never above 48 | | `LOGDROP_MAX_EVENTS`, `LOGDROP_MAX_LINKS` | 16, 16 | Events and links per span (1 to 128). Keep them at 16 or less: LogDrop refuses more | | `LOGDROP_MAX_STRING_LENGTH` | 256 | Characters per text value (1 to 4,096). Keep it at 512 or less: LogDrop refuses values over 2,048 bytes | | `LOGDROP_MAX_ACTIVE_SPANS` | 1,024 | Spans open at the same time (1 to 100,000). New spans are not recorded while the limit is reached | | `LOGDROP_MAX_QUEUE_SIZE` | 2,048 | Spans waiting to be sent (1 to 65,536). New spans are dropped while the queue is full | | `LOGDROP_MAX_EXPORT_BATCH_SIZE` | 128 | Spans per request (1 to 256, and at most the queue size). Lower it to 64 if your spans carry many long custom attributes | | `LOGDROP_SCHEDULE_DELAY` | `1s` | How long spans wait before a request is sent (10ms to 5s) | | `LOGDROP_EXPORT_TIMEOUT` | `5s` | Timeout per request (100ms to 30s) | | `LOGDROP_COMPRESSION` | `gzip` | `gzip` or `none` | Durations are a whole number followed by `ms` or `s`, for example `200ms` or `5s`. The values of `LOGDROP_SERVICE`, `LOGDROP_SERVICE_NAMESPACE`, `LOGDROP_ENVIRONMENT`, `LOGDROP_RELEASE` and `LOGDROP_SERVICE_INSTANCE_ID` are at most 128 characters, without control characters. ## On Kubernetes [#on-kubernetes] The trace injector sets the endpoint, the key file, the service, the service group, the environment, the release and the pod's identity from the chart values and the pod's annotations. Variables you set on the container win over the injected `LOGDROP_*` ones. See [Kubernetes](/docs/backend-tracing/rust/kubernetes). ## Invalid settings [#invalid-settings] An invalid setting turns recording off with one line on standard error that names the setting, never its value: ```text [logdrop-agent] ERROR LogDrop tracing is disabled: LOGDROP_SERVICE is required. ``` The service always runs; only tracing is off. ## OpenTelemetry settings [#opentelemetry-settings] OpenTelemetry's own settings (`OTEL_*` variables) have no effect on what the crate sends: it always exports to LogDrop, never samples, propagates W3C trace context and baggage, never captures headers and sends only LogDrop's resource attributes. Configure it with `LOGDROP_*` only. # Troubleshooting (/docs/backend-tracing/rust/troubleshooting) The crate writes its messages to standard error with the prefix `[logdrop-agent]`. Each warning is logged at most once a minute per process, and no message ever contains the ingest key. Set `LOGDROP_DEBUG=true` for more detail. It never prints the key or span contents. | You see | Do this | |---|---| | No `[logdrop-agent]` line at all | The service does not add `logdrop::layer()` to its subscriber, or the build does not include it. See [Add the crate](/docs/backend-tracing/rust/install) | | `[logdrop-agent] INFO LogDrop tracing is disabled: LOGDROP_ENDPOINT is not set.` | On Kubernetes: the pod has no `logdrop.io/trace: rust` annotation, its `trace-status` is `skipped: …`, or the chart is older than `0.1.1-alpha15`. Elsewhere: set the [settings](/docs/backend-tracing/rust/other-hosts) | | `trace-status: skipped: unsupported language` on a `rust` pod | The installed chart is older than `0.1.1-alpha15` and does not know Rust. Upgrade the chart and roll the pod | | `trace-status: skipped: …` | Fix the named reason (see [Check it](/docs/backend-tracing/rust/kubernetes#4-check-it)) and roll the pod | | No `trace-status` annotation | The webhook did not see the pod. Check `tracing.namespaces`, the pod label when `requirePodLabel` is `true`, that the injector pod is running, and that `networkPolicy.apiServerCIDRs` (or `tracing.injector.sourceCIDRs` and `sourcePeers`) cover the addresses the control plane calls from. Then roll the pod | | `ERROR LogDrop tracing is disabled: the library could not start.` | Contact LogDrop support with the Rust version and, with `LOGDROP_DEBUG=true`, the lines that follow | | `[logdrop-agent] ERROR LogDrop tracing is disabled: …` naming a setting | The named setting is invalid. Fix it and restart | | `LogDrop ingest key file is missing or invalid; traces are not sent until it is readable.` or `LogDrop ingest key is not available. Trace export skipped.` | The Secret `logdrop-trace-ingest-key` is missing in that namespace, or empty; outside Kubernetes, the key file is missing or unreadable | | `LogDrop ingest key file is missing or invalid; the last valid key is still used.` | The key file changed to something unreadable. The crate keeps the previous key until you fix it | | `LogDrop rejected the ingest key (HTTP 401).` | The key is revoked, expired, mistyped or not a traces key, or the Secret holds more than one key, for example a key pasted twice. A traces key starts with `ldtk_` and has 71 characters; recreate the Secret with the command in [Kubernetes, step 1](/docs/backend-tracing/rust/kubernetes) | | `LogDrop refused traces for this project (HTTP 403).` | Turn on HTTP Logging for the project, and check that its plan includes HTTP monitoring and that the project is not disabled | | `LogDrop rate-limited trace export (HTTP 429).` | Too many requests for the key or the project (see [Limits](/docs/backend-tracing/rust/limits)), or the project's trace storage is used up. Those batches are dropped | | `LogDrop is not reachable. Trace export failed.` | Egress to the traces endpoint is blocked (NetworkPolicy, firewall or DNS). The crate does not use an HTTP proxy. Before it warns, it resends a batch that could not connect for about 20 seconds, so a few seconds of network set-up while a pod starts lose nothing | | `LogDrop refused a trace batch as invalid (HTTP 400).` | Usually a clock far off (spans that start more than 5 minutes ahead), a `LOGDROP_MAX_*` setting above LogDrop's limits, or an outdated crate. The batch is dropped and counted as rejected in `logdrop::export_status()` | | `LogDrop rejected trace export (HTTP ).` | Any other answer. For 502, 503 and 504 the crate has already retried for a few seconds. If it persists, contact LogDrop support with the time and the code | | `LogDrop active span limit reached. New spans are being refused.` | More than `LOGDROP_MAX_ACTIVE_SPANS` spans are open at once, often spans that are never closed, such as a span kept in a long-lived struct | | Requests appear, but outgoing calls are missing, or show up as separate traces | The client is not built with the middleware ([Add the crate](/docs/backend-tracing/rust/install#2-trace-the-libraries-you-use)), or the call runs in a task spawned without the request's span (`.instrument(span)`) | | Database statements are missing | A filter on the whole subscriber hides DEBUG events of `sqlx::query`: filter the log layer instead ([Filters](/docs/backend-tracing/rust/install#filters)). A pool built with `log_statements(LevelFilter::Off)` reports no statements | | Database calls show the system `other_sql` and no address | `DATABASE_URL` is not set in the service's environment | | Requests appear without a route (only `GET`) | The axum layer is outside the router; add it with `Router::layer` | | The last spans of a short job are missing | `main` exits through `std::process::exit`, which skips `ShutdownGuard`. Call `logdrop::shutdown()` or `logdrop::flush(timeout)` before it | | A trace is in Trace Explorer, but the service is missing in APM | APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter | ## Still nothing in the panel [#still-nothing-in-the-panel] If nothing shows up in the panel, check these in order: 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on. 2. The service uses a key with the **Traces** signal whose status is **Active**. 3. The crate reports success: its start line ([Check it](/docs/backend-tracing/rust/kubernetes#4-check-it)). 4. The panel's time range covers the request, and the **Environment** filter matches (the default is `production`). 5. The service's log shows no refusal from the table above. # Verify What You Install (/docs/backend-tracing/rust/verify) The LogDrop Rust crate is published on crates.io, where Cargo downloads it as source. Cargo checks every download against the checksum in your `Cargo.lock`. The Helm chart is signed by LogDrop with cosign. ## Crate [#crate] The crate is [`logdrop` on crates.io](https://crates.io/crates/logdrop), published by LogDrop. Cargo records the SHA-256 checksum of every crate version in `Cargo.lock` and refuses a later download with different content, on your machine and in CI. Commit `Cargo.lock` and build with: ```bash cargo build --locked ``` A published version never changes: crates.io does not allow a version to be replaced, and a fix comes as a new version. ## Chart [#chart] Checking the chart's signature shows that the chart you install is the one LogDrop published, unchanged. The chart's signature is not recorded in the public Rekor transparency log, so verification is a check against LogDrop's public key: ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` `--insecure-ignore-tlog=true` tells cosign not to look for a transparency log entry, because there is none. The signature is still checked against the key, and cosign prints a warning about the missing log entry. Rust pods use no agent image: the chart only adds settings and the key mount to them. The other images the chart uses are listed on the verify pages of the [Java](/docs/backend-tracing/java/verify), [Node.js](/docs/backend-tracing/nodejs/verify), [Python](/docs/backend-tracing/python/verify), [.NET](/docs/backend-tracing/dotnet/verify) and [PHP](/docs/backend-tracing/php/verify) agents. # Infrastructure Monitoring (/docs/infrastructure) The LogDrop chart installs a small metrics agent in your Kubernetes cluster. You get your nodes, pods and containers with their CPU, memory, disk and network usage, their requests, limits and capacity, and alerts on them in the panel's **Infrastructure** pages. Traces from the same cluster link to the cluster, node, workload and pod they ran on. The metrics agent and [Backend Tracing](/docs/backend-tracing) come from the same Helm chart and are independent: install either or both, in one release. The links from traces to their infrastructure need both, sending to the same project. ## Before you start [#before-you-start] You need these from LogDrop and from your cluster before you install the agent. - A LogDrop project whose plan includes **infrastructure monitoring** (a monitored-node allowance). LogDrop counts monitored worker nodes; the pods and containers on them are included. - An ingest key with the **Metrics** signal. In the panel, open **Services & APM → Credentials**, select **Create credential** and select **Metrics**. The key is shown once. Signals cannot be added to a key later, so if you also trace this cluster, you can create one credential with both **Traces** and **Metrics** and use it for both. Use one key per cluster. - **The key decides the project.** Everything the agent sends lands in the project the key belongs to. To see where a trace ran, send traces and metrics to the **same project**. - The metrics endpoint: `https://otel.logdrop.io`. - Kubernetes 1.28 or newer and Helm 3.8 or newer. ## Guides [#guides] Install the agent with the Kubernetes guide. Read Network and disk before production if your cluster restricts network traffic or you turn on host metrics. - [Kubernetes](/docs/infrastructure/kubernetes): Install the metrics agent with the LogDrop Helm chart: the key, the values, the receivers, checks and troubleshooting. - [Network and disk](/docs/infrastructure/network-and-disk): What the agent connects to, host-network egress, and the disk to reserve for its queues. ## Related guides [#related-guides] - [Backend Tracing](/docs/backend-tracing): trace your services with the same chart. - [Tracing & APM in the panel](/docs/panel/tracing): a trace's **Infrastructure** section shows the cluster, node, workload and pod it ran on. # Kubernetes (/docs/infrastructure/kubernetes) The LogDrop chart runs one agent pod per node for kubelet (and optionally host) metrics, and one pod for the cluster's state. You need the project, the key and the endpoint from [Before you start](/docs/infrastructure#before-you-start). ## 1. Store the key [#1-store-the-key] The ingest key with the **Metrics** signal is the credential the agent sends its data to LogDrop with. The agent runs in its own namespace (here `logdrop-system`); the key Secret goes there: ```bash kubectl create namespace logdrop-system printf 'Metrics key (paste it once, then press Enter): ' && read -rs LOGDROP_METRICS_KEY && echo if [[ $LOGDROP_METRICS_KEY == ldtk_* && ${#LOGDROP_METRICS_KEY} -eq 71 ]]; then kubectl -n logdrop-system create secret generic logdrop-metrics-ingest-key \ --from-literal=metrics-ingest-key="$LOGDROP_METRICS_KEY" else echo 'That is not one ingest key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_METRICS_KEY ``` `read -rs` keeps the key out of your shell history and off the screen, so nothing appears while you paste: paste once. The chart never creates the Secret, and the key never appears in values or pod specs. ## 2. The image [#2-the-image] The image is the program that every agent pod runs. The chart runs LogDrop's build of the OpenTelemetry Collector by default, pinned by digest: ```yaml image: repository: registry.logdrop.io/logdrop-infrastructure-collector digest: sha256:715f4f4f19486ad57bb525e60cc836daafb20bd96e944decae09c083422ddf2c # 0.158.0-alpha3 ``` You do not need to set it. It pulls anonymously and is built for **linux/amd64 only**: on clusters with arm64 nodes add `kubernetes.io/arch: amd64` to `agent.nodeSelector`, `cluster.nodeSelector` and `prometheus.nodeSelector`. To pull through your own registry, mirror the image and set only `image.repository`; keep the digest. | Image | What it can do | |---|---| | `registry.logdrop.io/logdrop-infrastructure-collector` (the chart default) | Host, kubelet and cluster metrics, the Prometheus scrape, pod requests and limits with node capacity (`resourceCapacity`), receiver evidence and entity events (step 5) | | `otel/opentelemetry-collector-contrib` 0.158.0 | Host, kubelet and cluster metrics and the Prometheus scrape only | Keep the LogDrop image unless you have a reason not to: without it, infrastructure alerts and service levels cannot tell missing data from an outage. Like the Java agent, it is signed with LogDrop's cosign key and carries an SBOM attestation ([Verify what you install](/docs/backend-tracing/java/verify)): ```bash curl -fsSLO https://artifactory.logdrop.io/repository/logdrop-public/keys/cosign.pub cosign verify --key cosign.pub --insecure-ignore-tlog=true \ registry.logdrop.io/logdrop-infrastructure-collector@sha256:715f4f4f19486ad57bb525e60cc836daafb20bd96e944decae09c083422ddf2c cosign verify-attestation --key cosign.pub --insecure-ignore-tlog=true --type cyclonedx \ registry.logdrop.io/logdrop-infrastructure-collector@sha256:715f4f4f19486ad57bb525e60cc836daafb20bd96e944decae09c083422ddf2c cosign verify --key cosign.pub --insecure-ignore-tlog=true registry.logdrop.io/charts/logdrop-infrastructure:0.1.1-alpha15 ``` ## 3. Install the chart [#3-install-the-chart] The values file turns on the agent and its receivers, and tells it where to send its data and which addresses it may reach. `logdrop-metrics-values.yaml`, a complete setup: ```yaml enabled: true clusterName: export: endpoint: https://otel.logdrop.io existingSecret: logdrop-metrics-ingest-key # key name in the Secret: metrics-ingest-key agent: hostmetrics: enabled: true machineIdPath: /etc/machine-id # a reviewed node file; gives each host a stable ID kubeletstats: enabled: true resourceCapacity: true nodeCIDRs: [] cluster: enabled: true entityEvents: enabled: true receiverPublication: enabled: true networkPolicy: exportCIDRs: [/32] apiServerCIDRs: [/32] ``` ```bash helm upgrade --install logdrop oci://registry.logdrop.io/charts/logdrop-infrastructure --version 0.1.1-alpha15 \ --namespace logdrop-system -f logdrop-metrics-values.yaml ``` Find the addresses with: ```bash kubectl get endpointslices -n default -l kubernetes.io/service-name=kubernetes \ -o jsonpath='{.items[*].endpoints[*].addresses[*]}' # API server address kubectl get nodes -o jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address}{"\n"}{end}' # node addresses dig +short otel.logdrop.io # metrics endpoint address ``` Nothing is installed until `enabled: true`, and every receiver is off until you turn it on. The chart checks your values when it renders and refuses combinations that cannot work, naming the value to fix. | Value | Default | Meaning | |---|---|---| | `export.endpoint` | none | Metrics endpoint, HTTPS, without path, query or credentials. The agent sends to `/v1/metrics` | | `export.existingSecret`, `export.ingestKeySecretKey` | none, `metrics-ingest-key` | The Secret with the metrics key, in the release namespace | | `export.caSecret` | empty | A private CA, only for a self-hosted gateway | | `collectionInterval` | `30s` | 10, 15, 20, 30 or 60 seconds | | `clusterName` | empty | Cluster name shown in the panel and on traces | | `networkPolicy.exportCIDRs` | none | Required while `networkPolicy.enabled` (the default): the endpoint's addresses | | `networkPolicy.apiServerCIDRs` | none | Required for the kubelet and cluster receivers: the API server address after service DNAT | | `agent.kubeletstats.nodeCIDRs` | none | Required for the kubelet receiver: where the kubelets listen (port 10250) | | `agent.kubeletstats.endpoint` | `https://${env:K8S_NODE_NAME}:10250` | How the agent reaches its node's kubelet. Use `https://${env:K8S_NODE_IP}:10250` where node names do not resolve in cluster DNS | > **Note: DigitalOcean Kubernetes** > > Node names do not resolve in cluster DNS on DigitalOcean, so set `agent.kubeletstats.endpoint: "https://${env:K8S_NODE_IP}:10250"`; the kubelet's certificate carries the node IP. Without it the agent logs `lookup … no such host` and sends no kubelet metrics. ### Already tracing with the same chart? [#already-tracing-with-the-same-chart] Add these values to the same `logdrop` release instead of installing a second one. A cluster runs **one release** of the chart: two host agents on one node cannot start (their own metrics port, `127.0.0.1:8886`, is taken). To link traces to the cluster as well, keep `cluster.uid` from the tracing values. The chart accepts `cluster.uid` only in **namespace mode**, so list the namespaces in `cluster.namespaces` (step 4): the namespaces you trace, plus `logdrop-system` when receiver evidence is on. In cluster-wide mode the agent finds the cluster's identity itself and `cluster.uid` must stay empty. Traces then carry no cluster identity, and their **Cluster** row matches through the trace's pod, like **Node** and **Workload** (see **Check it**). ## 4. The receivers [#4-the-receivers] A receiver is the part of the agent that collects one kind of data: from the node, from its kubelet, from the Kubernetes API or from a Prometheus endpoint. Each one is off until you turn it on, and each section below says which panel pages it feeds. ### Host metrics: `agent.hostmetrics` [#host-metrics-agenthostmetrics] CPU, memory, file system and network of each node, read from the node itself. File systems and network interfaces are allowlists: `agent.hostmetrics.filesystemMountPoints` (default `[/]`) and `agent.hostmetrics.networkInterfaces` (default `[eth0]`); processes and command lines are never collected. Set `machineIdPath` to the node's machine-id file to give each host a stable ID; without it hosts have no host ID. The agent then runs with the **host network** and a read-only mount of the node's root file system, as user 0 without any added privileges. Host-network pods are not covered by NetworkPolicy on most network plugins; see [Network and disk](/docs/infrastructure/network-and-disk) before production. Feeds: *Inventory* (hosts and nodes), *Metrics & capacity* and infrastructure alerts. ### Kubelet metrics: `agent.kubeletstats` [#kubelet-metrics-agentkubeletstats] The kubelet is the Kubernetes process on each node that runs the node's pods and measures their usage. CPU, memory (working set, as `kubectl top` shows it) and network of every node, pod and container, from each node's kubelet. `agent.kubeletstats.namespaces` limits pod and container data to a list of namespaces; node data stays. `resourceCapacity: true` (LogDrop image only) adds each pod's CPU and memory **requests and limits** and each node's **allocatable** CPU and memory, so the panel can show usage against what was asked for and what fits. Pods without a budget show none; nothing is guessed. Feeds: *Inventory* (nodes, pods, containers), *Metrics & capacity* and resource usage, infrastructure alerts, and the link from a trace to its pod and container. ### Cluster state: `cluster` [#cluster-state-cluster] One pod reads the Kubernetes API: node conditions, pod phases and readiness, container restarts, configured limits, and the inventory of namespaces, workloads, pods and nodes. `cluster.workloadMetrics: true` adds desired and available counts for deployments, replica sets, stateful sets and daemon sets. Its queue is a 256Mi PVC (`cluster.queue`). - **Cluster-wide** (default): reads all namespaces and finds the cluster's identity itself. - **Namespace mode**: `cluster.namespaces: [, …]` limits it to those namespaces with Roles instead of ClusterRoles. Node and namespace metrics are then not available, and you must give the cluster's identity yourself: `cluster.uid`, the UID of the `kube-system` namespace (`kubectl get namespace kube-system -o jsonpath='{.metadata.uid}'`). Include the chart's own namespace when receiver evidence is on. Feeds: *Inventory* (cluster, namespaces, workloads, pod states), infrastructure alerts, and the cluster identity that joins host, kubelet and trace data from the same nodes. ### Prometheus endpoints (optional): `prometheus` [#prometheus-endpoints-optional-prometheus] A Prometheus endpoint is an address where a program publishes its own metrics for collectors to read. Use this receiver when you want such metrics in the panel's metric history. A separate pod scrapes up to ten static HTTPS targets you approve. You list the targets, the metric names to keep (`prometheus.metricNames`, and the names they get in OTLP, `prometheus.otelMetricNames`), the labels to keep (`prometheus.labelNames`) and the allowed addresses (`prometheus.scrapeCIDRs`), plus a `jobName` and an `approvalReference` (your review of the source). Limits: 1,000 samples, 14 labels and 256 KB per scrape. There is no target discovery. Its queue is a PVC of its own. Feeds: *Metrics & capacity* (metric history). Prometheus data is not part of the inventory and carries no cluster identity. ## 5. Receiver evidence and entity events [#5-receiver-evidence-and-entity-events] Two more lanes make the infrastructure data trustworthy: - **Receiver evidence** (`receiverPublication`): each receiver reports every collection attempt, successful or not. Without it, a minute without data is just a gap: infrastructure alerts and service levels cannot tell "nothing happened" from "the agent was down" and must show those minutes as *Unknown* instead of healthy or failed. - **Entity events** (`entityEvents`): pods, containers, nodes and hosts as they appear and are deleted. Without them, LogDrop sees a deleted pod only as one that stopped reporting. Both need the **LogDrop image**, the chart default (step 2). Receiver evidence also needs `agent.hostmetrics`, `agent.kubeletstats`, `cluster` and `entityEvents` on, and in namespace mode the chart's namespace in `cluster.namespaces`. They use the **same metrics key** as the metrics export: the agent posts to `/v1/infrastructure/receiver/…` with the key from `export.existingSecret`, and LogDrop takes the project from the key. Leave `endpoint`, `merchantId` and `projectId` of both lanes empty; they reuse `export.endpoint`, `export.caSecret` and `networkPolicy.exportCIDRs`. Both lanes must use the same `auth` (default `ingestKey`). Each lane keeps its own small queue on the node (about 32 MiB per receiver at most). Upgrading from `0.1.1-alpha8`: values that still set `merchantId` or `projectId` are refused at render time; remove them. ## Check it [#check-it] Check that the agent pods run and log no errors, then look for your cluster in the panel: ```bash kubectl -n logdrop-system get pods -l app.kubernetes.io/instance=logdrop kubectl -n logdrop-system logs daemonset/logdrop-logdrop-infrastructure-agent | grep -i -E 'error|fail' | tail ``` One `agent` pod per node and one `cluster` pod should be running. Within a few minutes the panel's **Infrastructure → Inventory** lists your cluster, nodes and pods and shows how many of your monitored nodes are in use; **Metrics & capacity** shows their usage. A resource whose last measurement is more than 15 minutes old shows as stale. Send a request to a traced service, open it in **Trace Explorer** and look at its **Infrastructure** section: the cluster, node, workload and pod it ran on show as *Matched*. A trace names its node and workload but cannot carry their stable identity, and LogDrop never matches by name. It reaches them through the trace's pod instead: the kubelet metrics of that pod carry the node and the owning workload by UID, and a pod never moves to another node. So **Node** and **Workload** match when kubelet metrics (`agent.kubeletstats`) cover the pod's namespace. The agent's own counters show whether LogDrop accepts its data: ```bash kubectl -n logdrop-system port-forward pod/ 8886 & curl -s localhost:8886/metrics | grep -E 'otelcol_exporter_(sent|send_failed)_metric_points|otelcol_exporter_queue_size' ``` `send_failed` should stay at 0 and the queue near empty (the cluster pod serves the same on port 8887). Every refused request is also a log line `Exporting failed` with LogDrop's answer. ## Upgrade [#upgrade] Run the same `helm upgrade --install` with the new `--version`. With Helm 4 on DigitalOcean Kubernetes, an upgrade can stop with `conflict with "Go-http-client" … .webhooks[name="trace-injector.logdrop.io"].objectSelector`: the platform adds its own rule to the trace injector's webhook. Run the upgrade again with `--server-side=true --force-conflicts`. ## Rotate the key [#rotate-the-key] Rotating replaces the metrics key with a new one, for example before the old key expires. The agent reads the key at start, so a new key needs a restart; the queues on disk keep data across it. 1. Create a second key with the **Metrics** signal in the panel. Do not use *Rotate*: it revokes the old key at once. 2. Update the Secret: run the command in step 1 with `--dry-run=client -o yaml | kubectl apply -f -` added to `kubectl create secret`. 3. `kubectl -n logdrop-system rollout restart daemonset/logdrop-logdrop-infrastructure-agent deployment/logdrop-logdrop-infrastructure-cluster` (and the Prometheus pod if you use it). 4. When the old key's *Last used* stops moving (it updates at most every 5 minutes), revoke it. ## Limits [#limits] What LogDrop accepts from the agent. Check them when the agent's log shows a refused request. | Limit | Value | |---|---| | Request size | 256 KiB compressed and uncompressed; the agent sends 64 to 192 KiB requests of at most 256 points | | Points per request | 5,000, at most 1,000 per metric | | Point time | at most 3 hours old and 5 minutes ahead; older points are refused for good, so an outage longer than 3 hours loses its oldest data | | Attributes | 32 on the resource, 32 per data point; keys up to 128 bytes, text values up to 2,048 bytes | | Requests | per key at least 600 and per project at least 3,000 per minute, growing with your monitored nodes (30 and 60 per node and minute) | The agent retries a refused request without a time limit until LogDrop accepts it or refuses it for good. ## Troubleshooting [#troubleshooting] Messages from the chart, the agent's log and the panel, and what to do about them. | You see | Do this | |---|---| | The chart refuses to render with a message | Fix the named value. For example: `export.endpoint` must be an HTTPS base URL; `networkPolicy.exportCIDRs`, `apiServerCIDRs` and `kubeletstats.nodeCIDRs` must list real addresses; `cluster.uid` needs `cluster.namespaces`; receiver evidence needs the host, kubelet, cluster and entity event receivers and, in namespace mode, the chart's namespace; `merchantId`/`projectId` belong to the old token mode | | `401` in the agent log | The key is wrong, revoked or expired, or it has no **Metrics** signal (a traces-only key). Create a key with the Metrics signal; signals cannot be added to an existing key | | `403` | The project's plan has no infrastructure monitoring | | `429` `rate_limited` | More requests than the key's or project's limit, often several clusters sharing one key. Use one key per cluster; the agent retries | | `503` `metrics_ingestion_unavailable` | LogDrop cannot take metrics for this project right now. The agent keeps retrying; if it lasts, contact LogDrop support. Points older than 3 hours are then lost | | `400` | A point older than 3 hours, a value or attribute over the limits, or a malformed request; that request is dropped | | `lookup … no such host` | Node names do not resolve in cluster DNS: set `agent.kubeletstats.endpoint: "https://${env:K8S_NODE_IP}:10250"` | | `dial tcp :10250: i/o timeout` with `agent.hostmetrics` off | The agent runs in the pod network and its NetworkPolicy blocks the kubelets. On Cilium an `ipBlock` does not match node addresses; allow egress to the `host` and `remote-node` entities on port 10250 with a CiliumNetworkPolicy ([Network and disk](/docs/infrastructure/network-and-disk#kubelets-from-the-pod-network-on-cilium)) | | The agent restarts with `bind: address already in use` on `127.0.0.1:8886` | Another host-network agent of the chart runs on the node. Use one release per cluster | | Pods run but **Infrastructure** stays empty | The key belongs to another project than the one you are looking at, the plan has no monitored-node allowance, or egress to the endpoint is blocked (`Exporting failed` with a connection error) | | A trace's **Cluster** or **Pod** row shows *Not matched* | Traces and metrics go to different projects, the **Cluster** row needs `cluster.uid` (namespace mode), the pod is in a namespace that `agent.kubeletstats.namespaces` or `cluster.namespaces` leaves out, or its metrics are outside the window | | A trace's **Node** or **Workload** row shows *Not matched* while its **Pod** matches | They match through the pod's kubelet metrics: turn on `agent.kubeletstats` and include the pod's namespace in `agent.kubeletstats.namespaces`. A trace that names another node or workload than the pod's metrics never matches them | | The agent pod restarts with a receiver publication error after an upgrade | The image is older than the `ingestKey` mode; remove your `image` override (or mirror the chart's default digest) to run the LogDrop image of this chart's release | # Network and disk (/docs/infrastructure/network-and-disk) This page is for cluster operators who install the receivers of the LogDrop chart ([Kubernetes](/docs/infrastructure/kubernetes)). Tracing alone needs neither: the trace injector runs in the pod network, and the Java agent keeps its queue in memory. ## Which parts use the node's network and disk [#which-parts-use-the-nodes-network-and-disk] Most parts of the chart run in the pod network like any other pod. The host/kubelet agent can run on the node's host network instead, where it shares the node's address, and it keeps its queues in a directory on the node. Where each part runs decides which network rules apply to it and how much disk to reserve. | Workload | Network | Queue storage | |---|---|---| | Host/kubelet agent (DaemonSet, one pod per node) | **Host network** when `agent.hostmetrics.enabled` (needed to read the node's `/proc/net`); pod network otherwise | **Node directory** `/--logdrop-infrastructure`, default under `/var/lib/logdrop-infrastructure/` | | Cluster state (Deployment, one replica) | Pod network | PVC, `cluster.queue.size` (default 256Mi) | | Approved Prometheus sources (Deployment, one replica) | Pod network | PVC, `prometheus.queue.size` (default 256Mi) | | Trace injector | Pod network | none | ## What the agent connects to [#what-the-agent-connects-to] The agent opens these connections. Allow them in your NetworkPolicies, firewalls or security groups. | Destination | Port | Chart value that names it | When | |---|---|---|---| | Cluster DNS (`kube-dns` in `kube-system`) | 53 UDP and TCP | `networkPolicy.dnsNamespace`, `networkPolicy.dnsPodLabels` | Always | | LogDrop endpoint (`export.endpoint`) | 443, or the endpoint's port | `networkPolicy.exportCIDRs` | Always; entity events and receiver evidence use it too | | The node's own kubelet | 10250 | `agent.kubeletstats.nodeCIDRs` | `agent.kubeletstats.enabled` | | Kubernetes API server, after service DNAT | 443, 6443 | `networkPolicy.apiServerCIDRs`, `networkPolicy.apiServerPorts` | Kubelet metrics, resource capacity and identity lookups | Nothing connects **to** the agent: in host-network mode its health and metrics endpoints listen on `127.0.0.1` only. A NetworkPolicy matches addresses, not host names: allow the addresses that `otel.logdrop.io` resolves to, and check them again if the agent starts to log connection errors. ## Egress for host-network agents [#egress-for-host-network-agents] The chart renders a default-deny NetworkPolicy for every component, allowing only what it needs. Kubernetes leaves NetworkPolicy behaviour for **host-network pods** to the network plugin, and most plugins do not apply pod policies to them: with `agent.hostmetrics.enabled` the agent's policy may have **no effect**, and the agent can reach anything the node can. Its traffic also leaves with the node's address, not a pod address. Choose one of these before production: 1. **No host network.** Turn `agent.hostmetrics.enabled` off and keep `agent.kubeletstats.enabled`. The agent then runs in the pod network and its NetworkPolicy applies like any other. Node, pod and container CPU and memory still come from the kubelet; you lose the host filesystem and network metrics and the host ID. Receiver evidence needs host metrics, so it is off too. 2. **Node-level egress rules.** Limit outbound traffic of the node pool in your cloud firewall or security groups. These rules cover every process on the node, so they must also allow what the node itself needs (API server, image registries, NTP, your own services); most platform teams already have them, and the rows above are what to add. 3. **Network plugin host policies.** Cilium host firewall (`hostFirewall.enabled`, a `CiliumClusterwideNetworkPolicy` with a `nodeSelector`) or Calico host endpoints with a `GlobalNetworkPolicy`. A host policy puts the whole node into default deny for the direction it selects, so start in audit mode and allow the node's own traffic first; a wrong rule takes nodes down. Verify the result from a node, not from a pod: a host-network process is what has to be stopped. ### Kubelets from the pod network on Cilium [#kubelets-from-the-pod-network-on-cilium] With option 1 on Cilium (for example DigitalOcean Kubernetes), the chart's `ipBlock` rule for `agent.kubeletstats.nodeCIDRs` does not match: Cilium treats node addresses as the `host` and `remote-node` entities. The agent then logs `dial tcp :10250: i/o timeout`. Allow exactly that traffic with a CiliumNetworkPolicy next to the chart's policy: ```yaml apiVersion: cilium.io/v2 kind: CiliumNetworkPolicy metadata: name: logdrop-agent-kubelet-egress namespace: logdrop-system spec: endpointSelector: matchLabels: app.kubernetes.io/instance: logdrop app.kubernetes.io/component: agent egress: - toEntities: [host, remote-node] toPorts: - ports: - {port: "10250", protocol: TCP} ``` ## Disk headroom for agent queues [#disk-headroom-for-agent-queues] Each agent pod keeps unsent data in files in its node directory: one file per exporter, one attempt journal per instrumented receiver. Each file grows up to a fixed ceiling and then refuses new data (the data is lost; the file never fills the disk past its ceiling). Compaction writes a temporary copy of up to the file's live data into the same directory. | File | Exists when | Ceiling | |---|---|---| | Metrics export queue | Always | `max(32 MiB, 4 × export.queueBytes)` | | Entity event queue | `entityEvents.enabled` and `agent.hostmetrics.enabled` | `max(32 MiB, 4 × export.queueBytes)` | | Receiver attempt journal, hostmetrics | `receiverPublication.enabled` | `max(32 MiB, 4 × receiverPublication.queueBytes)` | | Receiver attempt journal, kubeletstats | `receiverPublication.enabled` | `max(32 MiB, 4 × receiverPublication.queueBytes)` | With the defaults (`export.queueBytes` and `receiverPublication.queueBytes` 8 MiB) and every option on, that is 4 × 32 MiB = 128 MiB of files per node and release, and up to **256 MiB** with compaction. When LogDrop accepts the data the files stay small; they grow during an outage or a network problem. # LogDrop Panel (/docs/panel) Welcome to the **LogDrop Panel Documentation**. This guide helps you use the LogDrop panel to monitor **crashes**, **logs**, **HTTP traffic** and each release's **App Health**, follow requests into your backend with **Tracing & APM**, review **Analyze** findings and **Threat Score**, configure security & operational settings, and build event-driven **Customer Journeys** with WhatsApp, SMS, and mobile push. ## Quick Start [#quick-start] 1. **Login:** Go to **panel.logdrop.io** and sign in with your panel credentials. 2. **Select a project:** Choose the project you want to monitor. Data and settings belong to a project, so check the selection before you change anything. 3. Start with **Dashboard** to get a health overview, then drill down into **Devices**, **Logs**, **Crashes**, or **HTTP Monitoring**. 4. **No data yet?** Add a LogDrop SDK to your app with the project's App ID. See the [SDK Developer Guide](/docs/sdk). > **Note** > > If you’re new here: start from [Getting Started](/docs/panel/getting-started/login). ## Panel at a glance [#panel-at-a-glance] The left menu lists the panel's pages. The project selector at the top of the menu switches between your projects; everything you see and change belongs to the selected project. Which pages and actions you see depends on your role and permissions. ![LogDrop Panel Overview](/logdrop_dashboard.png) ## Documentation sections [#documentation-sections] The sections are grouped by what you want to do. Each card says what you can do on that page. ### Get started [#get-started] Sign in, accept your invitation and choose your project. - [Getting Started](/docs/panel/getting-started/login): Sign in at panel.logdrop.io, reset a forgotten password, accept an invitation and see how roles and permissions work. Then choose the project you work in. ### Monitor your apps [#monitor-your-apps] Start from Dashboard for the overall picture, then open the page that matches the problem: a device, a log, a crash or an endpoint. These pages filter by platform, app version, OS version, device model and date, so you can narrow a problem down to one release or device. - [Dashboard](/docs/panel/dashboard): Crash, HTTP, log, storage, device and Threat Score widgets for a date range, for all platforms or only iOS or Android. Add widgets from the Widget Library and arrange your layout. - [Devices](/docs/panel/devices): Find a device by Device UUID or a user by User UUID, and filter the list. Open a device to see its logs, last crashes and HTTP requests. - [Logs](/docs/panel/logs): Find the log files devices sent by user or device, filter them, and download them. Open Log Detail to read and search a file line by line. - [Crashes](/docs/panel/crashes): Crash-free users and sessions, crash trends and the issue list with first and last seen, occurrences and affected users. Read AI summaries and stack traces, and open or close issues in bulk. - [App Health](/docs/panel/app-health): How each release performs on real devices: crash-free sessions, freezes, start time, frames, memory, battery, heat, data and HTTP timing, compared with the previous version. Open a metric to see which screen or endpoint it comes from. - [HTTP Monitoring](/docs/panel/http-monitoring): Request volume, success rate, response time and errors for each endpoint. Search by endpoint or in plain language with AI Search, and open a request's backend trace. - [Fetch Logs](/docs/panel/fetch-logs): Ask every device, or one Device UUID, to upload its logs now. The request reaches the app as a silent push, so the push backends must be configured. ### Follow requests and catch anomalies [#follow-requests-and-catch-anomalies] Tracing connects a request made in your app to the backend services, databases and brokers it reached. Anomaly Detection watches each release and points you to sudden changes. - [Tracing & APM](/docs/panel/tracing): Search and open traces in Trace Explorer, watch service and endpoint health, and see how services depend on each other. Set alert rules and service levels, and create the ingest keys your backend agents use. - [Anomaly Detection](/docs/panel/anomaly-detection): AI-powered detection of sudden spikes in crashes, logic errors, network and performance problems on iOS and Android, and metric anomalies when an App Health metric gets worse in a new version. Each anomaly links to the affected devices, sessions, screens and log lines, and each release gets an AI summary. ### Alerts and notifications [#alerts-and-notifications] Alert rules tell your team when something needs attention. The notification inbox keeps what the panel has reported to you. - [Alerts & Grafana](/docs/panel/alerting): Create alert rules for the project and send them to Grafana Cloud IRM, email, Slack, a webhook or Alertmanager: on logs, crashes and anomalies, when an App Health metric crosses a limit, or with a summary of every new release. Review each alert's delivery history. - [Notifications](/docs/panel/notifications): Read the panel's system alerts and events by severity (Info, Warning and Critical), show only unread ones, and mark them as read or delete them in bulk. ### Reach your users [#reach-your-users] Push Notification sends a message when you choose to. Customer Journeys sends messages when a user's own events call for them. - [Push Notification](/docs/panel/push-notification): Send standard pushes, silent data, deep links and in-app messages to iOS, Android and Huawei devices: to all users, a custom-attribute segment or chosen recipients. Preview the message, then track deliveries, clicks and failures. - [Customer Journeys](/docs/panel/customer-journeys): Start a flow from an app event, then wait, branch on event or device data, and send WhatsApp, SMS and mobile push. Publish versions and follow how many runs entered, are waiting, completed or exited. ### Security [#security] Check your app's binaries and source code, watch device risk, and control how members sign in. - [Analyze](/docs/panel/analyze): Upload an IPA or APK of up to 300 MB for a security scan, and read binary and source-code findings by severity. Compare reports and record your review decisions. - [Threat Score](/docs/panel/threat-score): A 0–100 risk score for the devices active in the project over the last 30 days, with its level and daily trend, shown as a Dashboard widget. - [Single Sign-On (SSO)](/docs/panel/sso): Let members sign in with your identity provider over SAML and require SSO. Verify your domains, and add or remove members automatically with JIT or SCIM. ### Settings and integrations [#settings-and-integrations] Configure the project and connect the tools your team already uses. - [Settings](/docs/panel/settings): Manage users and roles, find the SDK API key, and control SDK behavior with App Config. Block devices or IPs, configure APNs, FCM and HMS push backends, and connect SMS and WhatsApp. - [AI connections (MCP)](/docs/panel/mcp): Connect Claude, Codex, Cursor, GitHub Copilot and other MCP applications to LogDrop. Choose which projects and permissions each connection gets, and review its usage. # Alerts & Grafana (/docs/panel/alerting) Use **Alerts** in the LogDrop Panel to watch application logs, HTTP errors, events, crashes, and anomalies. Create a notification destination, define when a rule should fire, then review its delivery in History. ## Open Alerts [#open-alerts] Select a project in the panel and choose **Alerts** from the left menu. The page has three tabs: | Tab | What it shows | | --- | --- | | **Destinations** | Where alerts are sent, connection tests, and delivery cooldowns | | **Rules** | Signal conditions, thresholds, selected destinations, and trigger counts | | **History** | Alert occurrences, delivery results, and links to related LogDrop data | The **Destinations** tab opens first. Create and enable at least one destination before adding a rule. Admins can create, edit, test, enable, and delete configurations; other project users can view the page. ## Connect Grafana Cloud IRM [#connect-grafana-cloud-irm] A Grafana Cloud IRM destination sends firing LogDrop alerts to a webhook integration in Grafana Cloud IRM, so they reach your on-call team there. Use it if your team handles alerts in Grafana; otherwise pick one of the other destination types at the end of this page. 1. In Grafana Cloud IRM, open **Integrations → Monitoring systems**, create a **Formatted Webhook** integration, and copy its webhook URL. [Grafana's OnCall incoming webhook guide](https://grafana.com/docs/grafana-cloud/observe-and-act/respond-to-incidents/integrations/custom-integrations/incoming-webhooks/oncall-webhooks/) has the current Grafana steps. 2. In LogDrop, open **Alerts → Destinations** and select **New destination**. 3. Enter a **Name**, choose **Grafana Cloud IRM** as the **Destination type**, and paste the URL into **Webhook URL**. 4. If the Grafana integration requires a service account token, enter the full `Bearer ` value in **Authorization header (optional)**. 5. Set **Destination cooldown**, leave **Enabled** on, and select **Test connection**. Then select **Save**. ### Screenshot: New destination [#screenshot-new-destination] ![LogDrop Alerts new destination dialog with destination type, email addresses, cooldown, test connection, and save controls](/page_alerts_new_destination.png) The destination type defaults to **Email** in this screenshot. Select **Grafana Cloud IRM** to show the webhook URL and optional authorization fields. The Destinations table shows the masked URL, whether authorization is configured, and the last test result. You can also use **Test** on a saved destination. A connection test sends a test message to Grafana; it does not create an alert occurrence or change rule counters. When editing a destination, leave the URL or authorization field blank to keep its stored value. The editor also has **Remove stored authorization header** if you need to clear the token. LogDrop stores the URL and authorization header encrypted. > **Note** > > Grafana Cloud IRM, Slack, Webhook, and Alertmanager destinations require **Third-party integrations** to be enabled for the project. Webhook URLs must resolve to public HTTP or HTTPS addresses. LogDrop sends Grafana Cloud IRM a formatted payload with an alert ID, title, `alerting` state, summary, and a link back to LogDrop. It currently sends the firing state only; it does not send a later `ok` event to resolve the Grafana alert automatically. ## Create a rule [#create-a-rule] A rule decides when an alert fires: which signals to watch, how many matching signals within a time window it takes, and which destinations get the alert. 1. Open **Alerts → Rules** and select **New rule**. 2. Enter a **Name** and choose a **Signal source**. Add one or more **Matching conditions** using a field, operator, and value. All conditions must match the same signal. 3. Set **Event threshold** and **Window (seconds)**. For example, a threshold of `3` in a window of `300` fires after three matching signals within five minutes. 4. Optionally set **Distinct devices** and **Rule cooldown (seconds)**. A distinct-device threshold cannot exceed the event threshold. 5. Select one or more enabled **Destinations**, keep **Enabled** on, and select **Save**. ### Screenshot: New rule [#screenshot-new-rule] ![LogDrop Alerts new rule dialog showing signal source, matching conditions, thresholds, destinations, and matching preview](/page_alerts_new_rule.png) | Signal source | Available condition fields | | --- | --- | | Application logs | Level, Message | | HTTP errors | HTTP status, HTTP method, Domain, Path, Latency, Error type, Error message | | Events | Event name, Event property | | Crashes | New issue, Regression, Frequent crash, Crash title, Stack trace, Issue occurrence count | | AI anomalies | Severity, Anomaly type, AI confidence, Regression | | Metric anomalies | Metric, Metric group, Severity, Comparison, Direction, Change (%), Platform, App version, Screen, Endpoint, Latency cause | For an event property, choose **Event property** and enter its property name. Enter multiple values separated by commas where the selected operator permits them. Numeric fields use numeric values; boolean fields use `true` or `false`. Before saving, use **Matching preview**: paste a sample JSON signal and select **Test match**. The result tells you whether the sample matches the rule's conditions. It does not send an alert or evaluate the threshold over time. The Rules tab shows each rule's condition summary, policy, destinations, latest trigger, match count, and trigger count. An admin can use the switch to disable a rule, or edit or delete it from the row. ## Metric alerts [#metric-alerts] **Metric threshold** and **Release summary** have their own settings instead of matching conditions (see below). Three signal sources work with [App Health](/docs/panel/app-health) metrics. **New rule** offers a template for each under **Start from a template**: **Metrics that got worse in a new version**, **Crash-free sessions below 99%**, **HTTP latency p90 above 1.5 s** and **Summary of every new release**. ### Metric anomalies [#metric-anomalies] Fires when a [metric anomaly](/docs/panel/anomaly-detection/anomalies#4-metric-changes) opens. It uses matching conditions and thresholds like the other sources. For example, **Comparison** equals `version` sends an alert whenever a metric gets worse in a new version; add **Severity** or **Metric** to narrow it down. ### Metric threshold [#metric-threshold] Fires when a metric crosses a limit you set, for example crash-free sessions below 99 % or HTTP latency p90 above 1500 ms. The rule is checked every 15 minutes from App Health data and notifies once when the limit is crossed. - **Metric**, and for HTTP metrics an optional **Endpoint**. - **Platform** and **Version** (all versions together, or one version). - **Condition** (**Drops below** or **Goes above**) and **Limit**. - **Time window** to evaluate. Metrics that only have daily data, such as crash-free sessions, use 24 hours. - **Minimum samples** (optional); empty uses the metric's own minimum. - **Also notify when it is back within the limit** sends a second message when it recovers. The **Rule preview** repeats the rule in one sentence before you save. ### Release summary [#release-summary] Sends one summary per new version: when a new version reaches **Minimum sessions**, it is compared with the previous version and the result is sent. Choose **Each platform separately** or one platform, optionally pick the **Metrics** (App Health defaults otherwise), and turn on **Only notify if something got worse** to stay quiet when nothing did. Matching preview does not apply to Metric threshold and Release summary rules, because they are evaluated from App Health data every 15 minutes, not from single signals. | Metric threshold | Release summary | | --- | --- | | [![New rule from the Crash-free sessions below 99% template](/app-health/app-health-alert-metric-threshold.png)](/app-health/app-health-alert-metric-threshold.png) | [![New rule from the Summary of every new release template](/app-health/app-health-alert-release-summary.png)](/app-health/app-health-alert-release-summary.png) | ## Review alert history [#review-alert-history] Each time a rule fires, LogDrop records an alert occurrence with a delivery status for each of the rule's destinations. Use History to check that an alert reached its destinations, or to find out why it did not. Open **Alerts → History** to see occurrences and each destination's delivery status. Filter by **Pending**, **Sent**, **Suppressed**, or **Failed**; use **Refresh** for new results and **Previous** or **Next** to move through pages. The link at the end of a row opens the related LogDrop data. **Suppressed** can indicate a rule or destination cooldown. If a Grafana delivery fails, first check the destination's test result and webhook URL, then inspect the occurrence's delivery status in History. Remove a destination from every rule before deleting it. ## Other destination types [#other-destination-types] The same rule can send to several destinations. In **New destination**, choose **Email** (comma-separated addresses), **Slack** (incoming webhook URL), **Webhook** (public URL), or **Alertmanager** (alerts endpoint URL). Webhook destinations can also use an optional Authorization header. Choose the destination type that matches the receiver's payload format. # Analyze (/docs/panel/analyze) *Select a screenshot to open it at full size.* **Analyze** brings security scan reports for your mobile app into one project view. Upload an iOS IPA or Android APK to scan a built app, or open source-code reports submitted by a LogDrop Taint CI workflow. ## Scan an app binary [#scan-an-app-binary] A binary scan checks a built app file, an iOS IPA or an Android APK, for security findings and saves them as a binary report. Scan the builds you want to check; reports for the same app can be compared later. 1. Select the intended project and open **Analyze**. 2. Click **Upload IPA/APK** and choose an `.ipa` or `.apk` file. The upload control accepts files up to **300 MB**. 3. For an iOS IPA, optionally attach the matching dSYM archive as `.zip` or `.tar.gz`. A dSYM folder cannot be uploaded directly. Use **Check IPA / dSYM compatibility** if you want to check their UUIDs before scanning. 4. Click **Scan**. When the scan finishes, open its report from the list. The binary's app ID must match an app ID registered for this project when one is configured. A mismatch stops the scan without saving a report. A dSYM helps verify iOS symbol compatibility; it is not used for Android APKs. ## Read the reports [#read-the-reports] Each binary scan, and each source-code report sent from a LogDrop Taint workflow, appears as a report with its findings. The report list separates **Binary Reports** from **Source Reports** and can be filtered by iOS or Android. Each row shows the app or file, version, highest finding severity, scan date, and finding count. The summary cards show totals across the project reports. [![Analyze report list with summary cards and a source report](/analyze/reports-list.png)](/analyze/reports-list.png) - **Binary report:** Use **Summary** for the severity overview, **Report** for individual findings and evidence, and **Compare** to inspect changes against another scan of the same app. - **Source report:** Use **Report** for file locations and source-to-sink flow traces. A code snippet appears only if the uploaded SARIF included one. Use **Compare** to see new and fixed findings across reports. - **Review findings:** Mark a finding **Real (TP)**, **False positive (FP)**, or **Resolved**, and add a review note. False positives are hidden by default in the report and can be shown again. Review decisions have an audit trail. Source reports come from the [LogDrop Taint analyzers](/docs/taint). The analyzers run in your own workflow; sending a SARIF report to LogDrop is a separate step. Review the platform guide before enabling upload, especially if your report includes source snippets. [![Source report with severity filters and a finding group](/analyze/source-report.png)](/analyze/source-report.png) Expand a finding to inspect its location, available code snippet, review controls, and audit trail. [![Expanded source finding with code snippet and review decisions](/analyze/source-finding-detail.png)](/analyze/source-finding-detail.png) ## Report actions [#report-actions] Report actions change a saved report or export data from it. When available, **Rescan retained binary** runs the current engine on a stored binary and replaces that report's findings while preserving review decisions. An older report may no longer have its original package. **Delete report** permanently removes that report and its stored artifacts; it does not delete SDK telemetry. For a source report, **Export signed suppressions** downloads reviewed false-positive fingerprints for use in your repository. > **Note** > > Analyze reports describe findings in submitted binaries or source reports. They are separate from the [Threat Score](/docs/panel/threat-score) Dashboard widget, which summarizes recent device risk events. A report with no findings is not proof that an app has no security issues. # Anomaly Detection (/docs/panel/anomaly-detection) Anomaly Detection is an AI-powered monitoring system that automatically detects anomalies and regressions in your mobile and web applications. It categorizes issues by severity, calculates release health scores, generates natural language summaries, and helps you identify logic, performance, and crash anomalies. ## Key Capabilities [#key-capabilities] Anomaly Detection watches each app version for sudden changes and links each finding to the data behind it. Use it after a release to see whether the new version introduced problems. - **Automatic Regression Detection** – Identifies sudden spikes in crashes, logic errors, or network anomalies. - **AI-Powered Release Summaries** – Generates executive summaries of app health for each active version. - **Multi-Platform Support** – Separates and monitors both iOS and Android cohorts. - **Deep Incident Mapping** – Maps anomalies directly to affected devices, sessions, and raw log lines. ## Documentation Sections [#documentation-sections] Anomaly Detection has two tabs, **AI Summary** and **Anomalies**, and a detail page for each anomaly. Start with AI Summary to judge a release, then open an anomaly to investigate it. - [AI Summary](/docs/panel/anomaly-detection/ai-summary): Analyze release health summaries, health score gauges, adoption rate, incidents, and critical crashes. - [Anomalies](/docs/panel/anomaly-detection/anomalies): Review iOS and Android anomalies categorized by severity levels (Critical, High, Medium). - [Anomaly Detail](/docs/panel/anomaly-detection/anomaly-detail): Inspect occurrence metrics, confidence levels, root causes, affected devices, and logs mapping. # AI Summary (/docs/panel/anomaly-detection/ai-summary) The AI Summary tab under Anomaly Detection provides an automated, natural-language executive summary of your app's release health. It compiles metrics and detects regressions between app versions to help product and engineering teams understand release quality at a glance. ## 1) Version-Level Health Metrics [#1-version-level-health-metrics] For each active app version, the panel calculates a set of summary metrics that represent the stability of the release. Use them to compare versions and to see whether a new release needs attention: - **Health Score** – A circular 0-100 rating indicating overall stability. Higher is better. - **Adoption Rate** – The percentage of active devices running this specific version. - **Anomalous Devices** – The percentage of devices running this version that encountered at least one anomaly. - **Incidents** – The total count of anomalies detected for this version. - **Critical Crashes** – The count of fatal issues that caused the app to crash. ### Screenshot: AI Summary metrics [#screenshot-ai-summary-metrics] ![LogDrop Panel - AI Summary](/AISummary.png) ## 2) AI-Generated Release Health Summary [#2-ai-generated-release-health-summary] Expanding the **AI-Generated Summary** section reveals a structured, natural-language analysis generated by LogDrop's LLM engine. Read it when you want a release's health explained in words, for example to brief product and engineering teams. It is organized into the parts below. ### Executive Summary [#executive-summary] A high-level diagnostic of the version's health. For example, it will warn you if a critical severity crash is affecting a new release, even if the overall adoption rate is still low. ### Comparison & Regression Analysis [#comparison--regression-analysis] Compares the current release's health score and incident rate directly against previous versions (e.g., comparing `v1.0.63` against `v1.0.62`) to detect stability improvements or regressions. ### New Regressions [#new-regressions] A bulleted breakdown of newly introduced issues in the release, such as new crash signatures or configuration issues (e.g., missing API keys or bundle identifier mismatches). ### Adoption & Traffic Weight [#adoption--traffic-weight] Contextualizes the issue frequency by providing traffic weight data (e.g., `11.02% (99 registered devices out of 898 total active platform devices)`). Use it to judge how many users the release's issues can reach. ### Critical Issues & Crashes [#critical-issues--crashes] Details critical issues, listing the exception signature, severity level, total events observed, timeline of occurrences, and a predicted root cause. ### Other Key Findings [#other-key-findings] Highlights non-fatal high-severity issues (e.g., APNs push backend failures or missing parameters in notification handlers) along with device impact counts. ### Screenshot: AI-Generated Summary expanded [#screenshot-ai-generated-summary-expanded] ![LogDrop Panel - AI-Generated Summary](/AI-GeneratedSummary.png) # Anomalies (/docs/panel/anomaly-detection/anomalies) The Anomalies tab lists all active incidents and anomalies detected across your app versions. It categorizes issues by severity and anomaly type, giving developers a structured list to prioritize work. ## 1) App Version Grouping [#1-app-version-grouping] Anomalies are grouped by app version so you can easily isolate regressions in new releases from legacy issues in older deployments. ## 2) Severity Categorization [#2-severity-categorization] Severity shows how much an anomaly affects your users, so it tells you what to handle first. Within each app version, detected anomalies are organized into three severity tiers: - **Critical** – Reserved for issues with severe user impact, primarily fatal application crashes (e.g., `Crash`). - **High** – Non-fatal issues that severely impact usability or core functionality, such as failed push notifications, missing configurations, or major performance bottlenecks (e.g., `Logic`, `Error`, `Performance`). - **Medium** – Minor errors, warnings, or anomalies that do not break main user flows but should be addressed (e.g., secondary network errors or UI logic warnings). ## 3) Anomaly Type Pills [#3-anomaly-type-pills] The anomaly type tells you what kind of problem was detected, such as a crash or a slow response. Issues are represented by type pills that display the count of active incidents of that type: - **Crash** – Application crashes and uncaught exceptions. - **Error** – Network response failures, file IO issues, or API errors. - **Logic** – Missing variables, configuration inconsistencies, or logic path failures (e.g., `APNs Registration Configuration Failure`). - **Performance** – App lag, slow responses, database query slowdowns, or rendering delays. *Clicking on any anomaly pill opens the detailed list and lets you navigate to the **Anomaly Detail** page.* ### Screenshot: Anomaly Detection list [#screenshot-anomaly-detection-list] ![LogDrop Panel - Anomaly Detection list](/AnomalyDetection.png) ## 4) Metric changes [#4-metric-changes] Besides the AI findings from logs, the Anomalies tab lists **metric changes**: App Health metrics that got clearly worse in a version compared with the previous one. They are measured from SDK data, so they need no AI, and both versions are compared over the same days. Use the **Source** filter to show **All** anomalies, only **Metrics**, or only **AI** findings, and the **App version** filter to pick a version. Each version shows how many metric changes and AI findings it has. Each metric change shows the metric, its severity (**High**, **Medium** or **Low**), the screen or endpoint where it changed most (for example `HomeFragment` or `GET /v1/orders`), the value before and after, and the change. Select a row to open its [detail](/docs/panel/anomaly-detection/anomaly-detail#metric-anomalies). [![Anomalies tab with the metric changes of version 5.1.0](/app-health/app-health-anomalies-metric-changes.png)](/app-health/app-health-anomalies-metric-changes.png) A metric change opens only when the change is large enough, there are enough sessions and devices in both versions, and the result is statistically clear. At most a set number of new anomalies open per day; the rest are listed in one summary. The same metrics, with the same thresholds, are compared on the [App Health](/docs/panel/app-health) page. ## 5) Sensitivity [#5-sensitivity] Select **Sensitivity** at the top right to decide how large and how certain a change must be before it becomes an anomaly. - **New anomalies per day:** at most this many anomalies open per day (5–30, default 10); the rest are listed in one summary. - **Metric groups:** set **HTTP**, **Stability**, **Logs**, **Events**, **Push**, **Data sending**, **Start & smoothness**, **Memory** and **Battery & heat** to **Low**, **Normal** or **High**. **Normal** uses the recommended thresholds. **High** also catches smaller changes with less data (more anomalies and notifications); **Low** keeps only large, clear changes (fewer). - **Advanced:** set each metric's **Min. samples**, **Min. devices**, **Min. change (%)** and **Min. change** yourself. A number you set stays until you pick a level again or reset it; clearing a field returns it to the level's value. Numbers are limited to the range under each field. Select **Save** to apply, **Discard changes** to undo, or **Back to defaults** to return every group to Normal. Changes apply from the next detection run. App Health uses the same thresholds when it compares versions. | Sensitivity levels | Advanced thresholds | | --- | --- | | [![Anomaly sensitivity with a level per metric group](/app-health/app-health-sensitivity.png)](/app-health/app-health-sensitivity.png) | [![Advanced HTTP thresholds per metric](/app-health/app-health-sensitivity-advanced.png)](/app-health/app-health-sensitivity-advanced.png) | # Anomaly Detail (/docs/panel/anomaly-detection/anomaly-detail) Anomaly Detail is the diagnostic dashboard for a single detected incident. It provides impact metrics, AI-generated root cause analysis, first/last seen timestamps, and direct mappings to affected device UUIDs and raw session logs. ## 1) Header & Actions [#1-header--actions] The header contains key categorization tags and action items to manage the anomaly's lifecycle: - **Tags** – Displays the anomaly title (e.g., `APNs Registration Configuration Failure`), severity (e.g., `High`), category (e.g., `Logic`), and status (e.g., `Open`). - **Mark Done** – Resolves the anomaly and removes it from the active list. - **Hide** – Silences notifications for the anomaly without marking it as resolved. - **Create Jira** – Instantly exports the anomaly's context, metrics, and root cause to a new Jira ticket. ## 2) Impact Metrics Grid [#2-impact-metrics-grid] Summary statistics help you understand the depth of the issue's impact across your user base. Use them to judge how urgent the anomaly is: - **Occurrences** – The total count of times this anomaly was triggered. - **Confidence** – The statistical confidence level of the detection model (e.g., `95%`). - **Devices** – The number of unique devices affected. - **Sessions** – The number of user sessions impacted. - **Logs** – The count of log files containing traces of this anomaly. ## 3) Status & Timeline [#3-status--timeline] This block shows whether the anomaly is still open, whether it came back after it was resolved, and when it was first and last seen. Use it to tell a new problem from a returning one: - **Status** – Current resolution state (`Open` / `Closed`). - **Regression** – Displays `Yes` if this issue was previously resolved but has re-appeared in a newer release. - **First Seen** – Timestamp of the first recorded occurrence. - **Last Seen** – Timestamp of the most recent occurrence. ## 4) Root Cause Analysis [#4-root-cause-analysis] An AI-generated diagnosis of why the anomaly occurred and how to fix it. In the example of an APNs configuration failure, it details that the entitlements file is missing a valid `aps-environment` string and points the developer to provisioning profiles. ## 5) Affected Devices [#5-affected-devices] A list of clickable device UUID links running on the impacted version. Clicking a device link navigates to the **Device Detail** page to review hardware specifications and logs. ## 6) Session & Log Mappings [#6-session--log-mappings] Direct links to the exact sessions and raw log files where the anomaly occurred. This lets developers jump straight from the high-level anomaly down to the line of code that triggered it in the raw logs. ### Screenshot: Anomaly Detail overview [#screenshot-anomaly-detail-overview] ![LogDrop Panel - Anomaly Detail](/AnomalyDetecitonDetail.png) ## Metric anomalies [#metric-anomalies] A metric anomaly has its own detail page. It shows how much an App Health metric got worse, where, and what may have caused it. - **Header:** the metric, the version, severity and status, compared with the previous version over the same days. **Mark as seen** tells your team it has been looked at; **Mute** moves it to **Muted**. - **Before and after:** the value in the previous and the new version, the samples and devices behind each, the change, and the days both sides were measured. - **Before and after chart:** the metric per day for both versions. - **Affected segments → On which screens:** the screens where the metric moved most, worst first, with the value before and after. - **Likely trigger request:** for frozen frames and long freezes, the request that was most often followed by a frozen frame on that screen. They happened together; that does not prove the request caused it, but it is usually worth checking how the answer is handled on the main thread. - **Evidence:** links to **Open in App Health** and, for freezes, **Crash reports**, with first and last seen times. [![Sessions with a frozen frame anomaly: 4.14 % to 16.3 % on HomeFragment, with the likely trigger request](/app-health/app-health-anomaly-frozen-frame.png)](/app-health/app-health-anomaly-frozen-frame.png) | Long freeze (ANR) | Time running hot | | --- | --- | | [![Long freeze anomaly with the screens affected](/app-health/app-health-anomaly-anr.png)](/app-health/app-health-anomaly-anr.png) | [![Time running hot anomaly on HomeFragment](/app-health/app-health-anomaly-running-hot.png)](/app-health/app-health-anomaly-running-hot.png) | # App Health (/docs/panel/app-health) App Health shows how each release of your app performs on real devices: how often it crashes or freezes, how fast it starts, how smoothly it draws, how much memory, battery and data it uses, and how fast its network requests are. Every number is compared with the previous version, so you can see right after a release what got worse and on which screen. Open it from **Monitoring → App Health**. Pick the platform (**Android** or **iOS**) and the version at the top right. The page has two tabs: **Overview** for one version and **Compare versions** for any two. > **Note** > > App Health needs **Android SDK 2.1.16**, **iOS SDK 2.1.16**, **Flutter SDK 3.1.0** or **React Native SDK 2.2.0** or later. The numbers come from the SDK; you don't need to add code. Screen names come from screen tracking, see the [SDK Developer Guide](/docs/sdk). ## Overview [#overview] The Overview tab shows one tile per metric for the selected version, grouped into **Stability**, **Speed & smoothness**, **Memory, battery & heat**, **Network & data** and **Other**. [![App Health overview with metric tiles for version 5.1.0 compared with 5.0.0](/app-health/app-health-overview.png)](/app-health/app-health-overview.png) Each tile shows: - **The value** for the selected version, for example `1.89 s` cold start time. - **The change** against the previous version: **No change**, or the change with **worse** (red) or **better** (green). Small changes and changes with too little data are shown as **No change**. - **A sparkline** of the last days. - **How much data** the value is based on, for example `6,769 app starts · 135 devices`. When there is too little data, the tile says **Not enough data yet** and the value is not compared or used for alerts. The header summarises the version: how many metrics got **worse**, how many are **not comparable yet**, and how many open **anomalies** the version has. Select the anomalies badge to open them in [Anomaly Detection](/docs/panel/anomaly-detection/anomalies). Hover the info icon next to a metric's name to see what it measures. Select a tile to open its [metric detail](#metric-detail). ### Customize the tiles [#customize-the-tiles] Select **Customize** to arrange the page for your team. Drag tiles to reorder them within their group, drag a group by its handle to move it up or down, and hide tiles with the trash button. Add hidden tiles back from the group's menu, or select **Reset to all metrics**. The layout is saved in your browser. [![App Health in customize mode with drag handles and hide buttons](/app-health/app-health-customize.png)](/app-health/app-health-customize.png) ## Metrics [#metrics] Metrics that only one platform can measure are shown only on that platform. Battery temperature, for example, is Android only. ### Stability [#stability] | Metric | What it measures | | --- | --- | | Crash-free sessions | Share of sessions that ended without a crash. | | Sessions with a freeze | Share of sessions where the app froze at least once (iOS: 250 ms or more, Android: 1 s or more). | | Sessions with a long freeze (ANR) | Share of sessions with at least one long freeze (Android: 5 s or more, an ANR; iOS: 2 s or more). Closest to Google Play's user-perceived ANR rate, which Play flags above 0.47 %. | | Error logs per session | Average number of error-level log lines per session. | [![Stability tiles](/app-health/app-health-stability.png)](/app-health/app-health-stability.png) ### Speed & smoothness [#speed--smoothness] | Metric | What it measures | | --- | --- | | Cold start time | Time from tapping the app icon to the first screen, when the app was not running. | | Warm start time | Time from returning to the app to its screen, when it was still running in the background. | | Slow frames | Share of screen frames drawn too late (over 16 ms), felt as stutter. | | Sessions with a frozen frame | Share of sessions with at least one frozen frame (over 700 ms): the user saw the screen get stuck. | ### Memory, battery & heat [#memory-battery--heat] | Metric | What it measures | | --- | --- | | Memory use (average) | Typical memory the app uses while open. | | Memory use (peak) | Highest memory the app reached in a session. | | Sessions with low-memory warnings | Share of sessions where the system warned the app about low memory. | | Battery drain | Battery percent used per hour while the app is open and the phone is not charging. iOS reports battery in 5 % steps, so it becomes accurate over many sessions. | | CPU usage | How busy the app keeps the processor, as a percent of one core. CPU work is the part of battery use the app controls. | | Time running hot | Share of app time the phone was hot enough to slow itself down. | | Battery temperature | Highest battery temperature in a session (Android only). | | App storage | Disk space the app takes on the device. | [![Memory, battery and heat tiles](/app-health/app-health-resources.png)](/app-health/app-health-resources.png) ### Network & data [#network--data] | Metric | Source | What it measures | | --- | --- | --- | | HTTP latency (median) | Device | Typical time an API request takes from the device, network included. | | HTTP latency (p90) | Device | The slow end: 9 of 10 requests are faster than this. | | HTTP server error rate | Device | Share of API requests that got a server error (5xx). | | HTTP connection error rate | Device | Share of API requests that got no response at all: timeout, no connection, DNS or TLS failure. | | Waiting for the server (median) | Device | From sending the request to the first byte of the answer: the server's work plus one network round trip. | | Connection setup (median) | Device | Time to open a new connection (DNS, TCP and TLS). Requests on an already-open connection skip it. | | Backend time (median) | Device + backend | How long your backend worked on mobile requests, from its own traces. | | Network and device time (median) | Device + backend | Request time minus backend time: network, connection and the device itself. | | Requests per session | Device | Average number of API requests the app makes in a session. | | Data per session | Device | Network data (download and upload) the app uses in a session. | | Time offline | Device | Share of app time without an internet connection. | **Device** metrics are measured by the SDK on the phone and are there in every project. **Device + backend** metrics also need your backend to send traces to LogDrop (see [Backend Tracing](/docs/backend-tracing)); without them those tiles are not shown. [![Network and data tiles with Device and Device + backend labels](/app-health/app-health-network.png)](/app-health/app-health-network.png) Select **How to read** next to the group title to see where a request's time goes. When latency goes up, compare **Backend time** and **Network and device time**: if backend time went up, the problem is on the server; if network and device time went up, it is on the way or on the phone. Without backend traces, look at **Waiting for the server**, which is the backend and the trip together. [![Where a request's time goes: phone to network, backend, network to phone](/app-health/app-health-network-how-to-read.png)](/app-health/app-health-network-how-to-read.png) > **Note** > > On Android, HTTP latency starts once the connection is open, so connection setup is not part of it. On iOS it is included. Medians do not add up: backend time plus network time is not the median latency. ### Other [#other] **Session length** (how long a session lasts in the foreground) and **Push open rate** (share of received push notifications that were opened). ## Metric detail [#metric-detail] Select a tile to open its detail page. Switch to another metric with the selector at the top right without going back. - **Version comparison:** the value for this version and the previous one, and the change. - **Metric changes:** the open [metric anomaly](/docs/panel/anomaly-detection/anomaly-detail#metric-anomalies) for this metric, if there is one, with its severity and the screen where it changed most. - **Last 30 days, by version:** a daily line per version. Hover a day to see the value and the number of sessions. - **Where is it different?** The same metric split by **Device RAM**, **OS version** and **Connection** (Wi-Fi or mobile data), so you can see whether a problem hits only low-memory phones or one OS version. Faded bars have too little data. - **How the values spread:** a histogram of the values in this version. [![Battery drain detail with version comparison, metric change and 30-day trend](/app-health/app-health-battery-detail.png)](/app-health/app-health-battery-detail.png) ### By screen and by request [#by-screen-and-by-request] Metrics that depend on what the user is doing also show where the app spends the resource. Each table starts with a short **Summary** of what stands out. Screen names come from the SDK's [screen tracking](/docs/sdk). | Table | Shown on | What it tells you | | --- | --- | --- | | Memory by screen | Memory metrics | Average and peak memory per screen, and where the system warned about low memory. | | Battery by screen | Battery drain | Each screen's share of the battery lost against its share of the time, with the CPU, data and heat that explain it. | | CPU by screen | CPU usage | How busy each screen keeps the processor. Busy screens drain battery and heat the phone. | | Data by screen | Data per session | Which screens move the most network data. | | Data by request | Data per session | Which requests move the most data, and on which screen. | | Requests by screen | Battery, CPU | Every request by endpoint and the screen it started on, most frequent per minute first. Repeating requests keep the radio awake. | | Endpoints | HTTP metrics | The metric per endpoint and its change since the previous version, biggest slow-down first. | | Battery by screen | Requests by screen | | --- | --- | | [![Battery by screen table with summary](/app-health/app-health-battery-by-screen.png)](/app-health/app-health-battery-by-screen.png) | [![Requests by screen table with calls per minute](/app-health/app-health-requests-by-screen.png)](/app-health/app-health-requests-by-screen.png) | | Memory by screen | Endpoints | | --- | --- | | [![Memory by screen table with low-memory warnings](/app-health/app-health-memory-by-screen.png)](/app-health/app-health-memory-by-screen.png) | [![Backend time per endpoint with change since the previous version](/app-health/app-health-backend-time-endpoints.png)](/app-health/app-health-backend-time-endpoints.png) | > **Note** > > **Tip:** A screen with a high **Calls / min** in Requests by screen usually polls an endpoint. Consider push, a longer interval or pausing when the screen is idle. ## Compare versions [#compare-versions] The **Compare versions** tab compares any two versions of the same platform. Pick the baseline on the left and the version to judge on the right. The cards at the top count the metrics that got **Worse**, **Changed**, **Better**, had **No change** or have **Not enough data**. Below, every metric is listed per group with both values and the change, worst first. [![Compare versions tab: 6 worse, 17 no change, 1 not enough data](/app-health/app-health-compare.png)](/app-health/app-health-compare.png) Comparing needs two versions of the platform with data. Metrics that cannot be compared per version, such as events per session or active devices, are listed at the bottom as not available here. ## When data appears [#when-data-appears] HTTP numbers appear after each full hour. Session numbers (start time, freezes, memory, battery and the rest) appear once sessions end and are uploaded. A metric is compared with the previous version and raises anomalies or alerts only when both versions have enough sessions and devices; until then the tile shows its value with **Not enough data yet**. Some metrics, such as sessions with a freeze, come from SDK events. They need event tracking to be enabled for the project; their tile says so when it has no data. ## Related [#related] - [Anomaly Detection](/docs/panel/anomaly-detection/anomalies): metric anomalies are opened from the same comparison when a metric gets clearly worse. - [Alerts](/docs/panel/alerting#metric-alerts): get a Slack, email or webhook alert when a metric crosses a limit or a new version gets worse. - [Endpoint Detail](/docs/panel/http-monitoring/endpoint-detail#where-the-time-went): where one request's time went. # Crash Reports (/docs/panel/crashes) Crash Reports helps you monitor and manage crash issues across iOS and Android. Use filters to isolate the impacted segment, review trends and affected users/sessions, and open a crash to analyze stack traces and AI summaries. ## 1) Platform tabs (iOS / Android) [#1-platform-tabs-ios--android] Use platform tabs to focus on crashes for a single platform or compare patterns across platforms. ### Screenshot: Platform tabs [#screenshot-platform-tabs] ![LogDrop Panel - Crash Reports Platform Tabs](/page_crashes_platform_tabs.png) ## 2) Filters (OS / Device Model / App Version) [#2-filters-os--device-model--app-version] Filters help you narrow down the crash list to the most relevant cohort—especially useful after releases or OS updates. - **OS Version** – find OS-specific regressions - **Device Model** – detect device-specific issues - **App Version** – validate release impact - **Status** (Open / Closed) – manage issue lifecycle ### Screenshot: Filters section [#screenshot-filters-section] ![LogDrop Panel - Crash Reports Filters](/page_crashes_filters.png) ## 3) Summary metrics & charts [#3-summary-metrics--charts] At the top of the page you’ll typically see health metrics and trend charts. They show how stable the app is and help you spot a crash spike, for example after a release. Common metrics include: - **Crash-free users / sessions (%)** - **Total crashes** - **Affected users / sessions** - **Daily trend** charts to spot spikes ### Screenshot: Crash overview metrics [#screenshot-crash-overview-metrics] ![LogDrop Panel - Crash Overview Metrics](/page_crashes_overview_metrics.png) ## 4) Issue list (what each row means) [#4-issue-list-what-each-row-means] Each row is one crash issue: a crash that can occur many times, with each occurrence counted as an event. The list shows key indicators such as frequency and impact, so you can decide which issue to fix first. Depending on configuration, rows may include: - **Issue title** / exception signature - **First seen** / **Last seen** - **Events** (occurrence count) - **Affected users** - **App/OS/Device** context - **Issue signal** (to indicate severity/priority) ### Screenshot: Crash issues list [#screenshot-crash-issues-list] ![LogDrop Panel - Crash Issues List](/page_crashes_issue_list.png) ## 5) Bulk actions (Open / Close) [#5-bulk-actions-open--close] Each issue has a status, Open or Closed, that tracks whether it still needs work. You can select one or multiple crash issues and update their status in bulk: - **Close** an issue after it’s fixed or no longer relevant - **Re-open** if the issue appears again or needs additional investigation ### Screenshot: Bulk actions [#screenshot-bulk-actions] ![LogDrop Panel - Crash Bulk Actions](/page_crashes_bulk_actions.png) > **Note** > > **Tip:** Start with the highest-impact issues (most affected users / highest event count), > then open [Crash Detail](/docs/panel/crashes/crash-detail) to review AI analysis and stack traces. # Crash Detail (/docs/panel/crashes/crash-detail) Crash Detail is the deep-dive view for a single crash issue. It shows impact metrics, trends, event-level context, an AI analysis summary (if enabled), and the stack trace to help you identify root cause and fix faster. ## 1) Header (Issue identity) [#1-header-issue-identity] The header typically includes the crash title/signature, exception type, status (Open/Closed), issue signal, and sometimes a source file reference. Use it to confirm which crash you are looking at and whether it is still open. ### Screenshot: Crash Detail header [#screenshot-crash-detail-header] ![LogDrop Panel - Crash Detail Header](/page_crash_detail_header.png) ## 2) AI Analysis Summary [#2-ai-analysis-summary] If AI analysis is enabled, this section summarizes the likely cause and suggests potential remediation steps. Treat it as a helper: validate against the stack trace and your codebase. ### Screenshot: AI summary [#screenshot-ai-summary] ![LogDrop Panel - Crash Detail AI Summary](/page_crash_detail_ai_summary.png) ## 3) Impact metrics [#3-impact-metrics] Impact metrics show how many users this crash reached, how often it occurred, and over what period. Use impact metrics to prioritize. Common fields include: - **Affected users** - **Total events** (occurrences) - **First seen** / **Last seen** ### Screenshot: Impact metrics [#screenshot-impact-metrics] ![LogDrop Panel - Crash Detail Metrics](/page_crash_detail_metrics.png) ## 4) Trends & distributions [#4-trends--distributions] Charts help you identify whether the crash is growing, stable, or tied to specific segments. Common breakdowns include device model, OS version, and app version. ### Screenshot: Trend chart [#screenshot-trend-chart] ![LogDrop Panel - Crash Trend](/page_crash_detail_trend.png) ### Screenshot: Distribution breakdowns [#screenshot-distribution-breakdowns] ![LogDrop Panel - Crash Distributions](/page_crash_detail_distributions.png) ## 5) Event details (single occurrence context) [#5-event-details-single-occurrence-context] Each event represents a single crash occurrence. Event details help you reproduce and debug the issue. Typical fields include: - **App Version**, **OS Version**, **Device Model** - **Timestamp** and **Time in session** (if available) - **App state** (foreground/background) if available - **Flow UUID**, **Device UUID** - Navigation between events (previous/next) ### Screenshot: Event list / event detail [#screenshot-event-list--event-detail] ![LogDrop Panel - Crash Event Detail](/page_crash_detail_event.png) ## 6) Stack trace [#6-stack-trace] The stack trace lists the function calls that were running when the app crashed, and it is the primary source of truth for debugging. Start from the top-most relevant application frames, then correlate with logs and recent deployments. If frames are not readable, check that your dSYM (iOS) or ProGuard/R8 mapping (Android) files were uploaded. ### Screenshot: Stack trace [#screenshot-stack-trace] ![LogDrop Panel - Crash Stack Trace](/page_crash_detail_stacktrace.png) > **Note** > > **Tip:** After identifying the suspected root cause, confirm by checking > [Log Detail](/docs/panel/logs/log-detail) for the same device/time window and by correlating with the > [Dashboard](/docs/panel/dashboard) trend. # Create a Journey (/docs/panel/customer-journeys/getting-started) *Select a screenshot to open it at full size.* ## 1) Open the journey builder [#1-open-the-journey-builder] The journey builder is the editor where you set up a journey and arrange its flow on a canvas. You can start with an empty flow or from an existing funnel. 1. Select your project in LogDrop Panel. 2. Open **Engagement → Customer Journeys**. 3. Click **New Journey**. 4. Under **Start journey from**, choose **Start from scratch** or an existing funnel. [![New journey editor with the Start journey from menu open](/customer-journeys/customer-journeys-create.png)](/customer-journeys/customer-journeys-create.png) ### Start from scratch [#start-from-scratch] A new journey starts with three connected nodes: an Entry event, a Mobile push and an Exit set to **Journey completed**. Configure the Entry event and the push, add the steps you need, and connect every path. Remove the Mobile push if your flow does not need one, and add another Exit for routes that should end as **Journey exited**. ### Start from an existing funnel [#start-from-an-existing-funnel] An existing funnel can provide a starting structure. Use it when you have already defined the steps you want to follow as a funnel. Its first event becomes the Entry event; later events become Wait for event steps. Review the imported filters, timeout values, and connections, then configure the notification content. Importing a funnel creates a journey you can edit. Do not assume that later edits to the funnel will automatically update this journey. ## 2) Set the name and description [#2-set-the-name-and-description] The name identifies the journey in the panel. Use the description to record what the journey is for. - **Journey name:** Use a clear name, such as `Product Follow-Up`. Names must be unique within the project and contain 2–120 characters. - **Description:** Optionally explain the goal or intended audience. The limit is 500 characters. ## 3) Set the maximum duration [#3-set-the-maximum-duration] **Maximum duration (days)** is the time a user's run is allowed to remain in the journey. The panel accepts 1–60 days. A run that exceeds this duration exits without completing the flow. This must cover the longest configured waiting path. Include both fixed Wait durations and Wait for event timeouts on that path. For branching flows, check the longest route, including SMS's Skipped route when it contains additional waiting steps. For example, a 12-hour event timeout followed by a 2-hour Wait needs at least 14 hours. A maximum duration of 1 day covers that configured path; use additional margin when appropriate for your workflow. [![Journey name, description, duration, and re-entry settings](/customer-journeys/customer-journeys-settings.png)](/customer-journeys/customer-journeys-settings.png) ## 4) Set the re-entry delay [#4-set-the-re-entry-delay] **Re-entry delay (days)** determines how soon a user can start another run after their previous run finishes. Use it to control how often the same user can go through the journey, for example so that a user does not get the same reminder too often. | Value | Behavior | | --- | --- | | `0` | A later matching entry event can start a new run after the previous run finishes. | | `1` | Wait one day after the previous run finishes before allowing re-entry. | | Another value up to `60` | Use the configured delay to space out repeated runs. | Re-entry does not create a second simultaneous run for a user who is already in the same journey. It also does not start a run by itself: another matching Entry event is still required. ## 5) Add and configure steps [#5-add-and-configure-steps] Each step in a journey is a node. Use the **Add step** controls beside the canvas. Click a node to open **Node settings**. Each node type has its own required configuration. | Node | Use it to | | --- | --- | | Entry event | Define what starts the journey. There is exactly one per flow. | | Wait | Pause for a fixed duration. | | Wait for event | Wait for a new event, with event paths and a timeout path. | | Condition | Immediately choose True or False using existing event or device data. | | WhatsApp Message | Send a Meta-approved text template using a connected WhatsApp Business account. | | SMS Message | Request an SMS using a connected Twilio account. | | Mobile push | Configure a mobile notification, in-app message, or deep link. | | Exit | End the run as completed or exited. | WhatsApp steps require a project connection, an approved template, recipient and consent attributes, and WhatsApp access in the subscription. See [WhatsApp Config](/docs/panel/settings/whatsapp-config) and [message setup](/docs/panel/customer-journeys/messages#whatsapp-message). ## 6) Connect the flow [#6-connect-the-flow] Connections decide which step a user moves to next. A node can have several outputs, one for each possible outcome. Drag from an output handle at the bottom of a node to the input handle at the top of the next node. Output labels explain which outcome follows that connection. - **Next:** Continue after a step. - **True / False:** The result of a Condition. - **Event path / Timeout:** The result of waiting for an event. - **Continue / Skipped:** The result of SMS eligibility checks. Multiple paths may lead into the same node. For example, both SMS outputs can lead to a Mobile push step. Loops are not supported. All nodes must be reachable from the Entry event, and the flow must contain an Exit. To remove a connection, click its line and use the delete button that appears. Then connect the output to its intended destination. Removing a node also removes its connections, so check surrounding paths afterward. [![Connected outputs on the journey canvas](/customer-journeys/customer-journeys-connections.png)](/customer-journeys/customer-journeys-connections.png) ## 7) Select and move nodes [#7-select-and-move-nodes] Use these controls to keep a large journey readable and to move several nodes at once. The controls at the top right of the canvas offer two modes: | Mode / shortcut | Action | | --- | --- | | **Select** | Drag on empty space to draw a selection box. | | **Shift + click** | Add a node to the selection, or remove it from the selection. | | Drag a selected node | Move the selected group together. | | **Move** | Drag with the left mouse button to navigate around the canvas. | | Hold **Space** | Temporarily move around the canvas. | | Canvas zoom controls | Zoom in or out and fit the flow into view. | | **Expand canvas** | Use more screen space for arranging a large journey. | The selection rectangle appears while you draw it. After you release the mouse, the selected nodes remain highlighted with blue borders. [![Multiple selected nodes with Select and Move controls](/customer-journeys/customer-journeys-canvas-selection.png)](/customer-journeys/customer-journeys-canvas-selection.png) ## 8) Duplicate a configured node [#8-duplicate-a-configured-node] Use this when several branches need a similar step. Click a node's **Duplicate node** icon to create another node of the same type. The copy keeps the configuration, including message content, recipient and consent settings, filters, or wait duration. It appears nearby and is selected for editing. The copy's outgoing connections are empty. Connect it to the appropriate steps before saving. Editing the copy does not change the original node. **Entry event cannot be duplicated.** A journey must have only one entry. [![SMS node and its independent duplicated copy](/customer-journeys/customer-journeys-duplicate.png)](/customer-journeys/customer-journeys-duplicate.png) ## 9) Save the draft [#9-save-the-draft] Check that required settings are filled in and paths are connected, then click **Save draft**. The panel highlights configuration or connection problems that need attention. A draft must pass the flow checks; saving is not a way to keep disconnected or unconfigured steps. A new draft is inactive until you publish it. Saving an edit to an active journey changes its status to Paused and does not publish the edits. See [Publish and monitor](/docs/panel/customer-journeys/publishing) before updating an already published flow. # Customer Journeys (/docs/panel/customer-journeys) *Select a screenshot to open it at full size.* Customer Journeys turns application events into a sequence of actions for each user. Choose what starts a journey, decide when to wait or branch, and configure the messages that should follow. Build the flow visually in **LogDrop Panel → Engagement → Customer Journeys**. ## What you can build [#what-you-can-build] Use a journey when a message should depend on what a user does, or does not do, in your app. For example: - Follow up after a user views a product but does not complete a purchase. - Wait for a registration or another milestone before sending a welcome message. - Choose different paths using event properties or device attributes. - Combine WhatsApp, SMS, and mobile push. Use SMS's separate path when it cannot be sent because of missing consent or an invalid phone number. A journey belongs to the project selected in the panel. Select the correct project before creating the flow or configuring its messages. [![Customer Journeys list with journey statuses](/customer-journeys/customer-journeys-list.png)](/customer-journeys/customer-journeys-list.png) ## How a journey works [#how-a-journey-works] Each user who matches the Entry event moves through the flow on their own, one step at a time. 1. **An Entry event matches.** The published journey starts a run for that user. 2. **The user follows the connected nodes.** A node can wait, evaluate a condition, or request a message. 3. **An Exit ends the run.** Choose whether to record it as completed or exited. | Term | Meaning | | --- | --- | | Journey | The flow you design: its nodes, connections, messages, and settings. | | Run | One user's progress through that journey. The same user can have later runs when re-entry is allowed. | | Node | A step, such as Wait, Condition, or SMS Message. | | Output / path | A node's outgoing connection, such as True, Timeout, or Skipped. | | Published version | A saved version used to run the journey. Editing and saving does not automatically publish a new version. | A user follows one selected path at a branch. Connecting two outputs to the same node lets either outcome reach that node; it does not send the user down both paths at once. A user's current run must end before that user can start another run of the same journey. > **Note** > > **Journey completion is not a delivery receipt.** WhatsApp, SMS, and push steps can continue before > the message is delivered. A Completed count tells you that a run reached a completed > Exit, not that the user received, opened, or acted on a message. ## Before you start [#before-you-start] A journey depends on events and user attributes from your app, and on provider connections in Settings. Check these before you build one: - Customer Journeys must be included in your project's subscription. Review **Billing** if the panel shows that the feature is unavailable. - Install and configure the LogDrop SDK, and make sure the events you want to use are being sent for this project. - Use consistent user identification for events intended to belong to the same user's journey. Anonymous activity and signed-in activity are separate; do not assume a run started before sign-in will automatically become a signed-in run. - For mobile push, configure the relevant [Push Backends](/docs/panel/settings/push-backends) and ensure test devices can receive notifications. - For SMS, enable the SMS feature, connect Twilio, and provide the phone number and consent as user custom attributes. See [SMS Config](/docs/panel/settings/sms-config). - For WhatsApp, enable the WhatsApp feature, connect your Meta business account, approve a text template, and provide the recipient phone number and explicit consent as user custom attributes. See [WhatsApp Config](/docs/panel/settings/whatsapp-config). Use a current SDK version when setting up user custom attributes. Follow the setup guide for [Android](/docs/sdk/android), [iOS](/docs/sdk/ios), [Flutter](/docs/sdk/flutter), or [React Native](/docs/sdk/react-native). ## Watch the walkthrough [#watch-the-walkthrough] The **How to Use** button beside **Cancel** and **Save draft** in the journey editor opens the video walkthrough. It builds the same flow as the product follow-up example. ## Guides [#guides] Read the guides in order when you build your first journey. Use Troubleshooting when a journey does not start, wait, or send as expected. - [Create a journey](/docs/panel/customer-journeys/getting-started): Start from scratch or a funnel, set duration and re-entry, and use the canvas. - [Nodes and conditions](/docs/panel/customer-journeys/nodes): Understand events, timers, event paths, conditions, filters, and exits. - [WhatsApp, SMS, and mobile push](/docs/panel/customer-journeys/messages): Configure providers, recipients, consent, templates, notification content, and message paths. - [Example: product follow-up](/docs/panel/customer-journeys/product-follow-up): Build the complete reminder flow step by step. - [Publish and monitor](/docs/panel/customer-journeys/publishing): Understand drafts, paused journeys, versions, existing users, and counters. - [Troubleshooting](/docs/panel/customer-journeys/troubleshooting): Resolve missing properties, disconnected steps, skipped SMS, and publishing warnings. # WhatsApp, SMS, and Mobile Push (/docs/panel/customer-journeys/messages) *Select a screenshot to open it at full size.* A message node defines the content for the user progressing through that journey. It is not a broadcast to everyone in the project. Configure the required providers and recipient information before publishing a flow containing messages. ## SMS Message [#sms-message] An SMS Message step sends a plain-text SMS to the user through your connected Twilio account. Use it when your app provides the user's phone number and SMS consent as custom attributes. ### Connect Twilio first [#connect-twilio-first] Open **Settings → SMS Config** in the selected project and connect the Twilio account and sender you intend to use. See [SMS Config](/docs/panel/settings/sms-config) for the connection steps and the effect of changing an existing connection. If you add SMS without a connection, the editor offers **Open SMS Config** in a new tab. Finish the connection, return to the journey, and review the SMS node's provider and sender. ### Configure the recipient and consent [#configure-the-recipient-and-consent] The step finds each user's phone number and SMS permission in that user's custom attributes. Add an **SMS Message** node and configure: | Field | What to select or enter | | --- | --- | | Recipient phone property | The user custom attribute containing the recipient's phone number, such as `phone`. | | SMS consent property | The user custom attribute recording permission, such as `sms_perm`. | | Value that permits sending | The exact permission value sent by your app, such as `true`, `1`, or `GRANTED`. | | SMS message | The plain-text message to send. | Phone and consent keys are selected from custom attributes already synchronized for the project. They are **user attributes**, not event-property names or a hardcoded recipient number entered into the node. For example, your application might provide: ```json { "phone": "+905551234567", "sms_perm": "true" } ``` These are example attribute names and values, not mandatory names. Follow the custom-user-attribute guide for your SDK and use the same keys and permission representation in the node. Use **E.164** phone format: a leading `+`, the country code, and the remaining digits. Do not include spaces, dashes, or a local leading zero after the country code. A well-formed phone number does not by itself guarantee provider delivery. Consent must match the configured value. Missing consent or a different value prevents the SMS attempt. Set consent from the user's actual preference in your application. | Recipient and consent | Message and preview | | --- | --- | | [![SMS recipient phone and consent settings](/customer-journeys/customer-journeys-sms-settings.png)](/customer-journeys/customer-journeys-sms-settings.png) | [![SMS message content and preview](/customer-journeys/customer-journeys-sms-settings_2.png)](/customer-journeys/customer-journeys-sms-settings_2.png) | ### Message content and preview [#message-content-and-preview] Use the preview to check the text, and review the character count. A journey SMS body can contain up to **1,600 characters**. Long messages can use multiple SMS segments; encoding and destination also affect provider billing. Twilio charges remain on your connected Twilio account. ### Continue and Skipped [#continue-and-skipped] The SMS node has two outputs. Hover over their information icons for a reminder. | Output | When it is used | What it does not mean | | --- | --- | --- | | **Continue** | Phone and consent checks pass, and the SMS is accepted for sending. | It does not confirm delivery to the phone. | | **Skipped** | Consent is missing or does not match, or the phone number is missing or invalid. | It is not a callback for a later Twilio delivery failure. | The journey does not wait for SMS delivery before moving through Continue. A later provider rejection or delivery failure does not send the user back through Skipped. **Connect both outputs to Mobile push** if the next step should attempt a push in either case. Connect Skipped to a different action or an exited Exit if the alternative route should behave differently. If Skipped is left unconnected, a user who fails the phone or consent checks exits the journey. Connect this path explicitly when SMS eligibility should not stop the rest of the workflow. | Continue | Skipped | | --- | --- | | [![SMS Continue output tooltip and connection to Mobile push](/customer-journeys/customer-journeys-sms-paths.png)](/customer-journeys/customer-journeys-sms-paths.png) | [![SMS Skipped output tooltip and connection to Mobile push](/customer-journeys/customer-journeys-sms-paths_2.png)](/customer-journeys/customer-journeys-sms-paths_2.png) | > **Warning** > > A push connected to both SMS outputs is an independent next action. It may be attempted > whether SMS was accepted or skipped. This is not a delivery-based fallback that waits > for SMS to fail. ## Mobile push [#mobile-push] A Mobile push step sends a notification, in-app message, or deep link to the user's iOS, Android, or Huawei device. Configure the appropriate [Push Backends](/docs/panel/settings/push-backends) first. Receiving a visible notification also depends on the device's notification permission, valid push registration, and the platform's behavior. 1. Add **Mobile push**. 2. Select **Configure mobile push** in Node settings. 3. Choose the message mode, notification style, and target mobile platforms. 4. Fill in the content and check the preview. 5. Select **Save notification** to apply it to this node. 6. Connect **Next** to the following node or an Exit. **Save notification** updates the node configuration. You must still use **Save draft** to save the journey and **Publish** to activate the new version. ### Message modes [#message-modes] The mode decides what the user sees and which content fields you fill in. | Mode | Use it for | | --- | --- | | Standard | A notification with a title and body. | | In-App Message | A configured modal or banner displayed inside the app. | | Deeplink | A message with a navigation target and optional fallback target. | The configuration also supports alert/silent styling and custom data where relevant to the selected message mode. Supported journey push platforms are **iOS, Android, and Huawei**. Web push is not a target of the Mobile push journey node. For a standard notification, use a title of up to **100 characters** and a body of up to **200 characters**. Include at least a title or body for an alert notification. | Configure the notification | Saved notification preview | | --- | --- | | [![Standard mobile push configuration dialog and preview](/customer-journeys/customer-journeys-push-standard.png)](/customer-journeys/customer-journeys-push-standard.png) | [![Mobile push node with saved notification preview](/customer-journeys/customer-journeys-push-standard_2.png)](/customer-journeys/customer-journeys-push-standard_2.png) | ### In-app content [#in-app-content] Choose the modal or banner layout and configure the headline, body, optional image, buttons and button actions, dismissal behavior, and message lifetime. The app must support and display the selected in-app behavior; this is different from receiving a system-tray notification. ### Deep links [#deep-links] A deep link opens a specific screen in your app when the user taps the message. Choose the available deep-link mode, enter the destination, and optionally supply a fallback target. Ensure your application can handle the destination you configure. The [Send Push guide](/docs/panel/push-notification/send-push#message-specific-configurations) explains the shared message configuration controls in more detail. Journey messages use those content controls; their recipient is determined by the journey, not the standalone Send Push audience selector. ### What happens after push [#what-happens-after-push] The Next path continues after the push is accepted for processing, without waiting for the user to receive or open it. An Exit reached after push records the journey's outcome; it is not a message-delivery result. ## Reuse a message step [#reuse-a-message-step] Use **Duplicate node** to copy a configured SMS or push node. The copied content and settings are independent of the original. Connect the copy's outputs before saving. This is useful when multiple branches need similar messages. ## WhatsApp Message [#whatsapp-message] A WhatsApp Message step sends a Meta-approved text template to the user's WhatsApp number. Connect the selected project's WhatsApp Business account in [Settings → WhatsApp Config](/docs/panel/settings/whatsapp-config) before adding this step. The account needs an approved text template with a body and optional footer. WhatsApp access must also be included in the subscription. 1. Add **WhatsApp Message** to the journey. 2. Choose an approved template and language. The editor shows a preview. 3. Select a **recipient phone property** and a separate **WhatsApp consent property** from the user's synchronized custom attributes. 4. Enter the **value that permits sending**. It must match the value your app sends for that user; the default is `true`. 5. Fill every template body parameter shown in the editor, then connect **Next** to the following node or an Exit. 6. Save the draft and publish the journey. Use an international phone number beginning with `+`, followed by 8–15 digits, and record explicit WhatsApp consent. A missing or invalid phone number or a missing or nonmatching consent value prevents sending. The WhatsApp step has a **Next** path; it does not wait for Meta delivery confirmation before the journey continues. A completed journey therefore does not prove that a WhatsApp message was delivered. If the project is not connected, the editor offers a link to WhatsApp Config. After reconnecting, review existing steps, select the current connection and template, and republish. Copying a journey with WhatsApp steps to another project is not currently supported. # Nodes and Conditions (/docs/panel/customer-journeys/nodes) *Select a screenshot to open it at full size.* ## Entry event [#entry-event] The **Entry event** defines what starts a user's run. Select an event from your project's list. System events and your custom events are shown with the same event selectors used elsewhere in the panel; custom events carry a distinguishing badge. Add property filters when an event alone is too broad. For example, an event named `product_viewed` could be restricted to a particular product category if your event includes a category property. All filters on the entry must match the same event. Only an active, published journey accepts new entries. Publishing does not turn historical events into new journey runs. [![Entry event settings with system and custom event choices](/customer-journeys/customer-journeys-entry-event.png)](/customer-journeys/customer-journeys-entry-event.png) ## Wait: a fixed duration [#wait-a-fixed-duration] Use **Wait** to delay the next step for a known amount of time. 1. Add a Wait node. 2. Enter **Wait duration**. 3. Select **Seconds**, **Minutes**, **Hours**, or **Days**. 4. Connect **Next** to the step that should follow. For example, a Wait of 10 minutes delays the next message for 10 minutes after the user reaches this step. It does not wait for a particular event. The duration must be at least 1 second and no more than 60 days, and must fit within the journey's overall duration. [![Wait node configured to delay for ten minutes](/customer-journeys/customer-journeys-wait.png)](/customer-journeys/customer-journeys-wait.png) ## Wait for event: an event or a timeout [#wait-for-event-an-event-or-a-timeout] Use **Wait for event** when the next action depends on what the user does. 1. Select **Event to wait for**. 2. Set the **Timeout** duration and unit. 3. Configure one or more **Event paths**. 4. Connect each event path and the Timeout output. The step waits for a **new occurrence** of the selected event after the user reaches it. It does not complete merely because the user performed that event earlier in the journey. | Result | Next action | | --- | --- | | A new event matches an event path | Continue through the first matching path. | | The event arrives, but no path's filters match | Keep waiting until a later matching event or the timeout. | | The timeout expires | Continue through Timeout. | For example, wait for `purchase_completed`. The event path can lead to a completed Exit, while Timeout leads to a reminder. [![Wait for event configuration with event paths and timeout](/customer-journeys/customer-journeys-wait-for-event.png)](/customer-journeys/customer-journeys-wait-for-event.png) ### Multiple event paths [#multiple-event-paths] Use several paths when the same event should lead to different next steps depending on its properties, such as the purchase amount. You can define **1–5 paths** for the same selected event. Give each path an optional name, add its property filters, and connect its output to the intended next step. Paths are checked **from top to bottom**. The first matching path wins. Use the up/down controls to order paths when their criteria could overlap. For example, for a `purchase_completed` event containing `amount`: | Path | Filter | Destination | | --- | --- | --- | | Higher-value purchase | Amount is at least 100 | A thank-you notification. | | Lower-value purchase | Amount is less than 100 | A completed Exit. | | Timeout | No matching event before the timeout | A reminder. | A path without filters accepts any occurrence of the selected event. Such a catch-all path must be the **only event path**; add a filter before adding another path. Each path can contain up to 5 property filters, and all its filters must match the same event. [![Event paths with property filters and ordering controls](/customer-journeys/customer-journeys-event-paths.png)](/customer-journeys/customer-journeys-event-paths.png) ## Condition: evaluate existing information [#condition-evaluate-existing-information] A **Condition** immediately chooses **True** or **False**. It does not wait for a new event. Connect both outputs, including the route for users who do not match. Under **Condition source**, choose one of the following. ### Journey event data [#journey-event-data] Use a property captured by an **Entry event** or **Wait for event** node earlier in the flow. 1. Select **Journey event data**. 2. Choose the preceding node under **Source event**. 3. Select an **Event property**. 4. Select the operator and provide a value when required. 5. Connect True and False to their next steps. For example, if the product-view event includes `price`, check whether that value is at least 100. True could use a different message, while False ends the journey. The condition uses the data captured by that selected node. It does not query an unrelated event or wait for the property to change. The source must be an event node that comes before the condition. If the project has not defined properties for that event, there are no property choices to use. [![Condition using Journey event data](/customer-journeys/customer-journeys-condition-event-data.png)](/customer-journeys/customer-journeys-condition-event-data.png) ### Device attribute [#device-attribute] Use information captured when the user entered the journey: - Platform: iOS, Android, or Web. - Operating system and OS version. - App version. - Device model or device brand. For example, select **Platform → Equals → Android** to choose an Android-specific path. Device conditions use the entry-time values, not a fresh check at every condition. This matters if the user updates the app or uses another device during the run. Device attribute is not a custom user-attribute condition. Select event data for event properties; select device data for the listed device fields. SMS and WhatsApp phone and consent attributes are configured separately in their message steps. [![Condition comparing the device platform to Android](/customer-journeys/customer-journeys-condition-device.png)](/customer-journeys/customer-journeys-condition-device.png) ## Property filters and values [#property-filters-and-values] A property filter compares a property of an event with a value, such as `amount` at least 100. Use filters to narrow which events start a journey or follow an event path. The panel uses the selected event's property definitions and observed property types to offer appropriate controls. Choose an event or source event before selecting a property. When an event or property is changed, review the remaining operator and value settings. | Property type | Typical controls | | --- | --- | | Text or date | Equals, Does not equal, Contains, Is one of, Exists, Does not exist. | | Number | Equality and numeric comparisons, including greater/less than and their inclusive versions. | | Boolean | True/False selection, Exists, or Does not exist. | | Array | Contains, Contains any, Contains all, Exists, or Does not exist. | | Object | Select the object field when applicable, then use the available comparison controls. | **Exists** and **Does not exist** do not require a value. Multi-value operators accept multiple values. Numeric comparisons should use numbers rather than a descriptive label. Suggested property values help you select values already seen in the project; when a value control permits typing, you can supply the intended comparison value. If a property appears with **Multiple types**, inspect the chosen type and comparison. For example, a number should be compared numerically rather than as a text value. Use consistent property types in the events your application sends. Text equality for event properties is case-sensitive: use the same value as your app sends. For example, `premium` and `Premium` are different event values. [![Numeric event property filter](/customer-journeys/customer-journeys-property-filter.png)](/customer-journeys/customer-journeys-property-filter.png) ## Exit: choose the recorded outcome [#exit-choose-the-recorded-outcome] Every finished route should lead to an **Exit** node. Under **Exit result**, choose: | Exit result | Meaning | | --- | --- | | Journey completed | The run reached the intended end of this route and is counted as Completed. | | Journey exited | The run ended without being counted as Completed, such as a user excluded by a condition. | These are the outcomes you choose for the flow. A completed Exit after a reminder means the user finished the configured reminder route; it does **not** prove they made a purchase. If purchase is the outcome you want to label Completed, connect the purchase path to that Exit and label other endings accordingly. [![Journey Exit outcome configuration](/customer-journeys/customer-journeys-exit-outcomes.png)](/customer-journeys/customer-journeys-exit-outcomes.png) ## Connection checklist [#connection-checklist] The panel checks these rules when you save the draft. Use the list to find what to fix when a node or path is highlighted. - Exactly one Entry event. - At least one Exit. - No loops, including a connection from a node to itself. - All nodes reachable from the entry; unused duplicate nodes must be connected or removed. - Next paths connected for Entry, Wait, and Mobile push. - Every event path and Timeout connected for Wait for event. - True and False both connected for Condition. - SMS Continue connected; Skipped connected whenever users should continue without SMS. - WhatsApp Next connected. A journey supports up to 50 nodes. For message-specific outputs and eligibility, see [WhatsApp, SMS, and mobile push](/docs/panel/customer-journeys/messages). # Example: Product Follow-Up (/docs/panel/customer-journeys/product-follow-up) *Select a screenshot to open it at full size.* This walkthrough follows the same setup shown in the **How to Use** video. The goal is to start after a product view, allow time for a purchase, and send a reminder when no matching purchase event arrives within that time. The event names and user-attribute keys below are examples. Choose the corresponding events and attributes defined in your own project. ## Example flow [#example-flow] This is the finished flow. The numbered steps below build it node by node. ```text Entry: product_viewed └─ Wait for purchase_completed ├─ Purchased → Exit: Journey completed └─ Timeout → Condition: Platform equals Android ├─ False → Exit: Journey exited └─ True → Wait: 10 minutes → SMS Message ├─ Continue ─┐ └─ Skipped ──┴─ Mobile push └─ Exit: Journey completed ``` [![Complete Product Follow-Up journey flow](/customer-journeys/customer-journeys-product-follow-up-flow.png)](/customer-journeys/customer-journeys-product-follow-up-flow.png) ## Prepare the project [#prepare-the-project] The example needs these events, attributes, and connections in your project: - Your app sends `product_viewed` and `purchase_completed` for the intended user. - The project can send mobile push to your test device. - Twilio is connected if you want to include SMS. - User attributes contain a phone number and consent, such as `phone` and `sms_perm`. For a recording or short test, you can use a 30-second event timeout. For an actual campaign, choose a meaningful purchase window rather than copying a demo duration. ## 1) Create the journey [#1-create-the-journey] Open **Engagement → Customer Journeys**, click **New Journey**, choose **Start from scratch**, and name it **Product Follow-Up**. Set **Maximum duration (days)** and **Re-entry delay (days)**. For example, 1 day covers a 30-minute purchase timeout followed by a 10-minute fixed delay. A re-entry delay of 1 day spaces out repeated runs after the earlier run finishes. ## 2) Configure the Entry event [#2-configure-the-entry-event] Select `product_viewed`. Add entry filters if only particular products should qualify. If your event has a price or category property, you can use that property to narrow the entry criteria. ## 3) Wait for a purchase [#3-wait-for-a-purchase] Add **Wait for event**, select `purchase_completed`, and set a timeout such as 30 minutes. Create a single event path without filters if any purchase event should qualify. Name the path **Purchased**, then connect it to a completed Exit. If the purchase must relate to a particular product, review the properties and static filters you configure. Selecting the event name alone accepts that user's matching purchase event; it does not automatically match a product identifier from the entry. Connect Timeout to the Condition in the next step. ## 4) Choose the reminder audience [#4-choose-the-reminder-audience] Add a **Condition**, choose **Device attribute**, then configure **Platform → Equals → Android**. This example targets Android to demonstrate branching; you can use different criteria appropriate to your application. - Connect **False** to an Exit with **Journey exited**. - Connect **True** to a Wait node. To use event data instead, select **Journey event data**, choose a preceding Entry or Wait for event node, and compare one of its properties. For example, check a price captured by the product-view event. This evaluates that recorded event value immediately. ## 5) Add a fixed delay [#5-add-a-fixed-delay] Set the **Wait** duration to **10 Minutes**. This adds a delay after the timeout and condition, before the reminder. Connect Next to the SMS node. > **Note** > > Wait does not monitor purchases. In this example, a purchase during the extra 10-minute > Wait does not automatically cancel the reminder. If you need to keep watching for a > purchase during that period, use another **Wait for event** step with the appropriate > purchase path and timeout instead of a fixed Wait. ## 6) Configure SMS [#6-configure-sms] Select the phone attribute, consent attribute, and the exact permitted value. For example: | Setting | Example | | --- | --- | | Recipient phone property | `phone` | | SMS consent property | `sms_perm` | | Value that permits sending | `true` | | SMS message | `Still interested? Open the app to revisit the item you viewed.` | Check the preview. This text is an example; use content permitted by your Twilio account and suitable for your audience. ## 7) Configure mobile push [#7-configure-mobile-push] Add **Mobile push**, open its configuration, and use: - **Notification title:** `Still interested?` - **Notification message:** `The item you viewed is waiting for you.` Choose the platforms and any navigation target appropriate to your app, then select **Save notification**. Connect both SMS **Continue** and **Skipped** to this push node. A user who has SMS consent and a valid phone number can receive both message attempts. A user without those SMS requirements can still reach the push step. Push delivery still depends on its own provider, device registration, and notification permission. Connect push **Next** to the completed Exit. ## 8) Review the meaning of the exits [#8-review-the-meaning-of-the-exits] In this example, both a purchase and the completed reminder route reach **Journey completed**. Therefore, the Completed counter includes both outcomes. It is not a purchase count. If your reporting should reserve Completed for purchases, use a **Journey exited** Exit for the reminder route instead. The Exit labels should reflect the outcome you intend to measure. ## 9) Save and publish [#9-save-and-publish] Review all connections, remove unused copies, and select **Save draft**. The new journey is Draft and has not been published yet. Open its details and select **Publish** when ready. The first publication creates Version 1 and changes the status to Active. You can use the walkthrough to configure the flow without demonstrating a live message. Before using it for a real audience, validate the entry, purchase, timeout, and skipped-SMS paths with test users and suitable provider settings. ## Alternative: bring users back after leaving the app [#alternative-bring-users-back-after-leaving-the-app] To follow up after someone views a product and backgrounds the app, keep the product-view entry and use **Wait for event** for the background event exposed by your project's event list. Connect that matching path to the intended condition or reminder. Choose an explicit Timeout route for users who do not background the app within the window. A background event is an event trigger; it is not an ongoing check that the app remains in the background. If returning to the app should prevent a later reminder, model the return event with another Wait for event step and connect that path to an Exit. # Publish and Monitor (/docs/panel/customer-journeys/publishing) *Select a screenshot to open it at full size.* ## Journey statuses [#journey-statuses] The status tells you whether a journey accepts new entries right now. | Status | Meaning | | --- | --- | | **Draft** | A newly saved journey that has not been published. It does not accept new entries. | | **Active** | A published journey that accepts matching entry events. | | **Paused** | New entries and new message submissions are stopped. A published version and existing runs may still exist. | The **Version** badge refers to the published version, not the number of times you clicked Save draft. A new journey has published version 0; its first publication creates Version 1. [![Unpublished journey details with Draft status and Version 0](/customer-journeys/customer-journeys-draft-details.png)](/customer-journeys/customer-journeys-draft-details.png) ## Publish a new journey [#publish-a-new-journey] A saved journey stays inactive until you publish it. 1. Complete and connect the flow. 2. Click **Save draft**. 3. Open the journey details. 4. Click **Publish**. 5. Check that the status is **Active** and the version badge shows the first published version. Publishing activates the journey for new matching events. It does not replay earlier activity, and it does not immediately send every configured message. Users reach messages according to the events, waits, and conditions in the flow. [![Published journey details with Active status and Version 1](/customer-journeys/customer-journeys-active-details.png)](/customer-journeys/customer-journeys-active-details.png) ## Edit a published journey [#edit-a-published-journey] Changes to a live journey go through a draft first. When you publish them, you choose how users who are already in the journey continue. 1. Open the journey and click **Edit**. 2. Change the configuration, for example the SMS message body. 3. Click **Save draft**. 4. The journey is **Paused**; saving does not publish the updated content. 5. Click **Publish** again to choose how existing users should continue. While the journey is paused, new entries and new message submissions are stopped. Existing runs are not automatically cancelled, and their waiting deadlines are not frozen. Do not treat Save draft as a way to hold every user at exactly the same step, or as a way to recall messages already sent. Review and publish the update before assuming the flow is ready to run again. ## Choose what happens to current users [#choose-what-happens-to-current-users] Current users are users whose run is still active or waiting when you publish a new version. The publishing dialog shows how many current users there are, how many can be moved, and how many cannot be safely moved to the edited flow. | Option | Effect | Choose it when | | --- | --- | --- | | **Keep current users on the previous version** | Existing runs keep their previous flow and content. New entries use the new version. | You want changes to apply only to new runs. | | **Move current users to the new version** | Compatible runs continue at their current step with the new configuration. Their waiting deadline is preserved. | You want the updated content or compatible changes to apply to users already progressing. | | **End current journeys** | Current active and waiting runs are cancelled. New entries use the newly published version. | Existing runs should not continue to later steps. | Migration is offered only when all current users' steps are compatible with the new flow. If it is unavailable, review the incompatible count and choose another option or revise the changes. After selecting an option, click **Continue**, read the confirmation, and click **Publish version**. Check the Active status and updated version badge afterward. [![Publishing options for keeping, moving, or ending current runs](/customer-journeys/customer-journeys-publish-options.png)](/customer-journeys/customer-journeys-publish-options.png) [![Confirmation to keep current users on the previous version](/customer-journeys/customer-journeys-publish-confirmation.png)](/customer-journeys/customer-journeys-publish-confirmation.png) > **Warning** > > Ending current runs cannot be undone. A message already being processed or already sent > cannot be recalled by cancelling its journey. Review the confirmation before publishing. ## Pause a journey [#pause-a-journey] Use **Pause** on an active journey to stop new entries and new message submissions. Messages already submitted cannot be recalled. Existing runs are not automatically cancelled, and their wait deadlines do not stop counting down. Pausing is not a guarantee that every run or message will resume from the same point when you publish again. To intentionally end current runs while publishing an update, use **End current journeys** and review its confirmation. Republishing a paused journey follows the version publishing flow; it is not a way to silently apply draft edits to every current user. ## Understand the counters [#understand-the-counters] The details page displays journey execution totals: | Counter | Meaning | | --- | --- | | **Entered** | The number of runs started. A user's later re-entry can add another run. | | **Waiting** | Runs currently waiting at a step, such as Wait or Wait for event. This is a current count, not a lifetime total. | | **Completed** | Runs that ended at an Exit set to Journey completed. | | **Exited** | Runs that ended without completion, such as an exited Exit, an expired journey, or an intentionally cancelled run. | Entered, Completed, and Exited describe runs, not necessarily unique people. The same user can contribute more than once when the re-entry settings allow later runs. A run can be progressing between steps rather than waiting or finished, so the displayed counters are not a message-by-message delivery report. In particular, **Completed does not mean an SMS was delivered or a push notification was opened**. [![Entered, Waiting, Completed, and Exited journey counters](/customer-journeys/customer-journeys-counters.png)](/customer-journeys/customer-journeys-counters.png) For push delivery information, use the relevant [Messages](/docs/panel/push-notification/messages) view when available for the message, and check your provider's results as appropriate. For SMS provider delivery problems, review the corresponding Twilio message details. ## Delete a journey [#delete-a-journey] **Delete** removes the journey definition from the panel. Use the confirmation carefully. Deletion is not a recall for messages already sent. If your immediate goal is only to stop new entries, use Pause rather than deleting the flow. # Troubleshooting (/docs/panel/customer-journeys/troubleshooting) *Select a screenshot to open it at full size.* ## The journey is not starting [#the-journey-is-not-starting] Check the following in order: 1. The correct project is selected and Customer Journeys is enabled in its subscription. 2. The journey is **Active**, not Draft or Paused. 3. Your application is sending the selected entry event for this project. 4. Entry property filters match the values and types actually sent by the app. 5. The user does not already have a current run of this same journey. 6. The configured re-entry delay has elapsed after their previous run finished. Historical events do not become new entries when you publish. Trigger a new matching event for your test user. Use consistent identification when testing a run that depends on multiple events from the same user. ## An event or property is missing from a dropdown [#an-event-or-property-is-missing-from-a-dropdown] Event and property choices come from the current project's definitions. Confirm that you selected the right project and that the application has provided the intended event and properties. Custom events are identified in the list. For an event-property condition, choose **Journey event data** and select a preceding **Source event** first. A source event with no defined properties cannot provide property choices. Adding a Condition does not create new event properties in the application. ## The Wait for event step does not advance [#the-wait-for-event-step-does-not-advance] - Check that a new occurrence of the selected event happens after the user reaches the node. - Make sure it belongs to the user whose run is waiting. - Check all filters in the intended event path; every filter must match. - Remember that paths are evaluated from top to bottom and the first matching path wins. - If the event arrives but no path matches, the run stays waiting until a match or timeout. A fixed **Wait** is different: it advances after its duration, not when an event arrives. ## SMS follows Skipped [#sms-follows-skipped] Open the SMS step and verify: - The selected user phone attribute exists and contains an international number beginning with `+`. - The selected consent attribute exists. - Its value matches **Value that permits sending**. - Those attributes have synchronized for the intended user, not just an unrelated test user. The phone and consent dropdowns are based on synchronized project attribute keys. If they are empty, provide those user attributes through the SDK before configuring the step. If the user must continue without SMS, connect **Skipped** to the next step. Without that connection, missing consent or an invalid phone number ends the run. ## SMS follows Continue, but no message arrives [#sms-follows-continue-but-no-message-arrives] Continue means that the SMS was accepted for sending, not that it reached the phone. Review the connected account, sender, destination permissions, provider delivery status, and any trial restrictions in Twilio. A later delivery failure does not use Skipped. Do not interpret the journey's Completed counter as confirmation of SMS delivery. ## WhatsApp does not arrive [#whatsapp-does-not-arrive] Check that WhatsApp is included in the project's subscription and the Meta account is connected in [WhatsApp Config](/docs/panel/settings/whatsapp-config). Confirm that the selected text template is approved, its language and body parameters are set, and the user's phone and explicit WhatsApp consent attributes are present and match the step settings. Review Meta's message status for delivery issues. The journey's Next path and Completed counter do not confirm delivery. ## Push does not arrive [#push-does-not-arrive] Check the selected mobile platforms, [Push Backends](/docs/panel/settings/push-backends), notification permissions, and the test device's push registration. Ensure the node contains saved notification content and is reachable through the path the user followed. Saving content in the push configuration dialog is separate from saving and publishing the journey. In-app messages also depend on the app being able to display the configured in-app experience. ## Saving or publishing highlights a problem [#saving-or-publishing-highlights-a-problem] - Configure the entry event and all required node fields. - Connect Next, True/False, every event path, and Timeout where required. - Remove unused duplicate nodes, or connect them into the flow. - Break any loop or self-connection. - Ensure the maximum duration covers the longest configured wait path. - Review provider-connection warnings in message nodes. - For WhatsApp steps, check the project connection, approved template, recipient and consent fields, template parameters, and subscription access. [![Journey required-field and connection validation](/customer-journeys/customer-journeys-validation.png)](/customer-journeys/customer-journeys-validation.png) ## The journey is Paused after editing [#the-journey-is-paused-after-editing] This is expected when you save changes to an active journey. The draft is stored, and new entries and new message submissions are paused. Publish again and choose how current users should continue. Existing runs do not automatically receive your changed message content, and their waiting deadlines are not frozen during the pause. ## Moving current users is unavailable [#moving-current-users-is-unavailable] The panel cannot safely move every current run to the updated flow. Review the impact counts, then either keep current users on the previous version, end their runs, or revise the flow changes. Do not assume a moved user restarts at the Entry event: a compatible move preserves their current step and waiting deadline. ## A Twilio connection was changed [#a-twilio-connection-was-changed] Review the affected journeys listed during the connection update. After the change, open each SMS journey, select **Use current Twilio connection** if shown, verify the message settings and paths, save, and publish again. Updating account settings does not automatically rewrite each configured SMS node. See [SMS Config](/docs/panel/settings/sms-config#update-or-disconnect-a-connection) for what the connection confirmation means. # Dashboard (/docs/panel/dashboard) The Dashboard provides a high-level overview of your project health. You can monitor key metrics via widgets, filter by date and platform, and customize the layout per user. ## 1) Dashboard overview [#1-dashboard-overview] Dashboard is the first page to check after you select a project. Its widgets put the project's crash, log, HTTP, storage, and device numbers on one page, so you can see what changed before you open a detail page. 1. Open **Dashboard** from the left navigation. 2. Use widgets to track logs, crashes, HTTP performance, storage, and device distributions. 3. Drill down to deeper pages (Devices, Logs, Crashes, HTTP Monitoring) when you detect anomalies. ### Screenshot: Dashboard overview [#screenshot-dashboard-overview] ![LogDrop Panel - Dashboard Overview](/page_dashboard_overview.png) ## 2) Date range filters [#2-date-range-filters] The global date range sets the period the Dashboard widgets show (e.g., Today, Yesterday, Last 7/30/90 Days). Some widgets can also use their own date range independently from the global filter. Change it to focus on an incident or release window. ### Screenshot: Global date range selector [#screenshot-global-date-range-selector] ![LogDrop Panel - Dashboard Date Range](/page_dashboard_date_range.png) ## 3) Platform breakdown (All / iOS / Android) [#3-platform-breakdown-all--ios--android] The platform filter shows Dashboard metrics for all platforms together, or for iOS or Android only. Use platform breakdown where available to compare metrics across iOS and Android and spot platform-specific issues. ### Screenshot: Platform filter [#screenshot-platform-filter] ![LogDrop Panel - Dashboard Platform Filter](/page_dashboard_platform_filter.png) ## 4) Widget Library & Edit Layout [#4-widget-library--edit-layout] Widgets are the cards that make up your Dashboard. **Widget Library** lists the widgets you can add, and **Edit Layout** lets you arrange them. Layouts are saved per user, so you can put the widgets you check most often first. 1. Open **Widget Library** to add or remove widgets. 2. Click **Edit Layout** to rearrange widgets (drag & drop). 3. Resize widgets if supported and save your layout changes. ### Screenshot: Widget Library [#screenshot-widget-library] ![LogDrop Panel - Widget Library](/page_dashboard_widget_library.png) ### Screenshot: Edit Layout (drag & drop) [#screenshot-edit-layout-drag--drop] ![LogDrop Panel - Edit Layout](/page_dashboard_edit_layout.png) ## 5) Chart types (Bar / Line / Area) [#5-chart-types-bar--line--area] Chart-based widgets may support switching between bar, line, and area charts for readability. ### Screenshot: Chart type toggle [#screenshot-chart-type-toggle] ![LogDrop Panel - Chart Type](/page_dashboard_chart_type.png) ## 6) Common widgets (what they mean) [#6-common-widgets-what-they-mean] Each widget tracks one part of the project's health. Use this list to read what a widget shows and what a change in it can point to. - **Crash Overview:** Crash-free users/sessions, total crashes, affected users/sessions. - **HTTP Overview:** Success rate, average response time, request volume, errors. - **Log Rates / Daily Error Logs:** Spikes usually indicate new bugs or loops. - **Daily Storage Usage:** Helps detect abnormal increases in stored logs. - **Device / OS Distributions:** Understand your user base and fragmentation. - **Threat Score:** Read the current project device-risk score and its daily trend. See [Threat Score](/docs/panel/threat-score) for calculation and level ranges. > **Note** > > **Tip:** If you see an anomaly on Dashboard, jump directly to: > [Logs](/docs/panel/logs), [Crashes](/docs/panel/crashes), or [HTTP Monitoring](/docs/panel/http-monitoring). # Devices (/docs/panel/devices) The Devices page lists all devices where LogDrop SDK is active. Use it to search by UUID, filter by platform/model/version, and drill down into a single device for logs, crashes, and HTTP activity. ## 1) What you can do on Devices [#1-what-you-can-do-on-devices] Each device on this page runs your app with the LogDrop SDK active and is identified by its **Device UUID**. Start here when a problem is reported for a specific user or device, or when you want to see which models and versions run your app. - Find a device by **Device UUID** or identify a user by **User UUID**. - Filter devices by **Platform**, **Device Model**, **App Version**, **OS Version**. - Use date filtering to focus on a specific activity window. - Open **Device Detail** to inspect logs, last crashes, and HTTP requests for that device. ### Screenshot: Devices page (list) [#screenshot-devices-page-list] ![LogDrop Panel - Devices List](/page_devices_list.png) ## 2) Search (Device UUID / User UUID) [#2-search-device-uuid--user-uuid] Devices supports two primary search types. A **Device UUID** identifies one device. A **User UUID** is the user ID your app sets with the SDK's `updateUser` call, so searching by it finds the devices linked to that user. - **Search by Device UUID:** Use when you already have a specific device identifier. - **Search by User UUID:** Use to find devices associated with a user identity. ### Screenshot: Search controls [#screenshot-search-controls] ![LogDrop Panel - Devices Search](/page_devices_search.png) ## 3) Filters [#3-filters] Filtering helps you narrow the list to a meaningful subset—especially useful for release analysis and platform comparisons. - **Platform:** iOS / Android (and Huawei if applicable) - **Device Model:** compare issues across hardware models - **App Version:** validate release impact after deployments - **OS Version:** identify OS-specific regressions ### Screenshot: Filters section [#screenshot-filters-section] ![LogDrop Panel - Devices Filters](/page_devices_filters.png) ## 4) Date filtering [#4-date-filtering] Use date filters to focus on a time window (e.g., after a specific release date) and avoid noise from older devices. ### Screenshot: Date filter [#screenshot-date-filter] ![LogDrop Panel - Devices Date Filter](/page_devices_date_filter.png) ## 5) Devices table (common columns) [#5-devices-table-common-columns] The table typically shows a summary per device. Use it to check a device's model and versions before you open it in Device Detail. Depending on configuration, you may see: - **Register Date** (first seen) - **Device UUID** - **Brand / Model** - **App Version** - **OS Version** / **Platform** - **Daily limit used** (if limits are enabled) > **Note** > > **Tip:** When investigating a crash or abnormal HTTP behavior, open the device in > [Device Detail](/docs/panel/devices/device-detail) and jump to Log Detail or HTTP request detail from there. # Device Detail (/docs/panel/devices/device-detail) Device Detail provides an end-to-end view for a single device: device metadata, log files, recent crashes, and HTTP requests. It’s the fastest way to debug a specific user/device issue. ## 1) Device Info [#1-device-info] The Device Info section summarizes device identity and status. Check it first to confirm you are on the right device and to note which app and OS versions it runs. Depending on configuration, you may see: - **Device UUID** - **Brand / Model** - **Platform** (iOS / Android / Huawei) and **OS Version** - **App Version** and **SDK Version** (if displayed) - **Register Date**, **Last Updated** - **Daily limit used** / remaining (if limits are enabled) - **Status** ### Screenshot: Device info section [#screenshot-device-info-section] ![LogDrop Panel - Device Detail (Device Info)](/page_device_detail_info.png) ### Custom attributes in user information [#custom-attributes-in-user-information] Custom user attributes are profile values, such as a plan or a language, that your app attaches to a device through the SDK. When you open a user from **People**, the User Info card shows the custom attributes synchronized by that user's linked devices. The keys are listed alphabetically, so you can check the current values before you use them for segment-based push targeting. To add, update, or remove these values, use the [Android custom user attribute API](/docs/sdk/android#11-custom-user-attributes), [iOS custom user attribute API](/docs/sdk/ios#11-custom-user-attributes), [Flutter custom user attribute API](/docs/sdk/flutter#11-custom-user-attributes), or the [React Native custom user attribute API](/docs/sdk/react-native#11-custom-user-attributes). ## 2) Log Info (Log file summary) [#2-log-info-log-file-summary] Log Info shows the latest log artifact uploaded for the device and provides shortcuts to inspect it. Use it to see when the device last uploaded logs. If you need newer logs, use **Fetch Logs** to ask the device to upload them now. - **File size** and **upload date** - **Go to Log Detail** to inspect log lines - **Fetch Logs** to request real-time logs (if enabled) ### Screenshot: Log info + shortcuts [#screenshot-log-info--shortcuts] ![LogDrop Panel - Device Detail (Log Info)](/page_device_detail_log_info.png) ## 3) Crash Info (Last crashes) [#3-crash-info-last-crashes] This section lists the latest crashes observed for the device (often the last 5). Use it to jump into Crash Detail quickly. ### Screenshot: Recent crashes list [#screenshot-recent-crashes-list] ![LogDrop Panel - Device Detail (Crash Info)](/page_device_detail_crash_info.png) ## 4) HTTP Logs (Requests from this device) [#4-http-logs-requests-from-this-device] HTTP Logs shows requests captured from the device. Typical fields include method, endpoint, status code, response time, and timestamp. Use it to find the request behind a failed or slow action on this device, and use filters to narrow down the view. - **Method**, **Endpoint**, **Status code** - **Response time** (ms) - **Date filter** (if available) - Open a request to see **Endpoint Detail** ### Screenshot: HTTP logs table [#screenshot-http-logs-table] ![LogDrop Panel - Device Detail (HTTP Logs)](/page_device_detail_http_logs.png) ## 5) Manage User (Anonymize / Delete) [#5-manage-user-anonymize--delete] Manage User holds the actions for handling a privacy or compliance request about the user of this device. The actions are administrative and may be restricted by role. Use them carefully: - **Make Anonymous:** anonymizes the user’s personal identity details while keeping technical logs for debugging. - **Delete:** permanently deletes the user/device-related data. This action is typically irreversible. > **Note** > > **Safety:** Use *Delete* only when required (e.g., compliance requests). Prefer *Make Anonymous* for privacy-safe debugging. ### Screenshot: Manage user actions [#screenshot-manage-user-actions] ![LogDrop Panel - Device Detail (Manage User)](/page_device_detail_manage_user.png) # Fetch Logs (/docs/panel/fetch-logs) Devices keep logs locally and upload them later. Fetch Logs asks devices to upload their logs now, through a silent push, so you can read recent logs without waiting for the next upload. You can request logs for **all devices** (by platform) or for a **specific device UUID**. > **Note** > > **Prerequisite:** Fetch Logs typically requires push backend configuration. > If you see warnings, check [Push Backends](/docs/panel/settings/push-backends). ## 1) Fetch logs for all devices [#1-fetch-logs-for-all-devices] Use this option when you want to collect logs from a broader set of active devices. Each platform option sends the request through that platform's push provider, so it needs the matching push backend. Depending on your setup, you may have platform-based options such as: - **iOS** (APNS) - **Android** (FCM) - **Huawei** (HMS) ### Screenshot: All Devices fetch [#screenshot-all-devices-fetch] ![LogDrop Panel - Fetch Logs (All Devices)](/page_fetch_logs_all_devices.png) ## 2) Fetch logs for a specific device (Device UUID) [#2-fetch-logs-for-a-specific-device-device-uuid] Use this option when debugging a specific customer issue. You’ll provide the target **Device UUID** and trigger a log request for that single device. 1. Copy the device’s UUID from [Devices](/docs/panel/devices) or [Device Detail](/docs/panel/devices/device-detail). 2. Paste it into the **Device UUID** field. 3. Trigger **Fetch Logs** and wait for the device to upload logs. 4. Open [Logs](/docs/panel/logs) or [Log Detail](/docs/panel/logs/log-detail) to review the results. ### Screenshot: Single device fetch (Device UUID) [#screenshot-single-device-fetch-device-uuid] ![LogDrop Panel - Fetch Logs (Single Device)](/page_fetch_logs_single_device.png) ## 3) Common warnings & troubleshooting [#3-common-warnings--troubleshooting] If a fetch shows a warning or brings no new logs, the cause is usually the push setup, the device, the UUID you entered, or your role. Check these first: - **Push backend missing:** Configure APNS/HMS/FCM in [Push Backends](/docs/panel/settings/push-backends). - **No logs returned:** Ensure the device is online and the SDK is active. - **Wrong UUID:** Verify you copied the exact Device UUID (not User UUID). - **Permissions:** If you can’t access Fetch Logs, check your role in [Users](/docs/panel/settings/users). # Getting Started (/docs/panel/getting-started) Start here to sign in to the LogDrop Panel, activate your account from an invitation, and select the project you work in. Data and settings belong to a project, so check that the right one is selected before you look at data or change anything. - [Login & Access](/docs/panel/getting-started/login): How to access panel.logdrop.io, sign in, and reset password. - [Invitations & Authorization](/docs/panel/getting-started/invitations): How users are invited, activated, and granted permissions. - [Project Selection](/docs/panel/projects): Select the right project when you have access to multiple projects. # Invitations & Authorization (/docs/panel/getting-started/invitations) This page explains how LogDrop Panel access works: how users are invited, how accounts are activated, and what to check when a user can’t see projects or modules. ## 1) Invitation flow [#1-invitation-flow] New users get panel access through an invitation, unless your organization adds members automatically through single sign-on. An existing panel user sends the invitation from **Settings → Users**, and the new user activates the account from the email before the first sign-in. 1. An existing panel user sends an **invitation** to a new user’s email address. 2. The invited user receives an email with an **activation link**. 3. The user activates the account and sets a password. 4. The user can sign in to **panel.logdrop.io** with email & password. ### Screenshot: Invite user screen [#screenshot-invite-user-screen] ![LogDrop Panel - Invite User](/page_invite_user.png) ## 2) Invitation link expiration [#2-invitation-link-expiration] Invitation links expire after **24 hours**. If the user clicks an expired link, they must be invited again. ### Screenshot: Invitation email / expired link example [#screenshot-invitation-email--expired-link-example] ![LogDrop Panel - Invitation Email / Expired Link](/page_invite_user_mail.png) ## 3) Permissions & visibility checks [#3-permissions--visibility-checks] What a user sees in the panel depends on their role and the projects they are assigned to. If a user can log in but cannot see a project or a module, verify the items below. - User is assigned to the correct **Merchant / Organization** (if applicable). - User has access to the target **Project**. - User role allows access to the relevant module (Dashboard / Logs / Crashes / HTTP / Settings). - If permissions were updated recently, the user should **log out and log in** again. # Login & Access (/docs/panel/getting-started/login) This page explains how to access the LogDrop Panel, sign in, and reset your password. It also covers what to check when you can sign in but cannot see a project or module. > **Note** > > **Panel URL:** [panel.logdrop.io](https://panel.logdrop.io) ## 1) Sign in [#1-sign-in] Sign in with the email address and password of your panel account, the password you set when you activated it. If your organization uses single sign-on, see the note below the screenshot. 1. Open **panel.logdrop.io**. 2. Enter your **email address** and **password**. 3. Click **Sign In** to access the panel. ### Screenshot: Login screen [#screenshot-login-screen] ![LogDrop Panel - Login Screen](/page_login.png) > **Note: Single sign-on** > > If your organization uses single sign-on, select **Sign in with SSO** on the login page and enter your organization's sign-in name. See [Single Sign-On](/docs/panel/sso). ## 2) Forgot password [#2-forgot-password] Use password reset when you cannot remember your password. The panel sends a reset link to your email address, and you choose a new password from that link. 1. On the login page, click **Forgot Password**. 2. Enter your email address and submit the form. 3. Check your inbox and use the password reset link. 4. Set a new password and sign in again. ### Screenshot: Forgot Password flow [#screenshot-forgot-password-flow] ![LogDrop Panel - Forgot Password](/page_forgot_password.png) ## 3) Access & permissions [#3-access--permissions] Panel access is granted via user invitation and permissions. If you cannot see a project or a module, you may not have the required role or project assignment. # HTTP Monitoring (/docs/panel/http-monitoring) HTTP Monitoring helps you analyze network traffic captured from devices: endpoint volume, success/error rates, and performance (response times). Use filters and search to isolate problematic endpoints, then open [Endpoint Detail](/docs/panel/http-monitoring/endpoint-detail) for request/response inspection. ## 1) Overview (what you see here) [#1-overview-what-you-see-here] HTTP Monitoring shows the requests your app made, as captured by the SDK when **HTTP Logging** is turned on in **Settings → App Config**. Use it to find endpoints that fail or respond slowly, for all users or for one release or device group. - **Summary metrics** (requests, success rate, avg response time, errors) - **Daily trend charts** (requests / successes / errors) - **Endpoint list** with method, URL/domain, counts, avg time, success rate, errors - Ability to drill into a single endpoint/request in **Endpoint Detail** ### Screenshot: HTTP Monitoring overview [#screenshot-http-monitoring-overview] ![LogDrop Panel - HTTP Monitoring Overview](/page_http_overview.png) ## 2) Search (Endpoint-based) [#2-search-endpoint-based] Use search to quickly locate a specific endpoint or domain (e.g., `/login`, `/payments`, or a host like `api.yourdomain.com`). ### Screenshot: Search bar [#screenshot-search-bar] ![LogDrop Panel - HTTP Monitoring Search](/page_http_search.png) ## 3) AI Search (natural language) [#3-ai-search-natural-language] If AI Search is enabled, you can write a natural language query and the panel will help apply relevant filters. Use it when you know what you are looking for but not which filters to set. Example queries: - `show failed requests for /login in last 24 hours` - `slow endpoints over 2 seconds` - `errors on Android after version 1.2.3` ### Screenshot: AI Search [#screenshot-ai-search] ![LogDrop Panel - HTTP Monitoring AI Search](/page_http_ai_search.png) ## 4) Filters [#4-filters] Filters limit the requests you see to one time window, platform, version, or device group. They help you isolate the affected cohort and reproduce issues faster. - **Date range** (incident window / release window) - **Platform** (iOS / Android / Huawei if applicable) - **App Version** and **OS Version** - **Device Model** and optionally **Device UUID** - **Status group** (success vs error codes) if available ### Screenshot: Filters section [#screenshot-filters-section] ![LogDrop Panel - HTTP Monitoring Filters](/page_http_filters.png) ## 5) Reading the endpoint list [#5-reading-the-endpoint-list] Each row typically aggregates one endpoint/method combination. Rows with a low success rate, many errors, or a high average response time are the ones to open first. You’ll commonly see: - **Method** (GET/POST/etc.) - **Domain / URL** - **Request count** - **Average response time** - **Success rate** - **Error count** - A mini trend indicator (sparkline) where supported ### Screenshot: Endpoint list [#screenshot-endpoint-list] ![LogDrop Panel - HTTP Endpoint List](/page_http_endpoint_list.png) ## 6) When to open Endpoint Detail [#6-when-to-open-endpoint-detail] Endpoint Detail shows one request with its headers, bodies, timing, and device. Open Endpoint Detail when you need to inspect the exact request/response: - Investigating a specific error response (4xx/5xx) - Validating headers (auth, content-type, SDK headers) - Comparing request body vs server response body - Correlating an HTTP event with a device’s logs - Following a request into your backend services (**Backend Trace**) > **Note** > > **Tip:** For end-to-end debugging, open the device in > [Device Detail](/docs/panel/devices/device-detail) and jump to HTTP/Logs for the same time window. ## 7) From a request to its backend trace [#7-from-a-request-to-its-backend-trace] With [end-to-end tracing](/docs/sdk/tracing), the requests your app makes carry a trace context that a backend traced by LogDrop continues. Endpoint Detail then shows the request's **Backend Trace**: the device span with the backend spans it caused. - To trace your backend, see [Backend Tracing](/docs/backend-tracing). - To search all traces, check service health, the dependency map, alerts and service levels, see [Tracing & APM](/docs/panel/tracing). # Endpoint Detail (/docs/panel/http-monitoring/endpoint-detail) Endpoint Detail is the deep-dive view for a single HTTP event (request). Use it to inspect request/response headers and bodies, validate status codes and timing, and correlate network events with device logs. ## 1) Overview (method, URL, status, duration) [#1-overview-method-url-status-duration] The overview section typically includes the HTTP **method**, full **URL**, **status code**, **duration** (ms), and **timestamp**. Check it first to see whether the request failed and how long it took. ### Screenshot: Endpoint overview [#screenshot-endpoint-overview] ![LogDrop Panel - Endpoint Detail Overview](/page_endpoint_detail_overview.png) ## 2) Actions (shortcuts) [#2-actions-shortcuts] Endpoint Detail provides shortcuts to quickly pivot during debugging: - **Load Request Details** (fetch headers/body if not loaded by default) - **Go to Device Detail** (inspect the same device timeline) - **Go to Log Detail** (correlate network event with logs) - **Previous / Next** navigation between requests (when available) ### Screenshot: Actions toolbar [#screenshot-actions-toolbar] ![LogDrop Panel - Endpoint Detail Actions](/page_endpoint_detail_actions.png) ## 3) Filters (segment the request list) [#3-filters-segment-the-request-list] Filters allow you to focus on a cohort of requests for the same endpoint or device group. Depending on configuration, you may see: - **App Version** - **OS Version** - **Device Model** - **Device UUID** (single device investigation) - **Date range** ### Screenshot: Filters [#screenshot-filters] ![LogDrop Panel - Endpoint Detail Filters](/page_endpoint_detail_filters.png) ## 4) Device information (context) [#4-device-information-context] This section helps you understand the environment where the request occurred. Compare it across failing requests to see whether a failure is tied to one app version, OS version, or device model: - **Device UUID** - **App Version** and **SDK Version** (if displayed) - **OS Version** - **Device Model** ### Screenshot: Device information [#screenshot-device-information] ![LogDrop Panel - Endpoint Detail Device Info](/page_endpoint_detail_device_info.png) ## 5) Request details [#5-request-details] This section shows what the app sent: the request headers and the request body. If they are not shown, use **Load Request Details** in the actions toolbar. ### 5.1 Request headers [#51-request-headers] Request headers commonly include content type, authorization, API keys, and SDK-specific headers. Check them when a request fails with an authorization or content-type problem, and verify that sensitive values are masked where required. Masking rules are set in **Settings → App Config**. ### Screenshot: Request headers [#screenshot-request-headers] ![LogDrop Panel - Request Headers](/page_endpoint_detail_request_headers.png) ### 5.2 Request body [#52-request-body] Request body is often JSON. Use this to validate payload correctness, required fields, and whether sensitive data is masked. ### Screenshot: Request body [#screenshot-request-body] ![LogDrop Panel - Request Body](/page_endpoint_detail_request_body.png) ## 6) Response details [#6-response-details] This section shows what the server sent back: the response headers and the response body. Read it together with the status code to understand why a request failed. ### 6.1 Response headers [#61-response-headers] Response headers can help diagnose caching, security policies, server behavior, and content types. ### Screenshot: Response headers [#screenshot-response-headers] ![LogDrop Panel - Response Headers](/page_endpoint_detail_response_headers.png) ### 6.2 Response body [#62-response-body] Response body shows success/error payloads. For failures, compare error codes/messages against the request payload and server expectations. ### Screenshot: Response body [#screenshot-response-body] ![LogDrop Panel - Response Body](/page_endpoint_detail_response_body.png) ## 7) Backend Trace [#7-backend-trace] When the app uses an SDK version with [end-to-end tracing](/docs/sdk/tracing) and your backend is traced by LogDrop in the same project, the **Backend Trace** section shows the device span for this request with the backend spans it caused. Use it to follow the request from the device into the backend services, databases, and brokers it reached. - **Waiting for backend spans**: the backend spans may still be arriving. The panel checks for 30 seconds; after that, use **Retry trace lookup**. - **This SDK record cannot be correlated**: the request was recorded by an SDK version without tracing. - **Trace retention has expired**: the request is older than trace retention. The section shows the trace ID with a copy button; search for it in [Trace Explorer](/docs/panel/tracing/trace-explorer) to see the whole trace. ## Where the time went [#where-the-time-went] With Android SDK 2.1.16 and iOS SDK 2.1.16 or later, the request also shows where its time went and what was happening on the device. Under the overview, chips show the **Screen** the request started on, slow frames around the request (for example `1 slow frame around the request (longest 63 ms)`) and the bytes sent and received. The **Where the time went** bar splits the request into its parts: - **Connection setup:** opening a new connection (DNS, connect, TLS). Not there when an open connection was reused; the section then says so. - **Send:** sending the request to the server. - **Backend** and **Network round trip:** when your backend sends traces to LogDrop, the waiting time is split into the time your backend spent and the time on the way. - **Waiting for server:** without a backend trace, the backend and the trip together. - **Download:** downloading the answer (measured on iOS). A long purple part means the backend was slow for this request; a long orange part means the time went on the way or on the phone. Select **How to read** for the legend. | Where the time went | How to read it | | --- | --- | | [![Endpoint Detail with screen, slow frame and bytes chips and the time bar](/app-health/app-health-endpoint-timing.png)](/app-health/app-health-endpoint-timing.png) | [![How to read this request's time](/app-health/app-health-endpoint-timing-how-to-read.png)](/app-health/app-health-endpoint-timing-how-to-read.png) | > **Note** > > On Android, HTTP latency starts once the connection is open, so connection setup is not part of the duration. On iOS it is included. Flutter requests sent through Dart's HTTP clients (such as `http` or Dio) show the total duration only. ## Screens that call this endpoint [#screens-that-call-this-endpoint] Shows where this request is made: each screen, how often per minute the request is made there, its share of the screen's requests, the average response size, the data it moved and the average time. Use it to find a screen that polls the endpoint too often. [![Screens that call this endpoint table](/app-health/app-health-endpoint-screens.png)](/app-health/app-health-endpoint-screens.png) > **Note** > > **Tip:** If you suspect a device-specific issue, jump to > [Device Detail](/docs/panel/devices/device-detail) and compare the same window in > [Log Detail](/docs/panel/logs/log-detail). # Logs (/docs/panel/logs) The Logs page lists log files uploaded from devices. Use filters and search to locate the right device/user, then open **Log Detail** to inspect log lines and troubleshoot issues. ## 1) What you can do on Logs [#1-what-you-can-do-on-logs] The SDK keeps logs on the device and uploads them later, so each entry on this page is a log file uploaded by one device. Start here when you know the user, device, or time window of a problem and want to read its logs. - List and inspect log artifacts sent from devices. - Search by user/device context (e.g., find devices associated with a user UUID). - Filter by **Platform**, **Device Model**, **App Version**, **OS Version**. - Apply a date filter to focus on a specific time window (release analysis, incident window, etc.). - Open [Log Detail](/docs/panel/logs/log-detail) for line-by-line inspection and advanced search. ### Screenshot: Logs list [#screenshot-logs-list] ![LogDrop Panel - Logs List](/page_logs_list.png) ## 2) Search [#2-search] Use search to locate logs faster. Common workflows include searching by **User UUID** to list related devices, then drilling into the relevant device’s logs. ### Screenshot: Logs search controls [#screenshot-logs-search-controls] ![LogDrop Panel - Logs Search](/page_logs_search.png) ## 3) Filters [#3-filters] Filters help you narrow results when the dataset is large. These are especially useful after a new release or when you suspect OS/device-specific issues. - **Platform** (iOS / Android / Huawei if applicable) - **Device Model** - **App Version** - **OS Version** ### Screenshot: Filters section [#screenshot-filters-section] ![LogDrop Panel - Logs Filters](/page_logs_filters.png) ## 4) Date filter [#4-date-filter] Use date filtering to focus on a specific incident or post-release window. This reduces noise from older sessions. ### Screenshot: Date filter [#screenshot-date-filter] ![LogDrop Panel - Logs Date Filter](/page_logs_date_filter.png) ## 5) “Logs Deleted Information” [#5-logs-deleted-information] If logs were deleted, the Logs page may show a **Logs Deleted Information** section. This provides visibility that deletion occurred. Check it when logs you expect are missing, to see whether they were deleted. ### Screenshot: Logs Deleted Information (if applicable) [#screenshot-logs-deleted-information-if-applicable] ![LogDrop Panel - Logs Deleted Information](/page_logs_deleted_info.png) ## 6) Logs table (common columns) [#6-logs-table-common-columns] Each row is one uploaded log file. Use the columns to find the right file, then open it in Log Detail. The log list typically includes these columns (depending on configuration): - **Date** (upload/record date) - **Device UUID** - **Brand** / **Model** - **App Version** - **OS Version** / **Platform** - **File Size** - Action to open **Log Detail** > **Note** > > **Tip:** For deep debugging, open [Log Detail](/docs/panel/logs/log-detail) > and use the search operators (& | !) to isolate the exact flow/error. # Log Detail (/docs/panel/logs/log-detail) Log Detail is where you inspect logs line-by-line. Use level filters, flow filtering, date range, and search operators to isolate the exact sequence that caused an issue. ## 1) Header (Device UUID / User UUID) [#1-header-device-uuid--user-uuid] At the top of the page you’ll typically see identifiers such as **Device UUID** and **User UUID**. These help you confirm you’re analyzing the correct device/user context. ### Screenshot: Log Detail header [#screenshot-log-detail-header] ![LogDrop Panel - Log Detail Header](/page_log_detail_header.png) ## 2) Log level filters [#2-log-level-filters] Each log line has a level that tells you what kind of entry it is. Use level filters to focus on the signal you need. Common levels include: **Error**, **Warning**, **Info**, **Debug**, **Crash**, and **Network Activity**. Error, Warning, Info, and Debug match the four log levels your app writes with the SDK. ### Screenshot: Log level filter [#screenshot-log-level-filter] ![LogDrop Panel - Log Level Filter](/page_log_detail_levels.png) ## 3) Device info at log time (context shortcuts) [#3-device-info-at-log-time-context-shortcuts] Some UI elements allow you to open device context at the moment a log line was generated. This helps correlate state (app/OS/version) with the log entry. ### Screenshot: Context shortcuts [#screenshot-context-shortcuts] ![LogDrop Panel - Context Shortcuts](/page_log_detail_context_shortcuts.png) ## 4) Sorting & time alignment [#4-sorting--time-alignment] Sorting supports ascending/descending order. Note that timestamps may reflect device time vs server time depending on configuration; use sorting and date filters to align the session timeline correctly. ### Screenshot: Sorting controls [#screenshot-sorting-controls] ![LogDrop Panel - Sorting Controls](/page_log_detail_sorting.png) ## 5) Log tools [#5-log-tools] The log tools toolbar holds actions that apply to the whole log file. Use them to load new entries, move through a long file, or keep a copy. - **Refresh** to load latest entries - **Scroll to top/bottom** shortcuts - **Sort ASC/DESC** - **Download Logs** for offline analysis ### Screenshot: Log tools toolbar [#screenshot-log-tools-toolbar] ![LogDrop Panel - Log Tools](/page_log_detail_tools.png) ## 6) Pinning log lines [#6-pinning-log-lines] Pin a log line to keep it visible while you navigate other entries. This is useful when comparing a key error line against related lines across the timeline. ### Screenshot: Pin log line [#screenshot-pin-log-line] ![LogDrop Panel - Pinning](/page_log_detail_pinning.png) ## 7) Resizing & expanded view [#7-resizing--expanded-view] You can resize areas between the main list and filtered/detail panels (if available). Long messages (stack traces, JSON) can be expanded for readability. ### Screenshot: Expand long line / resize areas [#screenshot-expand-long-line--resize-areas] ![LogDrop Panel - Expand & Resize](/page_log_detail_expand_resize.png) ## 8) Advanced search [#8-advanced-search] Search looks for the terms you enter in the log lines. Use operators to combine terms, for example to find an error in one flow or to leave out retries. Supported operators: - **AND** using `&` (example: `timeout & login`) - **OR** using `|` (example: `crash | exception`) - **NOT** using `!` (example: `error & !retry`) ### Screenshot: Search bar & operators [#screenshot-search-bar--operators] ![LogDrop Panel - Search](/page_log_detail_search.png) ## 9) Additional filters (Flow / Date / Soft wrap) [#9-additional-filters-flow--date--soft-wrap] Depending on your configuration, you may have more filters to narrow the log timeline. **Flow** uses the `LogFlow` your app passes with its log calls, so you can read the logs of one business flow, such as a checkout, on their own. Available filters can include: - **Flow** (group log lines by a flow/session identifier) - **Start/End date** to narrow down the log timeline - **Soft wrap** for long lines ### Screenshot: Additional filters [#screenshot-additional-filters] ![LogDrop Panel - Additional Filters](/page_log_detail_additional_filters.png) > **Note** > > **Tip:** When debugging, start with **Error** + **Crash** filters, > then narrow down using Flow and search operators. # Connect your AI application (/docs/panel/mcp/connect) Click a screenshot to open its full-resolution version in a new tab. ## Before you connect [#before-you-connect] Sign in to the [LogDrop panel](https://panel.logdrop.io), select a project, and open **Settings → MCP → Connect MCP**. Choose your application in the connection dialog. Each tab offers the setup supported by that application: an install button, commands, or a request you can copy into an agent chat. The public LogDrop MCP server address is: ```text https://mcp.logdrop.io/mcp ``` Do not confuse it with `https://developer.logdrop.io/api/mcp`, the [Docs MCP server](/docs/panel/mcp/docs-server), which only reads the documentation and cannot see your projects. Use the remote **HTTP** connection with browser sign-in (OAuth). You do not need to copy your SDK App ID, a LogDrop password, or an access token into a chat to connect. ## Codex [#codex] For Codex, the panel gives you two Codex CLI commands: one adds the LogDrop server, the other starts the browser sign-in. [![LogDrop panel: Codex setup commands](/mcp/connect-codex.png)](/mcp/connect-codex.png) 1. Select the **Codex** tab in Connect MCP. 2. Copy the two commands and run them in order in a terminal with Codex CLI installed. You can also paste them into a Codex chat and ask it to run them if that session can run local commands. 3. Finish the browser sign-in and [choose your projects and permissions](/docs/panel/mcp/permissions). ```sh codex mcp add logdrop --url 'https://mcp.logdrop.io/mcp' codex mcp login logdrop ``` If LogDrop is already configured at the correct address, only run the login command when you need to authorize again. The connection dialog does not open Codex and type commands for you. You can also configure a remote HTTP server manually in Codex's MCP settings. Depending on your version, these are under **Settings → Plugins → MCPs**. Use `LogDrop` as the display name, enter the server address above, and select the sign-in or authentication action. After setup, start a chat and ask, for example: “List the projects I can access in LogDrop.” If tools are missing, see [refreshing the tool list](/docs/panel/mcp/troubleshooting#new-tools-do-not-appear). [Official Codex MCP documentation](https://developers.openai.com/codex/mcp) ## Claude [#claude] For Claude, you add LogDrop as a custom connector to your Claude account, from Claude's web setup page. [![LogDrop panel: Claude connector setup](/mcp/connect-claude.png)](/mcp/connect-claude.png) 1. Select the **Claude** tab, then **Connect in Claude**. 2. The button opens Claude's **web** connector setup with the LogDrop name and server address filled in. It does not launch Claude Desktop. 3. Review the connector and continue. Select **Connect** or **Sign in** when prompted. 4. Complete the LogDrop authorization page, then return to Claude and enable the connector for your conversation if required. Remote connectors are managed through your Claude account and can be used in supported Claude clients, including Claude Desktop. Make sure you are using the same account and organization. This is separate from manually installing a local Claude Desktop server. > **Note** > > **Team or Enterprise account?** Your organization may require an owner or another authorized role to add the custom connector first. You then connect your own LogDrop account. If the Add button is disabled, contact the person who manages your organization's Claude connectors. If the link opens the general customization page without the setup dialog, sign in to the intended Claude account and open **Connect in Claude** again. You can also add a custom connector manually using the server address above. [Claude's custom connector guide](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) ## Cursor [#cursor] For Cursor, a button opens your installed Cursor and hands it the LogDrop server configuration to review. [![LogDrop panel: Cursor connection button](/mcp/connect-cursor.png)](/mcp/connect-cursor.png) 1. Select **Cursor → Add to Cursor**. 2. Allow the browser to open Cursor if prompted. 3. Review and add the LogDrop server configuration in Cursor. 4. Complete the authentication prompt and LogDrop authorization page. If sign-in does not open, find LogDrop in Cursor's MCP settings and select **Connect** or **Authenticate**. The connection dialog also includes **Manual setup** as a fallback. ## GitHub Copilot in VS Code [#github-copilot-in-vs-code] For Copilot in VS Code, a button opens your installed VS Code so you can add LogDrop as an MCP server there. [![LogDrop panel: GitHub Copilot and VS Code setup](/mcp/connect-copilot.png)](/mcp/connect-copilot.png) 1. Select **Copilot → Add to VS Code**. 2. Allow the browser to open VS Code, then review and add the server. 3. Open LogDrop's MCP controls in VS Code and complete authentication. 4. Finish LogDrop's project and permission selection. This button sets up **VS Code**. It does not configure Copilot in every editor or automatically set up Copilot CLI. Your LogDrop connection card may be named **Visual Studio Code** because VS Code identifies itself as the connecting application. > **Warning** > > Some Copilot/AgentHost versions can show a migration prompt or fail to open sign-in. See [VS Code and Copilot setup issues](/docs/panel/mcp/troubleshooting#vs-code-and-copilot-setup-issues) before moving a working server configuration. ### Copilot CLI [#copilot-cli] The VS Code button does not set up Copilot CLI. For Copilot in the terminal, the Copilot tab also provides a separate CLI setup: ```sh copilot mcp add --transport http logdrop 'https://mcp.logdrop.io/mcp' ``` If it needs sign-in, enter this command inside an interactive Copilot CLI session: ```text /mcp auth logdrop ``` ## Antigravity [#antigravity] For Antigravity, the panel gives you a setup request to paste into an agent chat. The request asks the agent to add LogDrop to its MCP configuration; you then complete the sign-in yourself. [![LogDrop panel: Antigravity setup request](/mcp/connect-antigravity.png)](/mcp/connect-antigravity.png) 1. Select the **Antigravity** tab. 2. Copy the setup request into an Antigravity agent chat. The request tells the agent to add LogDrop while preserving existing servers and settings. 3. Review any requested settings changes. 4. Refresh the MCP server list, select **Authenticate** for LogDrop, and finish browser authorization. The agent may help configure the server, but you may still need to start authentication yourself. Manual setup is also available in the dialog: ```json { "mcpServers": { "LogDrop": { "serverUrl": "https://mcp.logdrop.io/mcp" } } } ``` Merge this entry into the application's existing configuration; do not replace other server entries. ## Other applications [#other-applications] Use this for any other application that supports remote HTTP MCP servers with OAuth sign-in. [![LogDrop panel: Other MCP applications setup](/mcp/connect-other.png)](/mcp/connect-other.png) Select **Other apps** to copy the server URL or a general setup request for your agent. Your application must support remote HTTP MCP servers and OAuth sign-in. Add a server named **LogDrop**, enter the address above, then select **Connect** or **Authenticate**. The setup request is a convenience, not an automatic installer. Your application must have access to its MCP configuration to make the change, and its setting names may differ. ## Finish authorization [#finish-authorization] All setup methods lead to LogDrop's authorization page. Choose the projects to share, select read and write permissions, and approve the connection. Return to your AI application after the browser confirms completion. See [Projects and permissions](/docs/panel/mcp/permissions) for details. # Docs MCP server (/docs/panel/mcp/docs-server) LogDrop has **two different MCP servers**. This page is about the small one: it only reads the public documentation you are reading now. To let an assistant work with your projects, crashes, logs and devices, use the [LogDrop MCP server](/docs/panel/mcp) instead. ## Which server do you need? [#which-server-do-you-need] Use the LogDrop MCP server when the assistant should work with your own projects and data. Use the Docs MCP server when it only needs to know how LogDrop works. | | LogDrop MCP | LogDrop Docs MCP | | --- | --- | --- | | Address | `https://mcp.logdrop.io/mcp` | `https://developer.logdrop.io/api/mcp` | | Suggested name | `logdrop` | `logdrop-docs` | | Sign-in | Yes, with your LogDrop account | No | | Reads | Your projects, devices, logs, crashes, HTTP, events and settings, within the permissions you grant | Only the public pages of developer.logdrop.io | | Can change things | Yes, with write permissions | No, read-only | | Set up from | Panel: **Settings → MCP** | This page | | Use it for | “Why did the latest Android crash happen?” | “How do I add LogDrop to my Flutter app?” | > **Warning: Do not swap the addresses** > > The Docs MCP server cannot see any customer data. If an assistant says it cannot find your projects, crashes or logs, it is probably connected to the Docs MCP server only. Connect the [LogDrop MCP server](/docs/panel/mcp/connect) for that. You can connect both. Give them different names, such as `logdrop` and `logdrop-docs`, so you and your assistant can tell them apart. ## What it can do [#what-it-can-do] The Docs MCP server gives your assistant three tools to find and read documentation pages. | Tool | What it does | | --- | --- | | `search_docs` | Searches the documentation and returns matching pages and sections with their URLs. | | `list_docs_pages` | Lists every documentation page with its URL. | | `get_docs_page` | Returns one page as Markdown, for example `/docs/sdk/ios`. | The tools only return public documentation and never use your LogDrop account. ## Connect your AI application [#connect-your-ai-application] There is no sign-in step. Add the server address and start a new chat. ### Claude Code [#claude-code] Run this command in a terminal: ```sh claude mcp add --transport http logdrop-docs https://developer.logdrop.io/api/mcp ``` ### Codex [#codex] Run this command in a terminal: ```sh codex mcp add logdrop-docs --url 'https://developer.logdrop.io/api/mcp' ``` Unlike the LogDrop MCP server, there is no `codex mcp login` step. ### Cursor, Claude Desktop and other applications [#cursor-claude-desktop-and-other-applications] Add a remote HTTP server to the application's MCP configuration: ```json { "mcpServers": { "logdrop-docs": { "url": "https://developer.logdrop.io/api/mcp" } } } ``` Merge this entry into the existing configuration; do not replace other server entries. Some applications call the field `serverUrl` instead of `url`. ### Copilot CLI [#copilot-cli] Run this command in a terminal: ```sh copilot mcp add --transport http logdrop-docs 'https://developer.logdrop.io/api/mcp' ``` After setup, ask for example: “Using the LogDrop docs, how do I enable crash tracking on iOS?” ## Without MCP [#without-mcp] Assistants that cannot use MCP can still read the documentation as plain Markdown: - **Any page:** add `.md` to its URL, for example [/docs/sdk/ios.md](/docs/sdk/ios.md). The **Copy Markdown** button at the top of each page copies the same text. - **Page index:** [/llms.txt](/llms.txt) lists every page with a short description. - **Everything at once:** [/llms-full.txt](/llms-full.txt) contains all pages in a single file. # Overview (/docs/panel/mcp) Connect Codex, Claude, Cursor, GitHub Copilot, Antigravity, or another compatible MCP application to LogDrop. Ask questions about your applications in plain language, investigate problems, and make supported changes with the permissions you choose. > **Note: Looking for the documentation-only server?** > > This section is about the LogDrop MCP server at `https://mcp.logdrop.io/mcp`, which signs you in and works with your project data. A separate [Docs MCP server](/docs/panel/mcp/docs-server) only reads this public documentation and needs no sign-in. They are not interchangeable. MCP (Model Context Protocol) is the connection between your AI application and LogDrop. A **tool** is an action the assistant can call, such as listing devices or reading a crash report. LogDrop also supplies **instructions** that help the assistant choose tools, connect related records, and follow supported workflows. You do not need to copy a tool list or a separate instructions file into every chat. - [Connect your AI application](/docs/panel/mcp/connect): Set up Codex, Claude, Cursor, Copilot, Antigravity, or another MCP client. - [Projects and permissions](/docs/panel/mcp/permissions): Choose read and write access, review new permissions, and revoke old connections. - [Usage and limits](/docs/panel/mcp/usage): Understand your merchant's shared allowance and request higher limits. - [Troubleshooting](/docs/panel/mcp/troubleshooting): Fix stale tool lists, sign-in problems, missing permissions, and client setup issues. ## Start from the panel [#start-from-the-panel] A connection is one AI application's approved access to LogDrop: the projects and permissions you chose when you signed in from that application. You start a connection from the panel and review or revoke it there later. 1. Sign in at [panel.logdrop.io](https://panel.logdrop.io). 2. Select your merchant and project. 3. Open **Settings → MCP**. 4. Select **Connect MCP**, then choose your AI application. 5. Complete sign-in and choose the projects and permissions to share. The **Connections** tab shows your connected applications, granted permissions, selected project count, expiry, and last use. Connections can cover several projects, including projects in different merchants that you can access. The **Usage & limits** tab shows the allowance for the merchant currently selected in the panel. [![LogDrop MCP connections with a connected Cursor application](/mcp/connections.png)](/mcp/connections.png) *Example connection list. Your applications, projects, and permissions may differ.* ## What you can ask [#what-you-can-ask] You can start with normal requests. You do not need to know the names of the tools. - “Show me the devices in my project.” - “Why did the latest Android crash happen?” - “Is there anything unusual in this app's HTTP requests?” - “Check this app for security risks.” - “How healthy was the app this week?” - “Help me add LogDrop to my Flutter app.” - “Prepare a push notification for users in this segment.” Name the project and time range when you know them. For crash or network investigations, include a device, user, session, or record ID if you have one. The assistant can use related log records to investigate further; a crash's log UUID can help locate the matching entry in a log file. ## Available areas [#available-areas] The exact tools available to your assistant depend on your permissions and panel role. | Area | Examples | | --- | --- | | Projects, dashboard, and people | Project discovery, dashboard statistics, devices, application users, and custom attributes. | | Logs, crashes, and HTTP | Log search, crash groups and stack traces, HTTP summaries, request details, and supported review actions. | | Security and application health | Risk events, threat score, anomaly details, saved Analyze results, and weekly reports. | | Events, funnels, and customer journeys | Event definitions, properties and observed values, funnel results, and supported event or journey changes. | | Alerts and messaging | Alert rules, suggested filter values, notification inbox, message history, and push preparation. | | Settings and SDK setup | Supported user, App ID, app/project configuration, access-control actions, and SDK onboarding guidance. | For a security question, the assistant may need several sources: saved analysis findings, risk event details, threat score, anomalies, and relevant logs or requests. A clean result in one source is not proof that the whole app is secure. For SDK integration, the onboarding tools provide setup guidance and links to the platform documentation and release information. > **Note** > > **SDK type and operating system are different.** SDK type identifies the LogDrop library integration, such as native Android or React Native. Operating system identifies where the app runs, such as Android or iOS. A React Native app can run on either operating system. ## Changes that finish in the panel [#changes-that-finish-in-the-panel] Some tools return a panel link so you can review and complete the action yourself. - **Push notifications:** the assistant prepares a link to the Send Push form. Review the recipients, platforms, title, body, and any message or deep-link options. Only your action in the panel sends the push. - **Customer journey publication:** the assistant can prepare a draft and provide a review link. You review and publish the journey in the panel. - **Large file uploads:** use the panel links for binary analysis files and crash symbol files. You select and upload the files in the panel. Other authorized write tools can make changes directly. Do not assume every write tool opens a panel review page or that every AI application asks for confirmation before each change. See [Projects and permissions](/docs/panel/mcp/permissions). ## Your data and the AI application [#your-data-and-the-ai-application] Data returned by LogDrop is sent to your chosen AI application and may be processed by its model provider. Choose the projects and permissions appropriate for that application and your organization's policies. You can stop a connection's access from **Settings → MCP → Connections**. # Projects and permissions (/docs/panel/mcp/permissions) ## Choose projects and permissions [#choose-projects-and-permissions] During browser sign-in, the **Connect to LogDrop** page shows the requesting application and the projects and permissions you can share. The connection can then use only the projects and permissions you approve here. 1. Select the projects the assistant needs. Projects are grouped by merchant. 2. Review **Read** and **Write** permissions for each feature. 3. Use the information icon beside a feature to see what that permission includes. 4. Use each section's **Select all** checkbox only if you want to grant every permission in that section. 5. Approve to finish connecting, or cancel to leave access unapproved. [![LogDrop authorization screen with read and write permissions and projects grouped by merchant](/mcp/permissions.png)](/mcp/permissions.png) Write permissions are off by default for a fresh authorization and must be selected explicitly. Review the actual checkbox selections each time you reconnect. **Read** permissions allow the assistant to retrieve information. **Write** permissions allow supported changes, including updates or deletions where the feature supports them. An application's labels such as “read,” “write,” or “destructive” describe tools; LogDrop still checks the permissions and your panel role when a tool runs. > **Note** > > A connection cannot give you more access than your panel account has. Sharing a project or selecting a write permission does not make you a merchant administrator. Actions that require an administrator still require that role. ## Panel review for sensitive workflows [#panel-review-for-sensitive-workflows] Push preparation and customer journey publication use panel review links. Open the returned link, check the project and action, and finish in the panel. Pushes are sent only when you send them from the panel; journey drafts are published only when you publish them there. For other write operations, the assistant may call the tool directly once authorized. Confirmation behavior can differ between AI applications and their settings. Review the permissions you grant rather than relying on a chat confirmation for every change. ## When new permissions become available [#when-new-permissions-become-available] An existing connection keeps its granted permissions. LogDrop does not automatically add new write permissions to it. When a connection was authorized before new permissions became available, a **New MCP permissions available** notice can appear on Home. Select **Review MCP connections** to open the MCP page. You can also dismiss the notice. Reviewing or dismissing the notice does not grant access. A permission you deliberately left unchecked is not treated as a newly added permission just because the connection does not have it. Your current connection can keep working with its existing permissions. ### Authorize additional permissions [#authorize-additional-permissions] Follow these steps when a tool needs a permission your connection does not have, or when you want to share more projects. 1. Open your AI application's LogDrop connection and start **Connect**, **Sign in**, or **Authenticate** again. For Codex CLI, run `codex mcp login logdrop`. 2. On LogDrop's authorization page, choose the projects and permissions you now want to share. 3. Return to the AI application. Refresh its MCP connection or fully restart the application if it still has an old tool list. 4. In **Settings → MCP → Connections**, identify the old connection and select **Revoke access** once the replacement works. A new authorization can create a separate connection. The old connection is not automatically revoked just because a newer one exists. Check the application name, creation/expiry information, last use, and granted projects to avoid revoking the replacement by mistake. ## Revoke access [#revoke-access] Revoke a connection you no longer use, or an old one after a replacement works. 1. Open **Settings → MCP → Connections**. 2. Find the connection you want to stop. 3. Select **Revoke access** and confirm in the panel dialog. Revocation stops that connection's future access. If you later want to use it again, authorize a new connection. Removing a server from your AI application's settings and revoking its access in LogDrop are separate actions; use the panel to stop an old grant. [![LogDrop asks for confirmation before revoking a connection](/mcp/revoke.png)](/mcp/revoke.png) *The confirmation dialog is shown before access is revoked.* ## Keep access focused [#keep-access-focused] Share only the projects and feature permissions needed for the task. If your assistant only needs to investigate crashes, you can leave unrelated write permissions off. Do not paste access tokens, passwords, or integration credentials into the conversation to work around a permission error. # Troubleshooting (/docs/panel/mcp/troubleshooting) ## New tools do not appear [#new-tools-do-not-appear] Some Claude and Codex versions or sessions keep an older tool list after the server changes. In testing, signing in again or opening a new chat alone did not always reload that list. 1. Use your application's MCP **Refresh** or reconnect action if it provides one. 2. Fully quit and reopen the application, then start a new conversation with LogDrop enabled. Closing only the chat or window may leave the application running. 3. For CLI sessions, exit and start a new session. 4. If the tool requires a new permission, complete [authorization again](/docs/panel/mcp/permissions#authorize-additional-permissions). Restarting cannot grant a permission you did not select. Refresh behavior depends on the application and version. In Antigravity, refresh the MCP server list after configuration changes. A tool list that looks stale does not by itself mean your LogDrop connection was revoked. ## A tool says a permission is missing [#a-tool-says-a-permission-is-missing] Read the tool's error message for the missing permission and suggested next step. Start LogDrop authentication again, select that permission and the needed project, and complete browser authorization. If the client still uses an old connection or tool list, fully quit and reopen it. If you intentionally do not want to grant that permission, leave it off and ask the assistant to stay within its current access. Reconnecting does not override your panel role. ## Sign-in completed but tools still fail [#sign-in-completed-but-tools-still-fail] Confirm that you authorized the intended project and used the intended LogDrop account. Refresh or restart the AI application. If needed, remove its old LogDrop server configuration, add it again from **Connect MCP**, and authorize a replacement connection. Revoke unused old grants in the panel after identifying them. For Codex CLI, run: ```sh codex mcp login logdrop ``` If you already have a server entry at the correct URL, adding it again is not a substitute for signing in. ## Claude opens customization but does not add LogDrop [#claude-opens-customization-but-does-not-add-logdrop] The **Connect in Claude** link opens a web setup page; it does not approve or install the connector silently. Check the selected Claude account and organization, then open the panel link again after signing in. If custom connectors are disabled for your organization, an authorized owner or administrator must make the connector available first. Your personal LogDrop sign-in cannot remove Claude's organization restrictions. See [Claude setup](/docs/panel/mcp/connect#claude). ## VS Code and Copilot setup issues [#vs-code-and-copilot-setup-issues] Some VS Code Copilot/AgentHost setups may show **Migrations** after adding a server. The migration can move a server entry from VS Code's MCP configuration into a Copilot-owned configuration. These are different clients and configuration locations; a successful migration message does not prove that the new client authenticated successfully. If LogDrop disappears from the MCP list or sign-in does nothing: 1. Check whether you are using standard **Copilot Chat in VS Code**, a **Copilot CLI/AgentHost** session, or the standalone CLI. 2. Open that client's MCP server list and check that LogDrop is configured there. 3. Use the matching setup method in [Connect your AI application](/docs/panel/mcp/connect#github-copilot-in-vs-code), then authenticate. 4. Restart the affected client if it reports that a login is already in progress but no browser appears. 5. If that client still cannot connect, use another supported client such as Cursor, Codex, or Claude while investigating its error logs. An [upstream Copilot issue](https://github.com/github/copilot-cli/issues/4662) describes AgentHost authentication discovery failures for servers whose OAuth issuer has a path component. LogDrop uses a root issuer, so that report is related context, not a confirmed explanation for every LogDrop/VS Code connection problem. Compatibility can vary by version. ## The browser does not open Cursor or VS Code [#the-browser-does-not-open-cursor-or-vs-code] The install buttons ask the browser to open a locally installed application. Check that the application is installed and review the browser's open-application prompt. If the handoff does not work, use **Manual setup** in the LogDrop connection dialog with the public server URL: ```text https://mcp.logdrop.io/mcp ``` ## A panel review link does not complete an action [#a-panel-review-link-does-not-complete-an-action] Sign in to the LogDrop panel and check access to the linked project. Review the prepared form and finish the action there. A prepared push is not sent simply by generating or opening its link, and a journey draft is not published by creating it. If a prepared link has expired or the underlying draft no longer exists, ask the assistant to prepare it again and review the new values. ## The SDK has not sent data yet [#the-sdk-has-not-sent-data-yet] SDK onboarding tools can report that no SDK data has arrived. Run the app with the integration in place and generate an event or request. Ask the assistant to check again after data has had time to arrive. A waiting status is not a reason to make an unlimited stream of polling calls. ## Sharing an issue with support [#sharing-an-issue-with-support] Include the AI application and version, the affected tool or action, the time, and the error code or message. You can include a screenshot after removing tokens, credentials, private user data, and unrelated browser content. Do not share access tokens or passwords. # Usage and limits (/docs/panel/mcp/usage) Open **Settings → MCP → Usage & limits**. The page shows usage for the merchant currently selected in the panel. [![Merchant usage showing monthly tool calls, daily records, and response data](/mcp/usage.png)](/mcp/usage.png) ## What the numbers mean [#what-the-numbers-mean] LogDrop limits how much your merchant can use MCP with three counters: one per month and two per day. | Counter | Meaning | | --- | --- | | Monthly tool calls | MCP tool calls counted toward the merchant's monthly allowance. | | Daily raw records | Raw data records returned through MCP and counted toward the daily allowance. | | Daily response data | Response data counted toward the daily allowance, shown in MiB. | The cards show usage, the applicable limit, remaining allowance, and the reset time. The allowance is shared by the merchant's users, projects, and connected AI applications. Creating another connection does not create another allowance. The displayed allowance takes the merchant's panel-seat entitlement and any approved limit changes into account. Check the values shown in your panel rather than assuming a fixed limit from an example screenshot. MCP access has no separate fee; your AI provider's own subscription and usage charges are separate. ## Request higher limits [#request-higher-limits] Ask for a higher allowance when your work regularly needs more than the current limits. A merchant administrator can select **Request higher limits**: 1. Enter the requested monthly calls, daily records, and daily response data limits. 2. Explain your use case and why the current allowance is not enough. 3. Submit the request. [![Request higher MCP limits in the LogDrop panel](/mcp/request-limits.png)](/mcp/request-limits.png) Your administrator name, email, and current usage accompany the request. Do not include passwords, tokens, or customer log content in the use case. The page shows a pending-review status while a request is waiting for review. Submitting a request does not immediately increase your limits. If you do not see the request action, check your merchant role or whether a request is already pending. ## When a limit is reached [#when-a-limit-is-reached] Use the reset information and limit message to decide whether to wait or request a higher allowance. Narrow the project, date range, or filters and ask for summaries before loading many raw records. Do not repeatedly reconnect or create connections to try to reset usage. For large log investigations, follow the download or panel links the assistant provides rather than asking it to print an entire file in the chat. # Notifications (/docs/panel/notifications) Notifications centralizes system alerts and events in the panel. Use it to track important warnings and critical signals, manage unread items, and perform bulk actions such as marking as read or deleting notifications. ## 1) Overview [#1-overview] The Notifications page is the panel's inbox: it keeps the alerts and events the panel has reported to you. Use the overview to see how many items are unread and which ones need attention first. - See **Total** notifications and **Unread** counts - Track the last **24 hours** activity (where supported) - Filter by severity (Info / Warning / Critical) - Perform bulk actions (select all, delete, mark as read) ### Screenshot: Notifications overview [#screenshot-notifications-overview] ![LogDrop Panel - Notifications Overview](/page_notifications_overview.png) ## 2) Severity levels [#2-severity-levels] Notifications are grouped by severity to help you prioritize. - **INFO** – Informational events (low urgency) - **WARNING** – Potential problems that may require attention - **CRITICAL** – High urgency issues that likely require action ### Screenshot: Severity filter [#screenshot-severity-filter] ![LogDrop Panel - Severity Filter](/page_notifications_severity_filter.png) ## 3) Filters [#3-filters] Filters limit the list to the notifications you want to see, by severity, read state, or date. Use filters to focus on what matters during incidents and release validation. - **Severity** (Info / Warning / Critical) - **Unread only** (where supported) - **Date range** (incident window) ### Screenshot: Filters panel [#screenshot-filters-panel] ![LogDrop Panel - Notifications Filters](/page_notifications_filters.png) ## 4) Bulk actions [#4-bulk-actions] You can perform actions on multiple notifications at once. Use them to clear items you have already reviewed and keep new ones visible: - **Select all** or select specific notifications - **Mark as read** to clear unread state - **Delete selected** to remove items from the list ### Screenshot: Bulk actions [#screenshot-bulk-actions] ![LogDrop Panel - Notifications Bulk Actions](/page_notifications_bulk_actions.png) > **Note** > > **Tip:** If you receive repeated CRITICAL notifications for crashes or HTTP errors, jump directly to > [Crash Reports](/docs/panel/crashes) or [HTTP Monitoring](/docs/panel/http-monitoring) to investigate root cause. # Project Selection (/docs/panel/projects) If you have access to multiple projects, you can switch between them from the left-side navigation. This page explains how project selection works and what the project cards show. ## 1) Where to select a project [#1-where-to-select-a-project] Each project has its own data and settings, and the panel shows only the selected project. Check the selection before you investigate an issue or change a setting, especially when you work with more than one app/environment. 1. Open the left-side navigation panel. 2. Click on the project name (or the projects list). 3. Select the project you want to monitor. ## 2) “All Projects” view [#2-all-projects-view] The **All Projects** view displays the full list of projects you can access. Use it to quickly switch contexts when you manage more than one app/environment. ### Screenshot: All Projects page [#screenshot-all-projects-page] ![LogDrop Panel - All Projects](/page_project_selection.png) ## 3) Understanding project cards [#3-understanding-project-cards] Each project card typically includes a quick summary so you can identify the right project at a glance. - **Project name** and identifier - **Storage usage** (used vs total) - **User count** or current active users (depending on configuration) > **Note** > > **Tip:** After selecting a project, start with [Dashboard](/docs/panel/dashboard) to get a quick health overview. # Push Notification (/docs/panel/push-notification) The Push Notification module enables you to engage your application's users by sending instant notifications, in-app modals/banners, and deep links. It supports targeted audience segmentation, visual configuration previews, and granular delivery analytics. ## Key Capabilities [#key-capabilities] Use the module to write a message, choose the platforms and the audience, check it in a live preview, and review its delivery results after you send it. - **Flexible Message Modes** – Send standard alerts, silent data payloads, deep links, or interactive in-app messages. - **Cross-Platform Routing** – Choose iOS, Android, Huawei, or several of them as targets. - **Audience Targeting** – Broadcast to all users, target a custom-attribute segment, or select single/multiple recipient IDs. - **Live Preview** – See how your push notification or in-app message looks on real devices in real time. - **Analytics & Logs** – Monitor delivery status, clicks, failures, and inspect raw request payloads. ## Documentation Sections [#documentation-sections] Start with **Send Push** to compose and send a message. Open **Messages** afterwards to check how many were delivered, clicked or failed. - [Send Push](/docs/panel/push-notification/send-push): Configure Standard push notifications, In-App Message layouts, and Deeplink payloads. - [Messages](/docs/panel/push-notification/messages): Track delivery statistics, success rates, provider breakdowns (APNS/FCM), and request payloads. # Messages (/docs/panel/push-notification/messages) The Messages page serves as the analytics dashboard for your push campaigns. It tracks total message volumes, success rates, user interactions, and provides a detailed drill-down modal for individual messages. ## 1) Performance Overview [#1-performance-overview] At the top of the dashboard, the **Total Messages** card displays the cumulative count of push notification requests processed. ## 2) Messages Analytics Table [#2-messages-analytics-table] A complete historical table listing all sent messages. Use it to compare messages and to spot those with many failures or few clicks. Each row includes the following performance counters: - **Title** – The title or text content of the sent notification. - **Type** – Categorized as `In-App` or `Standard`. - **Sent** – The number of push requests dispatched. - **Success** – The count of notifications successfully acknowledged by FCM/APNs. - **Clicked** – The count of users who tapped or clicked the notification. - **Failed** – The number of deliveries that failed due to expired tokens, network errors, or provider issues. - **Requested At** – Timestamp when the broadcast was triggered. ### Screenshot: Push Messages list [#screenshot-push-messages-list] ![LogDrop Panel - Push Messages](/pushmessages.png) --- ## 3) Message Detail Deep-Dive [#3-message-detail-deep-dive] Use the message detail when a message's counters need a closer look, for example to see where deliveries failed and what exactly was sent. Clicking the **View** icon on any message row opens a detailed overlay modal containing diagnostic information: ### Delivery & Click Rates [#delivery--click-rates] Displays calculated percentages for **Delivery Rate** (Success / Sent) and **Click Rate** (Clicked / Success) to quickly assess push campaign effectiveness. ### Platform Breakdown [#platform-breakdown] A comparative grid showing delivery counts (Success, Failed, Received, Clicked) broken down by operating system. Use it to see whether a problem affects only one platform: - **Android** (FCM routes) - **iOS** (APNs routes) ### Provider Breakdown [#provider-breakdown] A low-level status report indicating connection health and success/failure counts for each push provider. Check it when many deliveries fail at once, to see whether the failures come from one provider: - **FCM** (with status indicator like `Completed` / `Failed`) - **APNS** (with status indicator like `Completed` / `Failed`) ### Request Payload [#request-payload] An interactive code block displaying the raw JSON request payload dispatched to the LogDrop API. This is helpful for developers to debug exactly what notification styles, actions, scheme payloads, or custom data variables were sent in the request. ### Screenshot: Message Detail modal [#screenshot-message-detail-modal] ![LogDrop Panel - Push Message Detail](/pushmessagesdetail.png) # Send Push (/docs/panel/push-notification/send-push) The Send Push interface lets you compose, preview, and dispatch various types of notifications and messages to your application users. It provides a step-by-step configuration flow and a real-time live preview panel. ## Step-by-Step Configuration [#step-by-step-configuration] Every message is set up in the same order: choose the message mode, the target platforms, and the recipients. Then fill in the content for the selected mode and check the live preview before sending. ### 1) Message Mode [#1-message-mode] The message mode decides what the user receives: a notification in the system tray, a message shown inside the app, or a link that opens a specific screen. Select the type of message you wish to send: - **Standard** – A standard push notification appearing on the user's system tray. - **In-App Message** – An interactive rich modal or banner displayed inside the app. - **Deeplink** – A navigation-triggering URL that opens a specific app screen or fallback website. - **Alert vs Silent** – Toggle whether the push triggers a visible/audible system alert (`Alert`) or transmits a background data payload (`Silent`). ### 2) Platform [#2-platform] Each platform is delivered through its own push provider. A platform can receive messages only after its provider is configured in **Settings → Push Backends**. Choose the target operating systems for your push broadcast: - **iOS** – Dispatched via Apple Push Notification service (APNs). - **Android** – Dispatched via Firebase Cloud Messaging (FCM). - **Huawei** – Dispatched via Huawei Push Kit. ### 3) Recipients [#3-recipients] Recipients decide which devices get the message. You can reach every installation, a segment of devices that share custom attributes, or specific users or push tokens that you enter. Define your target audience segment: - **All Users** – Broadcasts to all registered application installations. - **Segment** – Targets registered devices by custom user attributes synchronized from the SDK. - **Single** – Targets a single user UUID or push token. - **Multiple** – Targets a comma-separated list of user UUIDs or tokens. ### Segment Targeting with Custom Attributes [#segment-targeting-with-custom-attributes] A segment is a group of devices selected by their custom user attributes, such as a plan type or a country. Use it when a message is relevant to only part of your audience. Before creating a segment, set custom user attributes through the SDK used by your app and let the device synchronize them with LogDrop: #### Android [#android] ```kotlin LogDrop.setCustomAttributes( mapOf( "plan_type" to "premium", "country" to "TR" ) ) ``` #### iOS [#ios] ```swift LogDrop.setCustomAttributes([ "plan_type": "premium", "country": "TR" ]) ``` #### Flutter [#flutter] ```dart await LogDrop.setCustomAttributes({ 'plan_type': 'premium', 'country': 'TR', }); ``` #### React Native [#react-native] ```ts LogDrop.setCustomAttributes({ plan_type: 'premium', country: 'TR', }); ``` Then configure the audience in **Push Notification → Send Push**: 1. Select the platforms that should receive the message. 2. Under **Recipients**, select **Segment**. 3. Click **Add Filter** and select a synchronized attribute key. 4. Choose an operator and enter its value when required. 5. Add more filters if needed, then choose **All match (AND)** or **Any match (OR)**. 6. Review the message and click **Send Now**. The segment operators are: - **Equals** – The attribute equals the entered value. - **Not Equals** – The attribute does not equal the entered value. - **In** – The attribute equals one of the comma-separated values. - **Exists** – The attribute key is present; no value is required. For example, `plan_type Equals premium` **AND** `country In TR, DE` targets premium devices whose country is either Turkey or Germany. > **Note** > > The Attribute list is populated from keys already synchronized by devices in the current > project. Use the same stable key names across platforms. Setup details are available in > [Android Custom User Attributes](/docs/sdk/android#11-custom-user-attributes), > [iOS Custom User Attributes](/docs/sdk/ios#11-custom-user-attributes), > [Flutter Custom User Attributes](/docs/sdk/flutter#11-custom-user-attributes), and > [React Native Custom User Attributes](/docs/sdk/react-native#11-custom-user-attributes). > **Warning** > > A segment requires at least one valid filter and supports up to **20** filters. Attribute > keys can contain only letters, numbers, underscores, or hyphens and are limited to 64 > characters. Filter values are limited to 256 characters. --- ## Message-Specific Configurations [#message-specific-configurations] The content fields change with the message mode you selected in step 1. Fill in the fields for that mode only. ### Message Mode: Standard [#message-mode-standard] A simple alert layout that appears on the user's lock screen or notification center. Use it when a title and a short text are enough for your message. - **Title** – Main heading of the notification (max 100 chars). - **Body** – Explanatory body text of the message (max 200 chars). #### Screenshot: Standard push configuration [#screenshot-standard-push-configuration] ![LogDrop Panel - Send Push Standard](/SendPush.png) ### Message Mode: In-App Message [#message-mode-in-app-message] A rich, customizable visual overlay rendered inside the active app session. Use it for a message with an image or buttons that the user sees inside the app instead of in the system tray. Your app must support in-app messages through the LogDrop SDK. - **In-App Layout** – Toggle between **Modal** (centered popup overlay) and **Banner** (top/bottom slide-in bar). - **Headline & Body** – Main header text and descriptional text displayed inside the pop-up. - **Image URL** – Path to a rich image to render inside the banner or modal. - **Toggles** – Configure whether the overlay is `Dismissible` (user can close it via a close button) or `Full Height` (takes up the entire screen). - **TTL (seconds)** – Time-to-Live; defines how long the in-app message is stored for display before expiring. - **Buttons** – Enable and label `Primary Button` and `Secondary Button` with custom click actions. #### Screenshot: In-App Message configuration [#screenshot-in-app-message-configuration] ![LogDrop Panel - Send Push In-App Message](/InAppMessage.png) ### Message Mode: Deeplink [#message-mode-deeplink] Directs users straight to a specific page or action in your application when clicked. Use it when the message should open a particular screen instead of the app's start screen. Your app must be able to handle the link you enter. - **Deeplink Mode** – Select from predefined routes or enter a custom URI scheme. - **Target URL** – The deep link URI (e.g., `myapp://home` or `https://...`). - **Fallback Target** – A backup URL (such as a website or app store link) in case the app is not installed or the deep link fails to resolve. #### Screenshot: Deeplink configuration [#screenshot-deeplink-configuration] ![LogDrop Panel - Send Push Deeplink](/deeplink.png) --- ## Live Preview & Sending [#live-preview--sending] As you configure your message, the **Live Preview** panel on the right side of the screen dynamically renders a mockup of the notification (supporting iPhone and Android screen mockups). Use it to check the text, layout and images before you send. *Once verified, click **Send Now** to initiate the push request.* # Settings (/docs/panel/settings) Settings pages let you manage user access, SDK configuration, integrations, and security controls. Use the sections below to jump directly to the configuration area you need. - [Users](/docs/panel/settings/users): Invite users, assign roles, and manage project access. - [API Key](/docs/panel/settings/api-key): Find and copy the SDK API key required for integrations. - [App Config](/docs/panel/settings/remote-config): Control SDK behavior, ignore lists, and sensitive data masking rules. - [Project Config](/docs/panel/settings/project-config): Crash alerts and integrations (Slack, Jira) per project. - [SDK Access Control](/docs/panel/settings/sdk-access-control): Block/unblock by Device UUID and IP for security and abuse prevention. - [Push Backends](/docs/panel/settings/push-backends): Configure APNS, HMS, and FCM for Fetch Logs / push capabilities. - [SMS Config](/docs/panel/settings/sms-config): Connect Twilio for journey SMS, choose a sender, and review the impact of connection changes. - [WhatsApp Config](/docs/panel/settings/whatsapp-config): Connect a WhatsApp Business account and use approved templates in Customer Journeys. - [AI connections (MCP)](/docs/panel/mcp): Connect Codex, Claude, Cursor, GitHub Copilot, Antigravity, and other compatible MCP applications. Review connections, permissions, and merchant usage. # API Key (/docs/panel/settings/api-key) This page shows the **SDK API Key** required to connect your mobile and web applications to LogDrop. You typically copy this key and paste it into your SDK initialization or configuration. ## 1) Where to find the API Key [#1-where-to-find-the-api-key] You need this key when you set up a LogDrop SDK in your app. 1. Open **Settings** from the left navigation. 2. Go to **API Key**. 3. Copy the key using the **Copy** action. ### Screenshot: API Key screen [#screenshot-api-key-screen] ![LogDrop Panel - API Key](/page_api_key.png) ## 2) How to use it (high-level) [#2-how-to-use-it-high-level] The key tells LogDrop which project receives the data your app sends. - Use the API key in your SDK setup for the correct **project/environment**. - If you manage multiple projects, ensure you copied the key from the intended project. - Treat the API key as sensitive: do not commit it to public repositories. > **Note** > > **Tip:** If you need runtime control (masking rules, ignore lists), continue with > [App Config](/docs/panel/settings/remote-config). # Project Config (/docs/panel/settings/project-config) Project Config contains project-level settings such as crash alert rules and integrations (Slack, Jira). Use this page to control when notifications are sent and how incidents are routed to your tools. For threshold-based rules across logs, HTTP errors, events, crashes, and anomalies, see [Alerts & Grafana](/docs/panel/alerting). ## 1) Crash Alerts (Email) [#1-crash-alerts-email] Crash alerts notify your team about new or recurring issues. They arrive by email, and also in Slack when you connect it below, so you learn about crash problems without checking the Crashes page. Common alert types include: - **New Issue Alert:** Checks periodically (e.g., every 2 hours) and may bundle notifications. - **Frequent Crash Alert:** Triggers when a crash exceeds a daily threshold. - **Re-opened Crash Alert:** Notifies when a previously closed issue happens again. ### Screenshot: Crash alerts configuration [#screenshot-crash-alerts-configuration] ![LogDrop Panel - Project Config Crash Alerts](/page_project_config_crash_alerts.png) ## 2) Slack Integration (Incoming Webhook) [#2-slack-integration-incoming-webhook] Slack integration posts crash alerts to a chosen channel using an **Incoming Webhook**. An Incoming Webhook is a URL that Slack creates for one channel; messages sent to that URL appear in the channel. Use it when your team follows incidents in Slack. 1. In Slack, go to **Apps** and search for **Incoming Webhooks**. 2. Create a new webhook and select the target channel. 3. Copy the generated **Webhook URL**. 4. Paste it into the panel and **Save**. ### Screenshot: Slack webhook field in panel [#screenshot-slack-webhook-field-in-panel] ![LogDrop Panel - Project Config Slack Integration](/page_project_config_slack.png) > **Note** > > **Tip:** Use a dedicated channel (e.g., `#logdrop-alerts`) and pin runbooks for faster incident response. ## 3) Jira Integration [#3-jira-integration] Jira integration can automatically create issues from crash reports, helping you track and assign work. Connect it if your team tracks bugs in Jira. The panel typically supports two connection methods: - **OAuth (recommended):** easiest for long-term maintenance - **API Token:** manual setup for token-based Jira access ### Screenshot: Jira connection settings [#screenshot-jira-connection-settings] ![LogDrop Panel - Project Config Jira Connection](/page_project_config_jira_connection.png) ## 4) Jira Automation (Project / Issue Type / Assignee) [#4-jira-automation-project--issue-type--assignee] These settings decide where LogDrop creates a Jira issue for a crash and who it is assigned to. After connecting Jira, configure how issues should be created and routed: - Select the target **Jira Project** - Choose the **Issue Type** (Bug / Task / etc.) - Optional: set assignees per platform (**Android** / **iOS**) if supported - Confirm which crash events should create tickets (e.g., new issues only) ### Screenshot: Jira automation rules [#screenshot-jira-automation-rules] ![LogDrop Panel - Project Config Jira Automation](/page_project_config_jira_automation.png) --- ## 5) Risk Config [#5-risk-config] Risk Config is the security configuration tab within Project Config. It lets you define HTTP whitelisting policies, configure automated responses to risk detections, and manage IP reputation threat rules — all with granular SDK and backend action controls. Risk Config contains three independent security modules, each with its own toggle, backend notification channels, and SDK-level enforcement actions. ### Screenshot: Risk Config overview [#screenshot-risk-config-overview] ![LogDrop Panel - Risk Config Overview](/riskconfig.png) ### 5.1) HTTP Whitelist [#51-http-whitelist] The HTTP whitelist is the list of domains and paths your app is allowed to call. Use it when your app talks to a known set of services and a request to any other destination should be treated as a risk. Define allowed HTTP destinations and configure how the system reacts when a request is made outside that list. - **Whitelist Entries** – Add trusted domains and paths (e.g., `google.com`, `httpbin.org/get`). Any request outside this list is flagged as a violation. - **Backend Actions** – Choose notification channels (Email / Slack) when a violation is detected. - **SDK Actions** – Define client-side enforcement: - **Show Popup** – Display a warning dialog to the user. - **Block App** – Prevent the app from continuing execution. - **Block Network** – Block all further outgoing network requests. - **Advanced SDK Settings** – Fine-tune with blocked request paths (e.g., `/admin/*`), blocked domains, and multi-language popup text (supports `` / `` tags). #### Screenshot: HTTP Whitelist expanded [#screenshot-http-whitelist-expanded] ![LogDrop Panel - HTTP Whitelist](/httpwhitelist.png) ### 5.2) Risk Detected [#52-risk-detected] A risk event is a suspicious signal on a device, such as bot behavior, a rooted device, emulator usage, or a device clock mismatch. Configure how the system reacts when the risk engine flags a suspicious event on a device. - **Detection Sub-Toggles** – Control which risk signals are active: **Bot Detection** and **Other Risk Types** (e.g., rooted devices, emulator usage). - **Backend Actions** – Enable Email / Slack notifications for risk events. - **Risk Policy** – Define rule-based policies the SDK evaluates: - **Priority** – Numeric priority for rule ordering (e.g., `100`). - **Match Type** – `All` (match if all events fire) or `Any` (match if any event fires). - **Event IDs** – Select which risk events trigger this rule (e.g., `DEVICE_CLOCK_MISMATCH`). - **Action IDs** – Select which actions to execute (e.g., `BLOCK_APP`). - **Popup Title / Message / Button Text** – Customize the in-app warning dialog. #### Screenshot: Risk Detected configuration [#screenshot-risk-detected-configuration] ![LogDrop Panel - Risk Detected](/RiskDetected.png) ### 5.3) IP Reputation Detected [#53-ip-reputation-detected] IP reputation rates how risky an IP address is. Use this module to warn the user, block the app, or block network access when a device connects from an IP address at a threat level you select. Configure how the system reacts when a device connects from a risky IP address (based on threat intelligence feeds). - **Action Expire Minutes** – Set the duration (in minutes) for how long SDK enforcement actions remain active (e.g., `15` minutes). - **Backend Actions** – Enable Email / Slack notifications for risky IP detections. - **Risk Policy** – Define threat-level-based rules: - **Priority** – Rule evaluation order. - **Threat Levels** – Select severity tiers (e.g., `CRITICAL`). - **Action IDs** – Actions to execute (e.g., `BLOCK_ALL_NETWORK`, `BLOCK_APP`). - **Popup Title / Message / Button Text** – Multi-language warning text displayed on the device. Multiple rules can be defined with different threat level thresholds and action combinations. #### Screenshot: IP Reputation Detected configuration [#screenshot-ip-reputation-detected-configuration] ![LogDrop Panel - IP Reputation Detected](/IpReputation.png) # Push Backends (/docs/panel/settings/push-backends) A push backend is the set of credentials LogDrop uses to send messages through a platform's push provider. Set one up for each platform you send to from Push Notification or Customer Journeys. Push Backends settings configure the push providers required for features like **Fetch Logs** (and any push-based workflows). Configure the provider(s) used by your mobile and web platforms: **APNS** (iOS), **HMS** (Huawei), and **FCM** (Android). ## 1) iOS (APNS) [#1-ios-apns] APNS (Apple Push Notification service) is the service that delivers pushes to iOS devices. For iOS, you can typically configure APNS using either **P12** or **P8**. Choose the method that matches your Apple setup and operational preference. ### 1.1 P12 configuration [#11-p12-configuration] Use this method if you have an APNs certificate file (.p12) and its password. - Upload the **.p12** certificate file - Enter the **certificate password** - Set the **Topic / Bundle ID** - Select environment: **Development** or **Production** ### Screenshot: APNS (P12) settings [#screenshot-apns-p12-settings] ![LogDrop Panel - APNS P12 Settings](/page_apns_p12.png) ### 1.2 P8 configuration [#12-p8-configuration] Use this method if you have an APNs key file (.p8). Along with the file, you enter your Team ID and the key's Key ID. - Upload the **.p8** key file - Enter **Team ID** - Enter **Key ID** - Set the **Topic / Bundle ID** - Select environment: **Development** or **Production** ### Screenshot: APNS (P8) settings [#screenshot-apns-p8-settings] ![LogDrop Panel - APNS P8 Settings](/page_apns_p8.png) ## 2) Huawei (HMS) [#2-huawei-hms] For Huawei devices, configure Huawei Mobile Services (HMS) credentials so the system can send pushes to Huawei endpoints. You need it only if your app supports Huawei devices without Google services. - **HMS App ID** - **HMS App Secret** ### Screenshot: HMS settings [#screenshot-hms-settings] ![LogDrop Panel - HMS Settings](/page_hms.png) ## 3) Android (FCM) [#3-android-fcm] FCM is the service that delivers pushes to Android devices. For Android, configure Firebase Cloud Messaging (FCM) by uploading a **Firebase Service Account JSON**. The file lets LogDrop send pushes through your Firebase project. ### 3.1 Generate the Service Account JSON [#31-generate-the-service-account-json] The file contains a private key for your Firebase project. Generate it in the Firebase project that your Android app uses for FCM. 1. Open your **Firebase** project. 2. Go to **Project Settings**. 3. Open the **Service accounts** tab. 4. Click **Generate new private key**. 5. Download the JSON and upload it to LogDrop panel. ### Screenshot: FCM upload [#screenshot-fcm-upload] ![LogDrop Panel - FCM Service Account Upload](/page_fcm_upload.png) > **Note** > > **Tip:** If Fetch Logs warns that a push backend is missing, return here and configure the provider used by your target devices. # App Config (/docs/panel/settings/remote-config) App Config lets you control SDK behavior at runtime—without releasing a new app version. Use it to enable/disable features, exclude specific URLs from logging, and mask sensitive information using regex rules. ## 1) SDK Features [#1-sdk-features] SDK features decide what the SDK collects in this project's apps. Some of them, such as crash tracking, are switched on and off here rather than in your app code. You can toggle SDK capabilities per project. Common feature toggles include: - **HTTP Logging** — capture request/response metadata and performance - **Crash Tracking** — collect and analyze crash reports ### Screenshot: SDK Features toggles [#screenshot-sdk-features-toggles] ![LogDrop Panel - App Config Features](/page_remote_config_features.png) ## 2) URL Ignore List [#2-url-ignore-list] URL Ignore List prevents specific domains or endpoints from being logged. This is useful for excluding internal services, health checks, or endpoints that should not appear in logs. > **Note** > > **Important:** Ignore List affects *logging* only. It does not block the request itself. ### Screenshot: URL Ignore List [#screenshot-url-ignore-list] ![LogDrop Panel - URL Ignore List](/page_remote_config_ignore_list.png) ## 3) Sensitive Info Filter (Regex) [#3-sensitive-info-filter-regex] A sensitive info filter is a regular expression (regex) rule that finds matching text in log data and masks it. Use regex rules to mask sensitive fields (KVKK/GDPR). Typical use cases include masking tokens, emails, phone numbers, card-like patterns, or secret headers. > **Note** > > **Safety rule:** If a regex breaks the JSON structure, the corresponding log can be rejected by the system. > Always test before saving. ### Screenshot: Sensitive Info Filter (Regex) [#screenshot-sensitive-info-filter-regex] ![LogDrop Panel - Sensitive Info Filter](/page_remote_config_regex.png) ## 4) Regex Testing Tool (required) [#4-regex-testing-tool-required] Before saving a new regex rule, you must test it with a real device context. The test applies the rule to recent logs from one device and shows the masked output, so you can catch a rule that masks the wrong text or breaks the JSON before you save it. The panel typically requires a **Device UUID** (or equivalent) for test execution. 1. Enter a **Device UUID** that has recent logs. 2. Run the test and verify masked output. 3. Only after a successful test, save the regex configuration. ### Screenshot: Regex test flow [#screenshot-regex-test-flow] ![LogDrop Panel - Regex Testing Tool](/page_remote_config_regex_test.png) ## 5) Recommended workflow (best practice) [#5-recommended-workflow-best-practice] A wrong regex can mask the wrong data or cause logs to be rejected. Roll out rules in small, tested steps. - Create one rule at a time (small changes). - Test with a device that has representative real traffic/logs. - Confirm that JSON remains valid after masking. - Roll out changes during low-traffic periods when possible. # SDK Access Control (/docs/panel/settings/sdk-access-control) SDK Access Control helps you restrict SDK usage for security and abuse prevention. You can block access by **Device UUID** and/or **IP address**, and later unblock when needed. ## 1) What you can do here [#1-what-you-can-do-here] A block stops SDK traffic from a device. You can block one device directly, or block the devices behind an IP address, and remove the block later. - **Block Device UUID** (with a reason) - **Block IP address** (with a reason) - Review blocked entries and **unblock** when appropriate ### Screenshot: SDK Access Control overview [#screenshot-sdk-access-control-overview] ![LogDrop Panel - SDK Access Control Overview](/page_sdk_access_control_overview.png) ## 2) Block by Device UUID [#2-block-by-device-uuid] Use device blocking when you need to stop SDK traffic from a specific device (e.g., abusive behavior, compromised device, test devices, or compliance requests). Copy the Device UUID from the Devices page; it is not the same as the User UUID. 1. Click **Add Block** (or equivalent action). 2. Select **Device UUID** as the block type. 3. Enter the target **Device UUID**. 4. Add a clear **reason** (recommended for auditability). 5. Save to activate the block. ### Screenshot: Add Device UUID block [#screenshot-add-device-uuid-block] ![LogDrop Panel - Block Device UUID](/page_sdk_access_control_device_block.png) ## 3) Block by IP address [#3-block-by-ip-address] IP blocking is useful when traffic from a specific IP is suspicious or abusive. The system blocks devices currently associated with that IP. > **Note** > > **Important:** Blocking an IP blocks devices *currently associated* with that IP. > New devices using the same IP later may not be automatically blocked (depending on implementation). 1. Click **Add Block**. 2. Select **IP** as the block type. 3. Enter the IP address and a reason. 4. Save to activate the block. ### Screenshot: Add IP block [#screenshot-add-ip-block] ![LogDrop Panel - Block IP](/page_sdk_access_control_ip_block.png) ## 4) Unblocking [#4-unblocking] Unblocking lets the device use the SDK again, for example when an investigation is finished or a device was blocked by mistake. Review the blocked list and remove blocks when no longer needed. - Locate the entry in the blocked list. - Use the **Unblock** action. - Depending on constraints, unblocking may be performed via **Device UUID** only. ### Screenshot: Blocked list / Unblock action [#screenshot-blocked-list--unblock-action] ![LogDrop Panel - Unblock](/page_sdk_access_control_unblock.png) > **Note** > > **Best practice:** Always include reasons for blocks and periodically review the list to avoid accidental long-term restrictions. # SMS Config (/docs/panel/settings/sms-config) *Select a screenshot to open it at full size.* ## Before connecting [#before-connecting] Use **SMS Config** in the selected project's Settings to connect your own Twilio account for journey SMS messages. You need it only if a journey in this project uses an SMS Message step. SMS must be included in the project's subscription. Review Billing if the panel shows that it is unavailable. Your sender and destination must be permitted by your Twilio account. Provider charges, trial restrictions, destination permissions, and sender approval requirements still apply to messages sent through LogDrop. ## Connect Twilio [#connect-twilio] Connecting links your Twilio account and sender to this project. You need the Account SID, the Auth Token, and a sender from your Twilio account. The panel checks the account before it connects. [![SMS Config before connecting a Twilio account](/customer-journeys/sms-config-not-connected.png)](/customer-journeys/sms-config-not-connected.png) 1. Select the correct project. 2. Open **Settings → SMS Config**. 3. Enter the **Twilio Account SID** and **Twilio Auth Token**. 4. Enter the **Sender**: a Messaging Service SID beginning with `MG`, or an approved sender on your account. 5. Click **Check account and connect**. 6. Confirm that the status becomes **Connected** and the sender is correct. The Auth Token is sensitive. Do not put it in a screenshot, SMS body, or support message. [![Connected Twilio account in SMS Config with credentials hidden](/customer-journeys/customer-journeys-twilio-connection.png)](/customer-journeys/customer-journeys-twilio-connection.png) The connection is **project-specific**. Connecting it for one project does not configure SMS automatically for every other project under the same merchant. You can configure the intended account separately in another project when needed. Next, return to the journey and configure [SMS recipient and consent fields](/docs/panel/customer-journeys/messages#configure-the-recipient-and-consent). These user attributes are still required even after the provider is connected. ## Update or disconnect a connection [#update-or-disconnect-a-connection] Update the connection when the project should use a different Twilio account, credentials, or sender. Disconnect it when the project should stop sending journey SMS. The panel shows a confirmation listing affected active SMS journeys before a connection update or disconnection. Read the affected journey names and the warning. The confirmation has a short countdown before you can acknowledge the change. Confirming the change pauses affected active journeys and ends their current active or waiting runs. This is different from manually pausing a journey, which stops new entries and new message submissions without automatically cancelling existing runs. After updating a connection: 1. Open each affected journey. 2. Review each SMS Message step. 3. If the editor reports an old connection or sender, click **Use current Twilio connection**. 4. Check the phone attribute, consent value, message, and outgoing paths. 5. Save the draft and publish the updated journey. After disconnecting, reconnect a working provider before publishing SMS journeys again. Draft or already paused journeys also need their SMS settings checked before a later publication. [![Twilio connection change confirmation with affected journeys and countdown](/customer-journeys/customer-journeys-connection-impact.png)](/customer-journeys/customer-journeys-connection-impact.png) > **Warning** > > A connection change does not recall messages already sent or already being processed. > Plan the change and review its impact before confirming it. # Users (/docs/panel/settings/users) The Users page lets you invite new users, assign roles, and control access to merchants/projects. It’s the primary place to manage who can view and operate the LogDrop Panel. ## 1) Invite a new user [#1-invite-a-new-user] An invitation sends an activation link to the person's email address. They activate the account, set a password, and can then sign in with the role and project access you choose here. 1. Open **Settings → Users**. 2. Click **Invite User** (or equivalent action). 3. Enter the user’s **Email** and choose a **Role**. 4. Assign the user to the correct **Merchant / Project** (if applicable). 5. Send the invitation. ### Screenshot: Invite user form [#screenshot-invite-user-form] ![LogDrop Panel - Invite User Form](/page_users_invite_form.png) ## 2) Invitation link expiration [#2-invitation-link-expiration] Invitation links are time-limited. If a user tries to activate after the link expires, you must send a new invitation. > **Note** > > **Note:** Invitation links expire in **24 hours**. ### Screenshot: Invitation status / expiration message [#screenshot-invitation-status--expiration-message] ![LogDrop Panel - Invitation Expiration](/page_users_invite_expiration.png) ## 3) User list & status [#3-user-list--status] The user table shows existing users, their roles, status, and actions you can take. Use it to check who has access and to follow up on invitations that are not accepted yet. Depending on configuration, you may see: - **Name** and **Email** - **Role** (permissions level) - **Status** (Invited / Active / Disabled, etc.) - Actions like **Edit**, **Resend invite**, or **Remove** ### Screenshot: Users table [#screenshot-users-table] ![LogDrop Panel - Users Table](/page_users_table.png) ## 4) Roles & access control (best practice) [#4-roles--access-control-best-practice] A role sets what a user can see and do in the panel. The project assignment sets which projects they can open. Use least-privilege: give users only the permissions they need for their job function. If a user can log in but cannot see a module or project, it’s usually due to missing role/project assignment. - Give **Admin** roles only to a small number of trusted users. - Ensure the user is assigned to the correct **Project** before troubleshooting UI visibility. - After changing roles or assignments, ask the user to **log out and log in** again. # WhatsApp Config (/docs/panel/settings/whatsapp-config) *Select the screenshot to open it at full size.* ## Before connecting [#before-connecting] WhatsApp Config connects the project to your WhatsApp Business Account through Meta. You need it only if a journey in this project uses a WhatsApp Message step. WhatsApp messages in Customer Journeys use your project's own **WhatsApp Business Account**, phone number, and Meta-approved templates. The project needs WhatsApp access in its subscription, and LogDrop's Meta connection must be ready. Your business is responsible for Meta onboarding, billing, template approval, and lawful messaging consent. ## Connect with Meta [#connect-with-meta] You connect through Meta's Embedded Signup, where you choose the business account and sender number for this project. After connecting, the page shows the approved templates you can use in journeys. [![WhatsApp Config before connecting a Meta business account](/customer-journeys/whatsapp-config-not-connected.png)](/customer-journeys/whatsapp-config-not-connected.png) 1. Select the project and open **Settings → WhatsApp Config**. 2. Click **Connect with Meta** and complete the Embedded Signup flow with the intended business account and sender number. 3. If Meta requires number registration, complete the separate six-digit security PIN step. Keep that PIN safe; LogDrop does not store it. 4. Confirm that the page shows **Connected**, the expected phone number, and the approved templates available to the project. Only **approved text templates** with a body and optional footer are selectable in a journey. Manage and submit templates through Meta, then return to LogDrop to select them. The access token is stored encrypted and is not displayed in the panel. Connections are **project-specific**. If you use separate development and production projects, connect each project independently, even when they use the same sender number. See [WhatsApp messages in Customer Journeys](/docs/panel/customer-journeys/messages#whatsapp-message) for recipient and consent settings. ## Reconnect or disconnect [#reconnect-or-disconnect] Reconnect when the project should use a different business account or sender number. Disconnect when it should stop sending WhatsApp messages from journeys. Before changing an existing connection, the panel shows the affected journeys for review. A connection change can pause affected active journeys and end their active or waiting runs. After reconnecting, inspect each WhatsApp step, select the current connection and template, save the draft, and publish it again. Disconnecting stops future WhatsApp submissions from journeys that used the connection. > **Warning** > > Messages already submitted to Meta cannot be recalled by changing or disconnecting the LogDrop connection. # Verified domains (/docs/panel/sso/domains) An identity provider can send any e-mail address, so LogDrop trusts it only for domains your organization has proven it owns. Verify your company's e-mail domains in the **Domains** tab. [![Domains tab with two verified domains](/sso/domains.png)](/sso/domains.png) ## Why verify a domain [#why-verify-a-domain] For people whose e-mail address is on a verified domain: - Their LogDrop account is **linked on their first SSO sign-in without a password**. - [JIT](/docs/panel/sso/provisioning) can add them as members on their first sign-in. - [SCIM](/docs/panel/sso/provisioning) can create and manage them. People on other domains can still sign in through SSO; they confirm their LogDrop account with its password once. ## Verify a domain [#verify-a-domain] You prove that you own a domain by adding a DNS TXT record with a token from LogDrop. 1. Enter the domain, for example `example.com`, and select **Add domain**. 2. LogDrop shows a TXT record: its name is `_logdrop-challenge.` and its value is a token for your organization. Copy both. 3. Add the TXT record at your DNS provider. 4. Select **Verify**. DNS changes can take a few minutes to be visible. The domain then shows **VERIFIED**. A domain can be verified by one organization only. ## Keep the record [#keep-the-record] Leave the TXT record in place. LogDrop checks it again about once a week, when the domain is used for a sign-in or by SCIM. If the record is gone, the verification ends, because the domain may have changed hands. A temporary DNS outage does not end it. **Remove** deletes a domain from your organization. Automatic linking, JIT and SCIM stop for addresses on that domain. # Roles from IdP groups (/docs/panel/sso/group-roles) Instead of setting roles in LogDrop one by one, map your identity provider's groups to LogDrop roles. Each row is a group, a role (built-in or your organization's own) and the projects it applies to. Find it at the bottom of the **User provisioning** tab. [![Roles from identity provider groups with two rows](/sso/group-roles.png)](/sso/group-roles.png) ## How the table works [#how-the-table-works] - **Set roles from groups at every sign-in** turns the table on. Roles are applied at every SSO sign-in, and at once when your identity provider pushes group changes over [SCIM](/docs/panel/sso/provisioning) or when you save a changed table. - **Group (name or ID):** the group as your identity provider sends it. Letter case does not matter. Microsoft Entra ID sends group object IDs by default; paste the group's **Object ID**. - **Projects:** leave empty for all projects. - **Order matters:** in each project, the first row whose group the member is in decides the role. Use the arrows to reorder rows. - **Members in none of these groups:** **Keep their access** leaves their current access (new members get the role for new members); **No access** refuses their sign-in and takes them out of the organization. - **Group attribute (optional):** leave empty in most setups. LogDrop reads the usual group attributes of Okta, Microsoft Entra ID and other providers. Fill it in only if your provider sends groups under another name. - The **owner** is never changed. ## The identity provider wins [#the-identity-provider-wins] At every single sign-on, a member's roles and projects come from their groups. A role changed in LogDrop is replaced. When you open such a member in **Team**, LogDrop shows that their roles come from your identity provider. Change their groups there instead. **Strict mode** decides what happens to permission adjustments made in LogDrop for a member whose role stays the same: | Strict mode | Extra permissions given in LogDrop | | --- | --- | | Off | Kept while the role is the same. | | On | Reset to the role's permissions at every sign-in. | > **Warning: Rows that give Admin** > > Everyone in a group mapped to **Admin** gets full control of the organization, including single sign-on settings. LogDrop shows a warning when a row gives Admin. ## Send groups from your identity provider [#send-groups-from-your-identity-provider] The table works only if your identity provider sends each member's groups to LogDrop: at sign-in, and as pushed groups if you use SCIM. You set this up in your identity provider. **How to send groups from your identity provider** has steps for Okta, Microsoft Entra ID, Google Workspace, Keycloak, OneLogin and other providers. In short: | Provider | Where | | --- | --- | | Okta | Sign On → SAML → **Group Attribute Statements**: name `groups`, filter **Matches regex** `.*`. For SCIM, use **Push Groups**. | | Microsoft Entra ID | Single sign-on → Attributes & Claims → **Add a group claim** → Groups assigned to the application. For SCIM, keep **Provision Microsoft Entra ID Groups** enabled. | | Google Workspace | SAML attribute mapping → **Group membership**, app attribute `groups`. | | Keycloak | Client scopes → dedicated scope → **Group list** mapper, attribute `groups`, Full group path off. | > **Note** > > If a user is in more than 150 groups, Microsoft Entra ID sends a link instead of the groups and LogDrop cannot read them. Assign only the groups you need to the application. # Overview (/docs/panel/sso) Single sign-on (SSO) lets your members sign in to LogDrop with your company's identity provider (IdP), such as Okta, Microsoft Entra ID, Google Workspace, Keycloak, OneLogin or any other SAML 2.0 provider. Your IdP checks who they are, so the same account rules, password policy and multi-factor authentication apply to LogDrop too. ## What you can do [#what-you-can-do] SAML sign-in is the base. The other features build on it, and you add them as you need them. | Feature | What it does | | --- | --- | | **SAML sign-in** | Members sign in through your IdP with your organization's sign-in link. | | **Require SSO** | Members must sign in through your IdP. The owner can always use their password, so a broken setup cannot lock you out. | | **Verified domains** | Prove that your company owns its e-mail domain. Needed for automatic linking, JIT and SCIM. | | **JIT (just-in-time)** | People from a verified domain become members on their first SSO sign-in, without an invitation. | | **SCIM provisioning** | Your IdP adds, updates, deactivates and removes members, and pushes group changes, without anyone signing in. | | **Roles from IdP groups** | A group → role table sets each member's role and projects from their IdP groups. | - [Set up SSO](/docs/panel/sso/setup): Choose a sign-in name, add LogDrop to your identity provider and connect it. - [Sign-in rules](/docs/panel/sso/sign-in-rules): Turn SSO on, require it, and set how often members sign in again. - [Verified domains](/docs/panel/sso/domains): Prove your e-mail domain with a DNS TXT record. - [User provisioning](/docs/panel/sso/provisioning): Add members automatically with JIT, or let your IdP manage them over SCIM. - [Roles from IdP groups](/docs/panel/sso/group-roles): Map IdP groups to LogDrop roles per project. - [Troubleshooting](/docs/panel/sso/troubleshooting): Sign-in errors and common identity provider mistakes. ## Before you start [#before-you-start] - **Who can set it up:** organization **Admins**. Single sign-on settings cannot be given to other roles, because a wrong setup can lock members out. - **Where:** **Organization → Single Sign-On** in the panel. - **Your package:** single sign-on must be included in your organization's package. If it is not, the page shows an upgrade notice. A setup you already made is kept and works again once single sign-on is included. - **Your identity provider:** you need an admin account there to create a SAML application for LogDrop. ## How members sign in [#how-members-sign-in] Members open the login page and choose **Sign in with SSO**, then enter your organization's **sign-in name**. They can also bookmark your organization's sign-in link, `https://panel.logdrop.io/auth/sso/`, which goes straight to your identity provider. [![LogDrop login page with the Sign in with SSO link](/sso/login.png)](/sso/login.png) [![Sign in with SSO page asking for the organization's sign-in name](/sso/sign-in-name.png)](/sso/sign-in-name.png) *Left: the login page. Right: the page that asks for the sign-in name.* The first time someone signs in through SSO, LogDrop links their identity to a LogDrop account: - If their e-mail address is on one of your [verified domains](/docs/panel/sso/domains), the account with that address is linked automatically. With [JIT](/docs/panel/sso/provisioning) a missing account or membership is created. - Otherwise LogDrop asks once for that LogDrop account's e-mail and password. LogDrop never links accounts only by the e-mail address an identity provider sends. > **Note: One organization per SSO session** > > A single sign-on session works only in the organization that issued it. Your other organizations stay in the organization menu; opening one of them asks for that organization's own sign-in (its SSO, or your password). ## Accounts created by SSO [#accounts-created-by-sso] Accounts that JIT or SCIM create have no LogDrop password. While every organization they belong to has single sign-on on, they sign in only through their identity provider: password sign-in and password reset do not work for them. In **Team**, these members and members linked to your identity provider show an **SSO** badge. # User provisioning (/docs/panel/sso/provisioning) The **User provisioning** tab decides who becomes a member without an invitation. Use **one** of the two: JIT adds people when they first sign in, SCIM lets your identity provider manage members itself. Both need a [verified domain](/docs/panel/sso/domains). [![User provisioning tab with JIT and SCIM side by side](/sso/provisioning.png)](/sso/provisioning.png) ## Add members automatically (JIT) [#add-members-automatically-jit] People with an e-mail address on a verified domain become members on their **first SSO sign-in**, without an invitation. JIT also works with identity providers that cannot provision over SCIM, such as Google Workspace. - **Role for new members:** given in every project. Admin cannot be given this way. If [roles from groups](/docs/panel/sso/group-roles) are on, the group table decides instead. - **Panel seat limits apply**, as for invitations. When no seat is free, the sign-in is refused with a message. - JIT is **paused while SCIM is on**, because your identity provider then adds members itself, and JIT could bring back people SCIM removed. ## SCIM provisioning [#scim-provisioning] SCIM 2.0 is a standard that identity providers use to manage users in other applications. With it, your identity provider adds, updates, deactivates and removes members. When someone is deactivated or unassigned there, they **lose access to this organization at once**. The **owner** is never removed. 1. Select **Turn on SCIM and create a token**. 2. Copy the **SCIM token** right away. It is shown only once. 3. In your identity provider, enter the **SCIM base URL** (`https://server.logdrop.io/merchant/public/scim/v2`) and the token as a bearer token. 4. Assign people (and, for roles from groups, groups) to the LogDrop application. **Set it up in your identity provider** has steps for Okta, Microsoft Entra ID, OneLogin and other SCIM 2.0 providers. Google Workspace does not provision custom SAML applications over SCIM, and Keycloak needs an extension for it; use JIT with them instead. | What your identity provider does | What happens in LogDrop | | --- | --- | | Assigns a person to LogDrop | They become a member with the role for new members (or their group roles). Seat limits apply. | | Changes their name | The name is updated in LogDrop. | | Deactivates or unassigns them | Their membership in this organization is removed at once. The account and its other organizations stay. | | Pushes groups and changes members | Roles from groups are updated at once, without a sign-in. | The card shows how many members are managed over SCIM and how many groups your identity provider pushed. > **Note: userName is the e-mail address** > > LogDrop finds members by the SCIM `userName`, which must be the person's e-mail address on a verified domain. In Okta, set **Unique identifier field for users** to `userName`. In Microsoft Entra ID, map `userName` to the user's `mail` if their user principal name is not their e-mail address. **Create a new token** replaces the token: the old one stops working at once. **Turn off SCIM** stops your identity provider from changing members; existing members stay. ### Microsoft Entra ID timing [#microsoft-entra-id-timing] Entra ID sends changes in cycles of about 40 minutes. To send a person or a group at once, use **Provision on demand**. If a removal from a group does not arrive, do not use **Restart provisioning**: its first cycle only adds members. Instead use **Provision on demand**, pick the group, choose **View all users** and select the person who was removed. # Set up SSO (/docs/panel/sso/setup) Open **Organization → Single Sign-On** and use the **Setup** tab. The wizard takes four steps: a sign-in name, the values to enter in your identity provider, your identity provider's metadata, and a test sign-in. ## 1) Choose a sign-in name [#1-choose-a-sign-in-name] The sign-in name is what members type on the **Sign in with SSO** page, and it is part of your sign-in link and of the URLs your identity provider needs. - 3–40 characters: lowercase English letters (a–z), digits and dashes. - It must be unique across LogDrop. Names used by panel pages (for example `login` or `admin`) are not allowed. - Changing it later changes your URLs, so you would have to update your identity provider too. [![Setup step 1, choosing the sign-in name](/sso/setup-name.png)](/sso/setup-name.png) ## 2) Add LogDrop to your identity provider [#2-add-logdrop-to-your-identity-provider] In your identity provider, you create a SAML application for LogDrop. It needs two LogDrop values: where to send members back after they sign in (the ACS URL) and LogDrop's identifier (the entity ID). Pick your identity provider. LogDrop shows the two values to enter under the field names your provider uses: | LogDrop value | Okta | Microsoft Entra ID | Other providers | | --- | --- | --- | --- | | `…/merchant/public/sso//acs` | Single sign-on URL | Reply URL (Assertion Consumer Service URL) | ACS URL | | `…/merchant/public/sso//metadata` | Audience URI (SP Entity ID) | Identifier (Entity ID) | SP entity ID | Copy each value with its copy button. **Setup steps in your provider** has a short checklist for Okta, Microsoft Entra ID, Google Workspace, Keycloak, OneLogin and other SAML 2.0 providers, with a link to the vendor's guide. [![Setup step 2, the values to enter in Okta](/sso/setup-add-logdrop.png)](/sso/setup-add-logdrop.png) ### What LogDrop needs from any provider [#what-logdrop-needs-from-any-provider] Whatever your provider, its SAML application must meet these requirements. Sign-ins fail if one is not met. - **Signed assertion.** Signing only the response is not enough. - **NameID format** `Email address` or `Persistent`. `Transient` is refused. In Okta, change the default `Unspecified` to `EmailAddress`. - **No assertion encryption.** - **SP-initiated sign-in** with the HTTP-Redirect binding: the sign-in starts at LogDrop. An app tile in your provider's portal works when it opens your LogDrop sign-in link. - **An e-mail address** for every user, as the NameID or as an e-mail attribute. Then assign the application to the people or groups who should sign in to LogDrop. > **Note: Microsoft Entra ID** > > Set **Sign on URL (Optional)** to your LogDrop sign-in link, so the My Apps tile starts a sign-in LogDrop accepts. Leave Relay State and Logout URL empty. One Entra application can list several identifiers and reply URLs, for example for a test and a production organization. ## 3) Connect your identity provider [#3-connect-your-identity-provider] After you create the application, your identity provider gives you its SAML metadata, which includes its entity ID, its single sign-on URL and its signing certificate. With it, LogDrop knows where to send members to sign in and can check that a response really comes from your provider. Give it to LogDrop in one of three ways: | Option | When to use it | | --- | --- | | **Metadata URL** | Your provider shows an https metadata address (Okta, Microsoft Entra ID, OneLogin, JumpCloud). LogDrop reads it once when you save. | | **Paste metadata XML** | Your provider gives the metadata as a file (for example Google Workspace or Keycloak). Paste the whole XML. | | **Enter manually** | Enter the IdP entity ID (issuer), the single sign-on URL (HTTP-Redirect) and the signing certificate (PEM). | The blue note above the options says where your provider shows its metadata. [![Setup step 3, connecting the identity provider with its metadata URL](/sso/setup-connect.png)](/sso/setup-connect.png) > **Warning: Certificate rotation** > > When your identity provider is about to change its signing certificate, add the new certificate before the change: **Enter manually** accepts more than one certificate. Otherwise sign-ins fail from the moment the provider switches. ## 4) Save and test [#4-save-and-test] Check the sign-in name and the connected identity provider, then select **Save setup**. Test the sign-in right after: open your sign-in link in a private window and sign in as a member. [![Setup step 4, saving the setup](/sso/setup-save.png)](/sso/setup-save.png) Once a test sign-in works: 1. [Verify your domain](/docs/panel/sso/domains), so members are linked without a password. 2. [Require single sign-on](/docs/panel/sso/sign-in-rules), so people turned off in your identity provider cannot keep using a LogDrop password. 3. Optionally, [add members automatically](/docs/panel/sso/provisioning) and [set roles from groups](/docs/panel/sso/group-roles). # Sign-in rules (/docs/panel/sso/sign-in-rules) The **Sign-in** tab controls how members of your organization sign in once the setup is saved. The badges at the top right show the current state: **SSO ON**, **REQUIRED** and **SCIM**. [![Sign-in tab with the sign-in rules and Remove single sign-on](/sso/sign-in-rules.png)](/sso/sign-in-rules.png) ## Sign-in rules [#sign-in-rules] | Setting | What it does | | --- | --- | | **Single sign-on is on** | Turns single sign-on off for a while without losing the setup. | | **Require single sign-on** | Members must sign in through your identity provider to open this organization. Password sign-ins are refused for them. | | **Sign in again after (hours)** | How long an SSO session lasts, from 1 to 168 hours. Members then sign in through your identity provider again. | Hover the info icon next to each setting for a short explanation. > **Warning: Test before you require it** > > Sign in once through single sign-on before you turn on **Require single sign-on**. The **owner** can always sign in with their password, so a broken setup cannot lock everyone out; these owner sign-ins are recorded in **Organization → Audit Logs**. While single sign-on is on but not required, members can still sign in with their LogDrop password. Someone turned off in your identity provider may then keep access to LogDrop. Turn on **Require single sign-on** once everyone can sign in through it, or use [SCIM](/docs/panel/sso/provisioning) so deactivated people are removed at once. ## When SSO sessions end [#when-sso-sessions-end] An SSO session keeps a member signed in to your organization after they sign in through your identity provider. When it ends, they sign in through your identity provider again. This happens: - After **Sign in again after (hours)**, or earlier if your identity provider's session ends first. - At once when you change the identity provider connection or turn single sign-on off. - When a member opens another organization. An SSO session works only in the organization that issued it. ## Remove single sign-on [#remove-single-sign-on] **Remove single sign-on** deletes the setup and every account link. Members sign in with their passwords again. Accounts that SSO created have no password; they can set one with **Forgot Password** once no organization of theirs requires single sign-on. To pause single sign-on without losing the setup, turn off **Single sign-on is on** instead. # Troubleshooting (/docs/panel/sso/troubleshooting) When a single sign-on fails, LogDrop shows a short reason. Details stay in LogDrop's logs, so ask your admin to check the setup when the message points to it. ## Sign-in messages [#sign-in-messages] | Message | What to do | | --- | --- | | Single sign-on is not available for this organization | Check the sign-in name. Single sign-on may be off, not set up, or not included in the package. | | Please confirm that you are not a robot | After several failed attempts LogDrop asks for a captcha, as on the password login page. | | The sign-in took too long or this link was already used | Start the sign-in again from LogDrop. | | The sign-in was started in another browser or tab | Start and finish the sign-in in the same browser. Blocked cookies cause this too. | | Your identity provider sent a response LogDrop could not accept | The application settings in your identity provider do not match. See below. | | This account is not a member of the organization | Ask your admin for an invitation, or turn on JIT or SCIM. | | The organization has no free panel seats | Free a seat or upgrade the package. | | None of your groups gives access to this organization | The group table uses **No access** and none of your groups matches a row. | | This LogDrop account is already linked to another identity of this organization | The account is linked to a different user in your identity provider. | ## Identity provider checks [#identity-provider-checks] Check these settings in your identity provider's SAML application when the message is *Your identity provider sent a response LogDrop could not accept*, or when a test sign-in fails. - **Assertion not signed:** turn on signing for the assertion. Signing only the response is refused. - **NameID format:** use `Email address` or `Persistent`. `Transient` is refused, and Okta's default `Unspecified` must be changed. - **Encrypted assertion:** turn assertion encryption off. - **Sign-in started from the provider's portal:** LogDrop accepts only sign-ins that start at LogDrop. Point the portal tile to your LogDrop sign-in link. - **Wrong URLs:** the Entity ID and ACS URL must match the values in **Setup**, step 2, exactly. A changed sign-in name changes them. - **Microsoft Entra ID error AADSTS700016** ("Application with identifier … was not found"): the LogDrop Entity ID is missing from **Identifier (Entity ID)** in the Entra application. Add it there. ## Provisioning checks [#provisioning-checks] - **SCIM users are not created:** their e-mail domain must be [verified](/docs/panel/sso/domains), and `userName` must be the e-mail address. - **Okta does not create users:** turn on **Create Users** under Provisioning → To App. - **A removal from an Entra group does not arrive:** see [Microsoft Entra ID timing](/docs/panel/sso/provisioning#microsoft-entra-id-timing). - **SCIM answers 403:** single sign-on is not included in your organization's package. # Threat Score (/docs/panel/threat-score) The **Threat Score** widget on Dashboard summarizes the risk scores of devices active in your project over the last 30 days. A higher number means more potentially risky activity among those devices. ## Add and read the widget [#add-and-read-the-widget] Threat Score is a Dashboard widget, so you add it from the Widget Library like any other widget. Check it to see whether risky activity among your project's devices is rising or falling over time. 1. Select the project and open **Dashboard**. 2. If **Threat Score** is not on your Dashboard, open **Widget Library** and add it. 3. Read the current score, level, and daily trend. Use the Dashboard date filter or the widget's date range to inspect the chart. The score is shown on a **0–100** scale. The current value is the latest saved daily score; the chart shows daily scores in the selected date range. Changing the chart's date range does not turn the current value into an average of that range. A missing day means no saved score for that day. | Score | Level | | --- | --- | | Below 25 | Low | | 25 to below 50 | Medium | | 50 to below 75 | High | | 75 and above | Critical | The daily project score is calculated from the average device risk score of devices active in the previous 30 days. Device risk scores reflect recent risk-event contributions and are capped at 100. The project score is calculated daily, so a newly detected event may not change the widget immediately. > **Note** > > A score of 0 can also occur when there are no active devices in the calculation window. Check the underlying device and risk-event data before treating 0 as an all-clear. This widget is separate from [Analyze](/docs/panel/analyze) binary and source-code scan reports. # Alerts and Service Levels (/docs/panel/tracing/alerts-and-slos) **Services & APM → Alerts & service levels** watches your services: alert rules open incidents when a service misbehaves, and service level objectives (SLOs) track how much of your error budget is left. Viewing needs the **View alerts** permission; creating and changing rules, SLOs and recipients needs **Manage alerts**. ## Alert rules [#alert-rules] An alert rule watches one metric of a service, such as its error rate or response time, and opens an incident when the metric crosses your threshold for long enough. Use rules for problems you want to know about while they happen. Select **New draft rule** and fill in: - **Rule basics**: a name and the service. - **Condition**: the **Metric** (**Error rate**, **Error count**, **Response time (95th percentile)**, **Response time (99th percentile)**, **Calls per minute** or **No traffic**), a threshold and the **Severity** of the incident it opens. - **Timing**: how long the condition must hold, the **Recovery threshold**, **Resolve after (minutes)** and the **Late-data allowance (minutes)** for delayed telemetry. - **Optional scope**: one endpoint or one release. Rules start as drafts; enable a rule when you want it to monitor. A breach opens an **incident**. You can **Acknowledge** it (monitoring continues), **Resolve** it by hand (a new episode opens if the condition recurs), or **Suppress** it until a time within the next 30 days, with a reason. ## Service levels [#service-levels] A service level objective (SLO) is a target for the share of good requests in a time window, for example 99.9% of requests without errors. The share that may be bad without missing the target is the error budget. Use an SLO to track how reliable a service stays over a whole window. Select **Create SLO** and choose: - **What to measure**: **Successful requests** (requests without errors) or **Fast responses** (requests that finish within your maximum response time). - The **Success target**, for example 99.9%. - The **Window type** (a moving window, or fixed periods from a chosen UTC time) and the **Window (minutes)**. - Optionally an endpoint type, an endpoint or a release. The SLO's status page shows: - **Attainment**: good calls divided by observed calls in the window. - **Error budget remaining**: 100% means none of the budget is used, 0% that it is exhausted, a negative value that it was exceeded. - **Burn rate**: how fast bad calls use the budget; 1× is the allowed rate. The **Burn policy** **Fast: 60 / 5 minutes** checks 60- and 5-minute windows, **Slow: 360 / 30 minutes** 360- and 30-minute windows. Both windows must exceed the threshold to report a breach. - The status: **Healthy**, **Target missed** or **Unknown** (not enough complete history). The evaluation cutoff trails the current minute by six minutes, so late data can arrive. Editing an SLO saves a new definition version; earlier history does not count toward the edited SLO. **Planned maintenance** excludes approved minutes from an SLO without deleting data, **Scheduled silences** pause incident transitions and notifications for a time, and **Historical SLI corrections** recalculate a short, audited interval when stored data changed. ## Notifications [#notifications] **Manage project notifications** sets the recipients for all APM alert rules and service levels of the project: email or webhook recipients, including Slack webhook URLs. Leave the list empty to turn notifications off. Changes apply to new incidents; existing incidents keep their channels. The **Channel delivery signal** shows whether the last real delivery to a channel was accepted. # Overview (/docs/panel/tracing) Once traces arrive, the panel shows each request as a trace across your app and backend services, the health of every service and endpoint (APM), how your services depend on each other, and the alerts and service levels built on them. Traces come from the [LogDrop agents](/docs/backend-tracing) in your backend services and from the [LogDrop mobile SDKs](/docs/sdk/tracing) in your apps. Tracing needs a plan that includes HTTP monitoring, with **HTTP Logging** turned on for the project. ## Where things are [#where-things-are] In the project menu, open **Monitoring → Services & APM**. Inside the APM pages, a navigation bar links: - **Services** and **Endpoints**: the service catalog and the endpoint list, with their dashboards. - **Trace Explorer**: search and open traces. - **Dependency map**: services and their calls to each other and to databases, caches, brokers and external hosts. - **Alerts & service levels**: alert rules, incidents and SLOs. - **Credentials**: the ingest keys your backend agents use. **Back to previous view** returns to the page you came from and keeps your filters and time range. For a request made by your app, open it in [HTTP Monitoring](/docs/panel/http-monitoring): its [Backend Trace](/docs/panel/tracing/trace-explorer#from-a-mobile-request-to-its-backend-trace) section shows the backend spans it caused. ## Permissions [#permissions] Each tracing page and action needs a project permission. Viewing and managing are separate permissions, so a person can read traces and alerts without being able to change ingest keys or alert rules. | Permission | Allows | |---|---| | **View backend telemetry** (`TELEMETRY_VIEW`) | Traces, APM services, infrastructure metrics and the list of ingest keys | | **Manage ingest keys** (`TELEMETRY_KEY_MANAGE`) | Create, rotate and revoke ingest keys | | **View alerts** (`ALERT_VIEW`) | Alert rules, incidents, SLOs, silences and maintenance | | **Manage alerts** (`ALERT_EDIT`) | Create and change alert rules, SLOs, silences, maintenance and notification recipients | Without the right permission, a page shows **Access unavailable**. ## In this section [#in-this-section] - [Ingest credentials](/docs/panel/tracing/ingest-credentials): Create, rotate and revoke the keys your backend agents send traces with. - [Trace Explorer](/docs/panel/tracing/trace-explorer): Search traces, read the waterfall, and follow a mobile request into the backend. - [Services and dependencies](/docs/panel/tracing/services): Service and endpoint dashboards, the dependency map, and how fresh the numbers are. - [Alerts and service levels](/docs/panel/tracing/alerts-and-slos): Alert rules, incidents, SLOs and notifications. - [Troubleshooting](/docs/panel/tracing/troubleshooting): What to check when no traces show up. # Ingest Credentials (/docs/panel/tracing/ingest-credentials) **Services & APM → Credentials** holds the ingest keys your backend agents use to send traces to LogDrop. Mobile apps do not need one: the LogDrop mobile SDKs send their spans with the project's App ID. Listing keys needs the **View backend telemetry** permission; creating, rotating and revoking them needs **Manage ingest keys**. ## Create a key [#create-a-key] Create a key before you install a backend agent: the agent sends its traces with it. Use one key per cluster or environment, so you can rotate or revoke one without touching the others. Select **Create credential** and fill in: - **Credential name**, 1 to 100 characters, for example the cluster or service the key belongs to. - **Signals**: choose **Traces** for the [LogDrop backend agents](/docs/backend-tracing). Signals cannot be changed later; issue a new key instead. The **Metrics** signal needs a plan that includes metrics. - **Expiry (optional)**, a date in the future. Without one, the key never expires. The key is shown **once** (**Shown only once**). Copy it with **Copy credential**, store it in your secret manager, then close with **I saved it — close**. It cannot be shown again. ## The list [#the-list] Each key shows its name, **Visible prefix**, status (**Active**, **Expired** or **Revoked**), **Signals**, **Created**, **Last used** and **Expires**. **Last used** is updated at most every 5 minutes, so a key in use can look a few minutes stale. A banner lists the keys that expire within 14 days. Project admins also get a panel notification and an email 14, 7 and 1 days before a key expires, if the key was used in the last 30 days. A project can have at most 20 active keys. Above that, **Create credential** answers that the project already has the maximum number of active credentials: revoke a key that is no longer used. ## Rotate and revoke [#rotate-and-revoke] Replace a key when it leaked or is about to expire, and revoke a key that is no longer used. How you replace it decides whether your agents miss traces during the change. - **Rotate** issues a replacement **and revokes the current key at once**. Every agent that still holds the old key is refused until it has the new one. Use it for a key that leaked. - To replace a key without losing traces, create a second key, roll it out, wait until the old key's **Last used** stops moving, then revoke the old key. See [Rotate the ingest key](/docs/backend-tracing/java/key-rotation). - **Revoke** stops a key immediately. It cannot be undone. # Services and Dependencies (/docs/panel/tracing/services) APM turns the spans your services send into calls, errors and latency per service and per endpoint, and draws how your services call each other and the systems they depend on. ## Services [#services] A service is a traced application, identified by the service name its spans carry. Start here to see which of your services have errors or slow responses. **Services**, the service catalog, lists every service seen in the time range (from **Last 15 minutes** up to **Last 31 days**). Filter it by environment, namespace and state (**Active** or **Idle**). For each service it shows calls, errors, error rate, endpoints, releases, runtimes, when it was first and last seen, and its last trace. **Open service** opens the service dashboard: - **Calls / minute**, **Error rate**, **Average latency**, **p50 latency**, **p95 latency** and **p99 latency**; - the **RED timeline** (rate, errors, duration) and the **Latency distribution**; - **Detected endpoints**, each with **Open endpoint**; - **Recent trace drill-down**: representative traces of the window, straight into [Trace Explorer](/docs/panel/tracing/trace-explorer); - **Release** and **Runtime** filters, to compare versions. The **Endpoint dashboard** shows the same for one endpoint. Endpoints are route templates such as `GET /orders/{id}`, not individual URLs. ## Dependency map [#dependency-map] The **Service dependency map** shows your services and their calls to each other and to databases, caches, brokers and external hosts, with errors and latency on the edges. Filter it, select a node or an edge to see its evidence, and drill into a service or endpoint to narrow a large map. *A deterministic node or edge limit was reached* means the map was cut at its limits of 300 nodes and 500 edges. ## How fresh the numbers are [#how-fresh-the-numbers-are] APM works in one-minute buckets that become final about two minutes after the minute ends. Until then you may see: | Notice | Meaning | |---|---| | **Preparing telemetry** | Stored results are still being updated. **Refresh** loads the latest | | **Some APM data is partial** | Some minutes are deferred or reached a safety limit. The numbers shown are real but may be incomplete | | **Topology still has open buckets** | Some minutes of the map are still inside the finalization window | | **Late correction** / **Late topology correction applied** | A final minute changed because late spans arrived | Bucket states in the timeline are **Open**, **Final** and **Late correction**. # Trace Explorer (/docs/panel/tracing/trace-explorer) **Trace Explorer** searches the project's traces: backend traces from the LogDrop backend agents, and mobile requests together with the backend work they caused. ## Filters [#filters] Filters narrow the search to the traces you want to look at, for example the failed or slow requests of one service. If you already have a trace ID, enter it to find that one trace. - **Time range**, at most seven days. - **Trace ID**, 32 hexadecimal characters. - **Service**, **Endpoint**, **Environment**, **Release** and **Status**. - **Errors**: **With errors** or **Without errors**. - **Minimum duration (ms)** and **Maximum duration (ms)**. **More filters** shows the less common ones; **Apply filters** runs the search. ## Results [#results] **Recent traces** lists each trace's start, duration, number of spans and errors, with these badges: | Badge | Meaning | |---|---| | **Partial** | Some spans are missing: a parent that never arrived (for example from a caller that is not traced), data still arriving, or response limits | | **Late data** | Spans arrived after the trace was first summarized | | **Multiple roots** | Separate entry points, or spans whose parents were not received | **Some new traces are still being indexed** means the newest traces appear when you search again a moment later. ## The trace waterfall [#the-trace-waterfall] A trace is made of spans. Each span is one operation: a request a service handles, or a call it makes to a database, cache, broker or another service. The waterfall lays out a trace's spans on a timeline, so you can see where a request spent its time and which call failed. Select a trace to open it. Rows show the call chain: an indented row was started by the row above it, with **Called by**, **Handled by** and **Calls** labels. Operation names such as `GET`, `SET` or `SELECT` come from the HTTP, cache and database libraries your services use. Bars compare durations. You can search spans by operation, service or span ID, and expand or collapse all rows. Select a span for its **Technical span data**: span and parent IDs, the raw operation and OpenTelemetry span kind, status, resource and span attributes, events and links (with **Open linked trace**). Spans hold only privacy-filtered data; see [What LogDrop records](/docs/backend-tracing/java/data-collected). Notices tell you when: - attributes, events, links or spans were left out by response limits; - a span's parent is missing, so the span is shown as a root; - device and server clocks differ (**Separate device and server clocks**): backend bars keep their relative timing, but their placement against the device span does not measure network time; - **Canonical spans have expired**: the trace's summary is still there, but its spans are past retention. From a trace you can jump to **View service**, **View endpoint** and **Dependency map**, and for mobile traces to the **Mobile HTTP log**, the **Device** and its **Logs**. ## Infrastructure [#infrastructure] Under the waterfall, **Infrastructure** lists the Kubernetes and host resources (cluster, node, namespace, workload, pod, container, host, process) whose metrics share an exact, stable identity with the trace's spans. It shows where the traced work ran, so you can check that pod's or host's metrics when a request was slow or failed. Names alone never match. Each resource is **Matched**, **Missing identity** (the trace names it without a stable ID), **Conflicting identity** or **Not matched**, with **Stable identity** or **Scoped identity**, and links to the infrastructure **Inventory**. Diagnostics explain gaps, for example *The trace names a pod without its pod UID.* The LogDrop agents on Kubernetes send the pod's identity this needs. The node, the workload and, without the chart's `cluster.uid`, the cluster match through that pod: the pod's kubelet metrics carry them by UID, and a pod never moves. The diagnostics say so, for example *The trace names its node without a node UID, so the node was matched through the span's stable pod*. Resources appear only when the project also receives [infrastructure metrics](/docs/infrastructure). ## From a mobile request to its backend trace [#from-a-mobile-request-to-its-backend-trace] When your app uses a LogDrop mobile SDK with tracing and your backend is traced by LogDrop, one app request and the backend work it caused form a single trace. Use this to see which backend service, query or call was behind a slow or failed request in your app. Open a request in [HTTP Monitoring](/docs/panel/http-monitoring) ([Endpoint Detail](/docs/panel/http-monitoring/endpoint-detail)). Its **Backend Trace** section shows the device span with the backend spans it caused. - **Waiting for backend spans**: the backend spans may still be arriving. The panel checks for 30 seconds; after that, use **Retry trace lookup**. - **This SDK record cannot be correlated**: the record comes from an SDK version without tracing. See [Mobile end-to-end tracing](/docs/sdk/tracing). - **Trace retention has expired**: the request is older than trace retention. The record finds its backend spans only in **its own project**: the backend must send with an ingest key of the mobile app's project. Journeys across projects are not supported. If the backend sends to another project, this section keeps waiting and then reports that no backend spans were received, and in the backend's project the trace starts with a missing parent (**Partial**). # Troubleshooting (/docs/panel/tracing/troubleshooting) ## No traces show up [#no-traces-show-up] 1. The project's plan includes HTTP monitoring, and **HTTP Logging** is on in **Settings → App Config → HTTP Monitoring**. 2. The sender is authorized: a backend agent uses a key with the **Traces** signal whose status is **Active**; an app uses the project's App ID. 3. The sender reports success: - Java, Node.js, Python, .NET, PHP or Go on Kubernetes: the pod has `logdrop.io/trace-status: injected` and the agent wrote its start line ([Java](/docs/backend-tracing/java/kubernetes#4-check-it), [Node.js](/docs/backend-tracing/nodejs/kubernetes#4-check-it), [Python](/docs/backend-tracing/python/kubernetes#4-check-it), [.NET](/docs/backend-tracing/dotnet/kubernetes#4-check-it), [PHP](/docs/backend-tracing/php/kubernetes#4-check-it), [Go](/docs/backend-tracing/go/kubernetes#4-check-it)). - Mobile app: its requests carry a `traceparent` header ([Check it](/docs/sdk/tracing#check-it)). 4. The time range covers the request, and the **Environment** filter matches (the agents' default is `production`). 5. The sender's log shows no refusal: 400 (a request outside LogDrop's [limits](/docs/backend-tracing/java/limits)), 401 (the key), 403 (tracing not enabled for the project) or 429 (rate limit). See the troubleshooting pages of the [Java agent](/docs/backend-tracing/java/troubleshooting), the [Node.js agent](/docs/backend-tracing/nodejs/troubleshooting), the [Python agent](/docs/backend-tracing/python/troubleshooting), the [.NET agent](/docs/backend-tracing/dotnet/troubleshooting), the [PHP agent](/docs/backend-tracing/php/troubleshooting) and the [Go package](/docs/backend-tracing/go/troubleshooting). ## A trace is in Trace Explorer, but the service is not in APM [#a-trace-is-in-trace-explorer-but-the-service-is-not-in-apm] APM shows a new service within about two minutes; refresh. Check the time range and the **Environment** filter. ## The Backend Trace of a mobile request keeps waiting [#the-backend-trace-of-a-mobile-request-keeps-waiting] In HTTP Monitoring, the request's **Backend Trace** section shows **Waiting for backend spans** and then reports that no backend spans were received. Possible causes: the backend sends to another LogDrop project than the app (journeys across projects are not supported), is not traced by LogDrop, or does not receive the `traceparent` header because a gateway or proxy in front of it removes it. See [Mobile end-to-end tracing](/docs/sdk/tracing#troubleshooting). # SDK Developer Guide (/docs/sdk) Welcome to the **LogDrop Developer Guide**. Here, you'll find step-by-step instructions for integrating LogDrop into your mobile and web applications across supported platforms. Each SDK sends crashes, logs, network activity, events and user data from your app to the LogDrop project whose App ID you configure. You review that data in [LogDrop Panel](/docs/panel). ## Currently supported platforms [#currently-supported-platforms] | Platform | Language | Install with | Good to know | | --- | --- | --- | --- | | [iOS](/docs/sdk/ios) | Swift | Swift Package Manager (recommended), or CocoaPods from the LogDrop-iOS git repository | Native SDK. Upload dSYM files for readable crash reports. | | [Android](/docs/sdk/android) | Kotlin / Java | Gradle, from the LogDrop Maven repository | Native SDK. The LogDrop Gradle plugin uploads ProGuard/R8 mapping files. | | [React Native](/docs/sdk/react-native) | JavaScript / TypeScript | `@log-drop/react-native` with npm or yarn | Built on the native iOS and Android SDKs, and also reports JavaScript errors. | | [Flutter](/docs/sdk/flutter) | Dart | `logdrop_flutter_sdk` in `pubspec.yaml` | Built on the native iOS and Android SDKs. The App ID is set in the native projects. | | [Web](/docs/sdk/web) | JavaScript / TypeScript | `@log-drop/web` with npm or yarn, or a script tag | Runs in the browser, on plain HTML pages or with React, Vue, Angular, Svelte and Next.js client components. | ## Each platform section includes [#each-platform-section-includes] The platform guides cover the same topics in the same order. Differences between platforms are noted under each topic below. ### SDK installation [#sdk-installation] Add the SDK with your platform's package manager. iOS uses Swift Package Manager or CocoaPods. Android adds the LogDrop Maven repository and the SDK dependency in Gradle. React Native and Web install an npm package, and Flutter adds `logdrop_flutter_sdk` to `pubspec.yaml`. ### Initialization [#initialization] Initialize LogDrop once, as early as possible when the app or page starts, so that crashes and requests made during startup are captured. You need your project's App ID from **Project Settings → App ID**: iOS, Android, React Native and Flutter use the **Mobile SDK App ID**, and the Web SDK uses the **Web App ID**. Set a base URL only for a self-hosted LogDrop. On Flutter, the App ID and base URL go into the native iOS and Android projects, because the Flutter SDK runs on the native SDKs. ### Configuration (LogDropConfig) [#configuration-logdropconfig] `LogDropConfig` holds the App ID, SDK debug logging and the optional base URL. On mobile it also takes your push callbacks and deep-link handlers. Some behavior, such as crash tracking, is not set in code: it is switched on and off from the panel under **Settings → App Config**. ### Crash tracking [#crash-tracking] After initialization, uncaught crashes are reported automatically. For readable stack traces, upload your symbol files: - **iOS:** dSYM files, with a Run Script build phase. You can also upload missing dSYM files from the panel. - **Android:** ProGuard/R8 mapping files, with the LogDrop Gradle plugin. - **React Native:** native crashes come from the native SDKs, and JavaScript errors are reported as well. Upload React Native source maps together with the dSYM files on iOS; the LogDrop Gradle plugins upload them on Android. - **Flutter:** Flutter framework errors and uncaught Dart errors are reported. Native crashes need the iOS and Android symbol uploads. - **Web:** uncaught JavaScript errors and unhandled promise rejections are reported. You can also report an error your code already handled. Minified bundles show minified file names and positions. ### Logging methods [#logging-methods] Write logs at four levels: error (`LogDrop.e`), warning (`LogDrop.w`), info (`LogDrop.i`) and debug (`LogDrop.d`). Logs are kept on the device first and uploaded later: - **Mobile:** `LogDrop.sendLogs()` schedules an upload about 60 seconds later. Further calls do not add another upload while one is waiting or running. - **Web:** logs are uploaded every 60 seconds, or sooner when enough logs are waiting. `LogDrop.sendLogs()` uploads right away, and logs left behind by a closed tab are sent on the next visit. ### LogFlow [#logflow] `LogFlow` groups the logs of one business flow or transaction, such as a checkout or a payment, under a name, an ID and optional custom attributes. Pass the flow to each log call, then filter and analyze those logs in the panel by `flowName` and `flowId`. ### Fetch Logs integration [#fetch-logs-integration] [Fetch Logs](/docs/panel/fetch-logs) in the panel asks devices to upload their logs now, for every device or for one Device UUID. The request reaches the app as a silent LogDrop push, so it works once push is integrated in the app and the push backends are configured in [Settings → Push Backends](/docs/panel/settings/push-backends). ### Push notifications [#push-notifications] LogDrop push supports alert, rich, in-app, deep-link, internal-browser and silent fetch-logs messages. Your app forwards LogDrop messages to the SDK: - **iOS:** APNs. A Notification Service Extension, sharing an App Group with the app, lets LogDrop record alert pushes while the app is not running. - **Android:** Firebase Cloud Messaging, and optionally Huawei Mobile Services. - **React Native:** React Native Firebase on Android and APNs forwarding on iOS. - **Flutter:** FlutterFire Messaging on Android, and APNs forwarding and a Notification Service Extension on iOS. - **Web:** a service worker (`logdrop-sw.js`) served over HTTPS from your own domain. You send messages from [Push Notification](/docs/panel/push-notification) in the panel or from a [Customer Journey](/docs/panel/customer-journeys). ### Deep links [#deep-links] On mobile, deep links route the user from a LogDrop push or in-app message to the right screen. The iOS guide covers custom URL schemes, universal links and the SwiftUI app lifecycle. The Android guide covers a cold start and an app that is already open (`singleTop` / `singleTask`). You can also take over routing with your own deep-link handler. ### User identification (UUID customization) [#user-identification-uuid-customization] By default, data is tied to a device identifier, or a browser identifier on the Web. Pass a stable, unique ID, such as an email address or an internal customer ID, to `LogDrop.updateUser` (iOS and Web) or `LogDrop.userUpdate` (Android, React Native and Flutter), and later logs are associated with that user in the panel. You can then find the user by **User UUID** on the Devices page. On the Web, the ID is remembered across page loads. Call `LogDrop.updateUser(null)` when the user signs out. ### Custom events [#custom-events] Track actions specific to your app with a stable event name and optional JSON-compatible properties. No setup is needed in the panel: after the first valid event arrives, the **Events** page shows it with its properties and their types. You can use events in Event Analytics funnels and as the entry or wait events of [Customer Journeys](/docs/panel/customer-journeys). The SDK rejects invalid names, invalid properties and oversized payloads before sending, and logs the reason. ### Custom user attributes [#custom-user-attributes] Attach stable profile information, such as a plan, a language or a phone number, to the current device. A device can have up to 30 attribute keys; an update that would go over the limit is rejected. Use the attributes to target a segment in [Send Push](/docs/panel/push-notification/send-push#segment-targeting-with-custom-attributes), and as the recipient and consent fields of SMS and WhatsApp steps in Customer Journeys. ### Tracing (end-to-end, into your backend) [#tracing-end-to-end-into-your-backend] The mobile SDKs add a W3C `traceparent` header to the HTTP requests they track, so a backend traced by LogDrop continues the same trace. One request then shows up from the device through your services, databases and message brokers. Tracing needs iOS SDK 2.1.11, Android SDK 2.1.11, React Native SDK 2.1.2 or Flutter SDK 3.0.7 or later, with **HTTP Logging** turned on and the app and backend sending to the same LogDrop project. On Android, also apply the LogDrop Gradle plugin. There is nothing else to configure in the app. See [End-to-end Tracing](/docs/sdk/tracing). ### Screen tracking and App Health (mobile) [#screen-tracking-and-app-health-mobile] The mobile SDKs record the screen the user is looking at as `screen_view` events, and send app start time, slow and frozen frames, freezes, memory, CPU, battery, network and HTTP timing metrics with each session for the panel's App Health page. The metrics need no code. - **iOS:** view controllers are tracked automatically; name SwiftUI screens with `.logDropScreen(_:)`. - **Android:** Activities and AndroidX Fragments are tracked automatically; call `LogDrop.trackNavigation(navController)` for Jetpack Navigation. - **React Native and Flutter:** native automatic tracking is off, because it only sees the host screen. Use `createLogDropNavigationTracker` (React Navigation) or `LogDropNavigatorObserver` (Flutter Navigator). - On every platform, `LogDrop.trackScreen(name)` sets the screen yourself. This needs iOS SDK 2.1.16, Android SDK 2.1.16, React Native SDK 2.2.0 or Flutter SDK 3.1.0 or later. These SDK versions send two new system events and add properties to existing ones. You can see them on a device's events, filter them, and use them in [Customer Journeys](/docs/panel/customer-journeys) and alert rules like other system events. Events are recorded only when event tracking is enabled for the project. | Event | Properties | When it is sent | | --- | --- | --- | | `screen_view` | `screen_name`, `screen_kind`, `previous_screen_name` (not on the first screen), `load_duration` (ms, only for a newly created screen) | The user moves to a different screen. `screen_kind` says how the screen was found: `activity`, `fragment`, `dialog` or `navigation` on Android, `view_controller` on iOS, and `manual` for `LogDrop.trackScreen` (always `manual` in Flutter and React Native). | | `app_hang` | `elapsed_duration` (ms), `hang_kind` (`hang` or `anr`), `screen_name` | The app's main thread froze: a freeze, or a long freeze (`anr`; Android: 5 s or more, iOS: 2 s or more). | | `app_open` | `start_duration` (ms) | Existing event; now carries the cold start time. | | `app_foregrounded` | `start_duration` (ms) | Existing event; now carries the warm start time. | | `app_backgrounded` | `screen_name` | Existing event; now carries the screen the user left the app from. | ### Web only: HTTP monitoring, sessions and risk signals [#web-only-http-monitoring-sessions-and-risk-signals] - **HTTP monitoring:** when HTTP logging is on, `fetch` and `XMLHttpRequest` requests are recorded with their method, URL, status, duration, headers and bodies. The App Config rules are applied in the browser, and `Authorization`, `Cookie`, `Set-Cookie` and `X-Api-Key` headers are always masked. - **Sessions:** a session lasts as long as the browser tab. A new tab, a new window or a different signed-in user starts a new session. - **Security and risk signals:** when risk detection is on, the SDK reports signals such as automation tools, headless browsers and open DevTools, and applies the risk policies set in the panel. A policy can show a warning, block the page or block network requests. ### Troubleshooting [#troubleshooting] Each guide ends with checks for the most common problems: the App ID and base URL, the symbol upload steps, custom events or attributes rejected by the SDK, and turning on verbose SDK logging during development. > **Note: Follow requests into your backend** > > The SDKs start a trace on the device that a backend traced by LogDrop continues, so one request shows up from the app into your services. See [End-to-end Tracing](/docs/sdk/tracing) and [Backend Tracing](/docs/backend-tracing). > **Note: Using an AI coding assistant?** > > Connect the read-only [Docs MCP server](/docs/panel/mcp/docs-server) so your assistant can search and read these guides. It cannot see your LogDrop projects; for that, use the [LogDrop MCP server](/docs/panel/mcp). ## Platforms [#platforms] - [iOS](/docs/sdk/ios): Swift, with Swift Package Manager or CocoaPods. dSYM upload, APNs push, deep links and tracing. - [Android](/docs/sdk/android): Kotlin and Java, with Gradle. Mapping upload, FCM and HMS push, deep links and tracing. - [React Native](/docs/sdk/react-native): JavaScript and TypeScript on the native SDKs. JavaScript errors, push, deep links and tracing. - [Flutter](/docs/sdk/flutter): Dart on the native SDKs. Flutter and Dart errors, push, deep links and tracing. - [Web](/docs/sdk/web): JavaScript and TypeScript in the browser. HTTP monitoring, web push, sessions and risk signals. # Changelog (/docs/sdk/android/changelog) {/* AGENT/MAINTAINER NOTE — this file is parsed by scripts/generate-sdk-release-feed.js and consumed by the CRM SDK release campaign sync. Required format: 1. The newest release must be the first `##` heading in this file. 2. Every release must have its own `##` heading. Put every artifact version released together in that heading using full `x.y.z` semver. Single artifact: `## Android SDK 2.2.0` Combined release: `## Android SDK 2.2.0 / Android Gradle Plugin 1.2.0` All versions in a combined heading become part of the campaign deduplication key. 3. The release date must be the first metadata line and must keep this exact shape: `Released: **YYYY-MM-DD**` 4. End the release entry with a standalone `---` before the previous release. 5. Do not add an introductory or unreleased `##` section above the newest release. Historical release `##` headings and lower-level headings inside a release are safe. 6. Keep release notes customer-facing. Describe observable features, fixes, compatibility changes, upgrade requirements, and public APIs. Do not include internal class or method names, source-code mechanics, test/reproduction setup, or implementation-only details unless users need them to take action. Changing this contract can prevent the wiki build or CRM changelog sync from working. Do not edit public/sdk-releases.json manually; it is generated during the wiki build. */} ## Android SDK 2.1.16 [#android-sdk-2116] Released: **2026-11-27** ### New Features [#new-features] #### App Health [#app-health] - The SDK sends app performance metrics with each session for the panel's new App Health page: cold and warm start time, slow and frozen frames, freezes and ANRs, memory use (average and peak) and low-memory warnings, CPU use, battery drain and battery temperature, time the device runs hot, app storage size, data used per session and time spent offline. No code changes are needed. - An ANR that ends with the app being closed is reported on the next launch. - HTTP records show how long connection setup, sending the request and waiting for the server took, the bytes sent and received, and the screen the request started on. #### Screen Tracking [#screen-tracking] - Activities and AndroidX Fragments are tracked as screens automatically. Each screen change is recorded as a `screen_view` event with the screen name, the previous screen and the screen type. - `LogDrop.trackNavigation(navController)` tracks Jetpack Navigation destinations by route or label. - `@LogDropScreen(name = "Checkout")` gives an Activity or Fragment a stable name, and `@LogDropScreen(ignore = true)` leaves it out. Fragments obfuscated by R8 are tracked only when they have a name set this way. - `LogDrop.trackScreen(name)` sets the current screen for UIs automatic tracking cannot see, such as Jetpack Compose without Navigation. - To track screens only from your code, use `LogDropConfig.Builder().automaticScreenTracking(false)`. - Guide: [Android Screen Tracking](/docs/sdk/android#12-screen-tracking) --- ## Android SDK 2.1.15 [#android-sdk-2115] Released: **2026-11-20** ### Bug Fixes [#bug-fixes] #### Logs [#logs] - Failed log uploads are retried at increasing intervals, and newer logs are no longer held back by an upload the server cannot accept. - `LogDrop.sendLogs()` and remote log requests also send the current session. - Logging continues after storage errors, and when the app starts offline the SDK completes its setup once the network is back. #### WebView [#webview] - Every callback reaches your app's `WebViewClient`, including renderer crash handling (`onRenderProcessGone`), HTTP authentication and client certificates. - WebViews without a `WebViewClient` keep their default link handling. - Streaming responses in WebView pages are not buffered. #### HTTP Whitelist [#http-whitelist] - Whitelist rules also cover URLs with special characters in the query and requests made with `HttpURLConnection`. #### End-to-end Tracing [#end-to-end-tracing] - The `traceparent` header is no longer added to requests to well-known third-party services, such as Google and Firebase, Apple, Meta, payment providers, analytics and crash reporting services. Your own backends keep receiving it. #### Android Gradle Plugin 1.1.3 [#android-gradle-plugin-113] - Apps and libraries that open local files or app resources with `URL.openConnection()` (`file:`, `jar:` and `content:` URLs) work as expected with the plugin applied. - Use plugin 1.1.3 with Android SDK 2.1.14 or later. With an older SDK the build shows a warning asking you to update the SDK. --- ## Android SDK 2.1.14 [#android-sdk-2114] Released: **2026-11-19** ### Bug Fixes [#bug-fixes-1] #### HTTP Logging [#http-logging] - HTTP Logging no longer changes how your app's requests run: requests sent before `LogDrop.init`, file and stream uploads, and streaming responses such as server-sent events behave exactly as they do without the SDK. - Apps that use `HttpsURLConnection` together with the LogDrop Gradle plugin, including custom TLS and certificate pinning setups, work as expected. - Cookie and API key headers are masked in HTTP records. - Lower memory use in apps that make many HTTP requests. #### Setup [#setup] - Apps restored from a backup or moved to a new phone start the SDK normally. --- ## Android SDK 2.1.13 [#android-sdk-2113] Released: **2026-11-18** ### Bug Fixes [#bug-fixes-2] #### Logs [#logs-1] - Logs created after a log upload are now saved on the device right away and sent with the next upload, so they are kept even if the app is closed soon after. - Sessions without logs are no longer uploaded, which makes uploads smaller and uses less of the device's upload quota. --- ## Android SDK 2.1.12 [#android-sdk-2112] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-3] #### HTTP Logging [#http-logging-1] - Requests that fail before they reach the server are recorded again: DNS failures, refused or timed-out connections, and TLS or certificate pinning errors. SDK 2.1.11 did not record them. They also appear in traces as failed requests. - Responses served from the OkHttp cache are recorded again. They do not appear in traces, because no request reached a server. - Bodies of gzip-compressed responses are captured again. SDK 2.1.11 stored them as empty. --- ## Android SDK 2.1.11 [#android-sdk-2111] Released: **2026-11-12** ### New Features [#new-features-1] #### End-to-end Tracing [#end-to-end-tracing-1] - When HTTP Logging is on for the project, the SDK adds a W3C `traceparent` header to the OkHttp requests it tracks and sends each request to LogDrop as a trace span. A backend traced by LogDrop in the same project continues the trace, so one request shows up from the device into your backend services. - Spans are sent with your existing App ID. No code change is needed; the LogDrop Gradle plugin must be applied. - Added `LogDrop.flushOtlpTracing(timeoutMillis)` to send queued spans on demand, for example at the end of an integration test. - Guide: [Android Tracing](/docs/sdk/android/tracing) ### Improvements [#improvements] #### HTTP Logging [#http-logging-2] - HTTP records are now made once per network attempt, so redirects and OkHttp's own retries appear as separate requests. - Requests that fail before a connection is made (for example DNS, connection or TLS errors) and responses served from OkHttp's cache are no longer recorded. --- ## Android SDK 2.1.10 [#android-sdk-2110] Released: **2026-10-27** ### Improvements [#improvements-1] #### Custom Event Names [#custom-event-names] - Custom event names and top-level property names must now start with an ASCII letter (`A-Z`, `a-z`) and contain only ASCII letters, digits, or underscores (`_`), up to 128 characters. For example: `purchase_completed`, `coupon_used`. - Events with invalid names are rejected instead of being trimmed or rewritten. Property values and nested JSON keys are not affected. - If your app sends custom events, check that their names follow this rule before upgrading. - Guide: [Android Custom Events](/docs/sdk/android#10-custom-events) ### Bug Fixes [#bug-fixes-4] #### Low Device Storage [#low-device-storage] - Fixed a crash that could occur when the device ran out of storage while the SDK was saving logs. - When free storage is low, the SDK now skips saving new logs and events instead of failing, and resumes automatically once storage is available again. - Limited the number of logs and events stored before the SDK receives its remote configuration, so local storage no longer grows without limit, for example while the device is offline. --- ## Android SDK 2.1.9 [#android-sdk-219] Released: **2026-10-05** ### Bug Fixes [#bug-fixes-5] #### Custom User Attributes [#custom-user-attributes] - Fixed custom attributes being shared between different users on the same device. - Attribute updates and removals now stay associated with the user they belong to, including when the user changes during synchronization. - Fixed removing attributes that were originally set on another device. #### Device Registration [#device-registration] - Fixed incomplete device registration after changing the Base URL or App ID. Device metadata is now resent for the new configuration. #### Silent Push Log Uploads [#silent-push-log-uploads] - Fixed silent push log requests finding no logs when all available logs belonged to the current session. - Log uploads now include the session active when the silent push was received. --- ## Android SDK 2.1.8 [#android-sdk-218] Released: **2026-09-16** ### Bug Fixes [#bug-fixes-6] #### Risk Warning Popup [#risk-warning-popup] - Fixed risk warning popups closing immediately after opening. --- ## Android SDK 2.1.7 [#android-sdk-217] Released: **2026-09-02** ### Improvements [#improvements-2] #### Event and Log Upload Reliability [#event-and-log-upload-reliability] - Added persistent upload identifiers for event and log batches. - Retries now reuse the same batch and upload identifier, preventing duplicate records when the server accepts an upload but the device does not receive the response. ### Bug Fixes [#bug-fixes-7] #### Risk Score Reporting [#risk-score-reporting] - Fixed risk and bot events to report the score of each individual signal instead of the combined overall score. --- ## Android SDK 2.1.6 [#android-sdk-216] Released: **2026-08-13** ### Bug Fixes [#bug-fixes-8] #### Stability Improvements [#stability-improvements] - Fixed a KotlinJsonAdapter crash that could occur in optimized builds. --- ## Android SDK 2.1.5 [#android-sdk-215] Released: **2026-08-12** ### New Features [#new-features-2] #### Custom User Attributes [#custom-user-attributes-1] - Added `LogDrop.setCustomAttributes(...)` and `LogDrop.removeCustomAttribute(...)` to send custom profile attributes with user update requests. - Added support for segment targeting and audience filtering in push notifications based on custom user attributes. - Guide: [Android Custom User Attributes](/docs/sdk/android#11-custom-user-attributes) #### HTTP Ignore Support [#http-ignore-support] - Added support for HTTP ignore rules to exclude matching HTTP network requests from SDK log collection. ### Bug Fixes [#bug-fixes-9] #### Risk Event Handling [#risk-event-handling] - Fixed an issue related to risk event processing and reporting. --- ## Android SDK 2.1.4 [#android-sdk-214] Released: **2026-07-29** ### New Features [#new-features-3] #### Custom Events [#custom-events] - Added `LogDrop.trackCustomEvent(...)` for tracking application-specific events with JSON-compatible properties. - Added support for strings, numbers, booleans, dates, null values, nested objects, and arrays. - Guide: [Android Custom Events](/docs/sdk/android#10-custom-events) --- ## Android SDK 2.1.3 [#android-sdk-213] Released: **2026-07-28** ### Improvements [#improvements-3] #### Event Tracking Configuration [#event-tracking-configuration] - Added support for the `isEventTrackingEnabled` remote configuration flag. #### Pending Event Queue [#pending-event-queue] - Added a pending event queue to preserve events captured before a session is available, including push events captured while the app is terminated. - Pending events retain their original occurrence time when they are recorded. ### Bug Fixes [#bug-fixes-10] #### Keystore Stability [#keystore-stability] - The SDK now safely disables itself instead of crashing when secure Keystore access fails. --- ## Android SDK 2.1.2 / Android Gradle Plugin 1.1.2 [#android-sdk-212--android-gradle-plugin-112] Released: **2026-07-08** ### Improvements [#improvements-4] #### Manual Deep Link Integration [#manual-deep-link-integration] - Added manual deep link tracking for app-managed link flows. - Forward the deep link `Intent` to `LogDrop.onNewIntent(this, intent)` in the activity that owns the deep link `intent-filter`. - Apply this both on cold start and in `onNewIntent`. - Guide: [Android Deep Links](/docs/sdk/android#6-deep-links) ```kotlin override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) setIntent(intent) LogDrop.onNewIntent(this, intent) } ``` #### Android Gradle Plugin [#android-gradle-plugin] - Released Android Gradle Plugin `1.1.2`. > **Warning** > > To ensure debug crashes are also tracked correctly, update the Android Gradle Plugin together with the Android SDK version. ### Bug Fixes [#bug-fixes-11] #### Debug Crash Reporting [#debug-crash-reporting] - Enabled debug crash reporting to be sent to LogDrop. # LogDrop Android SDK (/docs/sdk/android) The LogDrop Android SDK is distributed via Gradle and integrates into your app using a flexible configuration builder. --- ## 1. SDK Installation [#1-sdk-installation] The SDK is published in LogDrop's own Maven repository. Add the repository to your project, then add the SDK as a dependency of your app module. ### 1.1. Add the LogDrop Maven repository [#11-add-the-logdrop-maven-repository] Gradle can download the SDK only from a repository your project lists, so add LogDrop's repository next to `google()` and `mavenCentral()`. In your **project-level** `build.gradle` (or `settings.gradle` for Gradle 8+), make sure the LogDrop repository is included: ```groovy allprojects { repositories { google() mavenCentral() maven { url "https://artifactory.logdrop.io/repository/android-logdrop-sdk/" } } } ``` > **Note** > > If you are using the new Gradle version catalogs / `dependencyResolutionManagement`, > add the `maven { ... }` block there instead. ### 1.2. Add the SDK dependency [#12-add-the-sdk-dependency] This line adds the LogDrop SDK to the app module that builds your application. In your **app module** `build.gradle`: ```groovy dependencies { implementation "io.logdrop:sdk:2.1.16" } ``` The snippet above already shows the latest SDK version. Sync Gradle after updating the configuration. --- ## 2. Initialization [#2-initialization] Initialization starts the SDK and connects it to your LogDrop project. Initialize once, as early as possible, so that crashes and requests made during startup are captured. Replace `YOUR_APP_ID` with the **Mobile SDK App ID** from **Project Settings → App ID** in the panel. Set a base URL only if you use a self-hosted LogDrop. Initialize LogDrop in your `Application` class. ```kotlin class LogDropDemoApp : Application() { override fun onCreate() { super.onCreate() // Required for accurate crash reporting and foreground/background tracking LogDrop.registerActivityLifecycleCallback(this) val config = LogDropConfig.Builder() .appId("YOUR_APP_ID") .baseUrl("YOUR_BASE_URL") // Optional: for self-hosted LogDrop .logcatEnabled(true) .build() LogDrop.init(this, config) } } ``` > **Note** > > Crash tracking, HTTP logging, and sensitive info filters are resolved and controlled dynamically from the LogDrop backend (Settings -> App Config) rather than locally in the config builder. > **Note: End-to-end tracing** > > From SDK 2.1.11, requests the SDK tracks also carry a W3C `traceparent` header, so you can follow them into a backend traced by LogDrop. See [Tracing](/docs/sdk/android/tracing). Optionally, you can refresh the current FCM token after initialization: ```kotlin FirebaseMessaging.getInstance().token .addOnCompleteListener { task -> if (!task.isSuccessful) return@addOnCompleteListener task.result?.let { LogDrop.onNewFcmPushToken(it) } } ``` --- ## 3. LogDropConfig Overview [#3-logdropconfig-overview] `LogDropConfig` is the configuration you pass to `LogDrop.init(...)`. `appId` is required. The other fields point the SDK to a self-hosted LogDrop, turn on Logcat collection, or connect your push, deep link and in-app callbacks. Crash tracking, HTTP logging and sensitive info filters are not set here: you control them from the panel under **Settings → App Config**. Key configuration fields: - `appId: String` Your LogDrop project Application ID. **Required.** - `baseUrl: String?` Custom backend URL for on-prem / self-hosted LogDrop deployments. - `logcatEnabled: Boolean` Enables automatic collection of Logcat logs. - `pushCallbacks: LogDropPushCallbacks?` Receives notification received, opened, and silent-push callbacks. - `pushDeeplinkHandler: LogDropPushDeeplinkHandler?` Lets the application take over routing for push actions and deep links. - `inAppLifecycleCallbacks: LogDropInAppLifecycleCallbacks?` Observes in-app popup presentation and dismissal. - `internalBrowserLifecycleCallbacks: LogDropInternalBrowserLifecycleCallbacks?` Observes LogDrop's internal browser lifecycle. - `automaticScreenTracking: Boolean` Tracks Activities and AndroidX Fragments as screens automatically. Default `true`. See [Screen Tracking](#12-screen-tracking). Use the `LogDropConfig.Builder` to create the config instance in a safe and fluent way. --- ## 4. Crash Tracking (mapping upload) [#4-crash-tracking-mapping-upload] When ProGuard or R8 obfuscates a release build, it renames classes and methods, so crash stack traces from that build are unreadable. The mapping file of each build records the original names. To get human-readable stack traces, ProGuard/R8 mapping files must be uploaded to LogDrop. LogDrop provides a Gradle plugin that automates mapping uploads during release builds. [Tracing](/docs/sdk/android/tracing) also needs this plugin. ### 4.1. Add the Gradle plugin dependency [#41-add-the-gradle-plugin-dependency] The plugin is published in its own LogDrop repository. Add the repository and the plugin to the build script so Gradle can find the plugin. In your **project-level** `build.gradle`: ```groovy buildscript { repositories { google() mavenCentral() maven { url "https://artifactory.logdrop.io/repository/logdrop-gradle-plugin/" } } dependencies { classpath "io.logdrop.gradle:plugin:1.1.3" } } ``` The snippet above already shows the latest plugin version. ### 4.2. Apply the plugin in the app module [#42-apply-the-plugin-in-the-app-module] The plugin works only in modules that apply it. Apply it in your app module, next to the Android and Kotlin plugins. In your **app module** `build.gradle` (Kotlin DSL or Groovy): ```groovy plugins { id "com.android.application" id "org.jetbrains.kotlin.android" id "io.logdrop.gradle.plugin" } ``` ### 4.3. Create `logdrop-services.json` [#43-create-logdrop-servicesjson] `logdrop-services.json` tells the plugin which LogDrop project each build belongs to. It maps each application ID of your app to an App ID, so that, for example, a `.dev` variant can send to a different project than your main app. In the **app module root**, create a file named `logdrop-services.json`: ```json { "base_url": "", "projects": { "com.yourcompany.yourapp": { "app_id": "" }, "com.yourcompany.yourapp.dev": { "app_id": "" } } } ``` - Keys under `projects` are your **application IDs / namespaces**. - The plugin automatically selects the correct project and Application ID based on the current variant. ### 4.4. ProGuard / R8 configuration [#44-proguard--r8-configuration] Mapping files restore class and method names. File names and line numbers also need these two rules in your build. In your `proguard-rules.pro` (or equivalent), keep line number and source file attributes: ```text -keepattributes LineNumberTable,SourceFile -renamesourcefileattribute SourceFile ``` This ensures LogDrop can show file names and line numbers in crash reports. --- ## 5. Logging Methods [#5-logging-methods] Logging methods record your own messages at four levels: error (`e`), warning (`w`), info (`i`) and debug (`d`). Use them to record what happens in your app, so you can follow it later in the LogDrop panel. In these examples, each log also carries a `LogFlow`, described in [LogFlow](#7-logflow). ```kotlin LogDrop.e("PaymentActivity", "Payment failed", logFlow) // Error LogDrop.w("Network", "Slow network", logFlow) // Warning LogDrop.i("Auth", "User logged in", logFlow) // Info LogDrop.d("Parser", "Parsing response", logFlow) // Debug ``` Logs are stored locally on the device first. To send them to the server, call: ```kotlin LogDrop.sendLogs() ``` - Schedules a background job that runs approximately 60 seconds later. - If a job is already scheduled or running, additional calls do not create new jobs. --- ## 6. Deep Links [#6-deep-links] A deep link is a URL that opens a specific screen in your app. LogDrop pushes and in-app messages can carry one. If your app already handles deep links itself, forward the received intent to LogDrop manually, so the SDK can track the link. Call `LogDrop.onNewIntent(...)` from the activity that owns the deep link `intent-filter`. ### 6.1. Cold Start [#61-cold-start] A cold start is when the link launches your app while it is not running. The link arrives in the intent that starts the activity, so check it in `onCreate`. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (intent?.action == Intent.ACTION_VIEW && intent?.data != null) { LogDrop.onNewIntent(this, intent) } } ``` ### 6.2. App Already Open (`singleTop` / `singleTask`) [#62-app-already-open-singletop--singletask] When the activity is already running and uses the `singleTop` or `singleTask` launch mode, Android delivers the new link to `onNewIntent` instead of creating a new activity. Forward it from there. ```kotlin override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) setIntent(intent) if (intent.action == Intent.ACTION_VIEW && intent.data != null) { LogDrop.onNewIntent(this, intent) } } ``` > **Note** > > Only add this to the activity that actually receives the deep link intent. --- ## 7. LogFlow [#7-logflow] `LogFlow` lets you group related logs under a specific business flow or transaction. A flow has a name, an ID and optional custom attributes. Pass the same flow to every log of one piece of work, such as one checkout or one payment, so the panel can show those logs together. ```kotlin val flow = LogFlow( name = "SuccessTransaction", id = transactionId, customAttributes = mapOf( "amount" to "149.90", "currency" to "TRY" ) ) LogDrop.i("TransactionActivity", "Transaction completed successfully.", flow) ``` In the LogDrop panel you can filter and analyze logs by `flowName` and `flowId`. --- ## 8. Push Notification Integration [#8-push-notification-integration] LogDrop supports alert, rich, in-app, deep-link, internal-browser, and silent fetch-logs pushes. Forward messages recognized by `LogDrop.isLogDropPush(...)` to the SDK from your messaging service. With push integrated, you can send messages to your users from **Push Notification** in the panel or from a Customer Journey. **Fetch Logs** in the panel also uses a silent push to ask a device to upload its logs. The panel needs your FCM credentials, and HMS credentials if you support Huawei devices, under **Settings → Push Backends**. ### 8.1. Firebase Cloud Messaging (FCM) [#81-firebase-cloud-messaging-fcm] FCM delivers push messages and token updates to your app through a `FirebaseMessagingService`. In your service, pass LogDrop's messages and each new token to the SDK, and keep handling your other messages as before. Implement a custom `FirebaseMessagingService`: ```kotlin class LogDropDemoMessagingService : FirebaseMessagingService() { override fun onMessageReceived(remoteMessage: RemoteMessage) { super.onMessageReceived(remoteMessage) if (LogDrop.isLogDropPush(remoteMessage.data)) { LogDrop.onRemoteMessageReceived( context = this, data = remoteMessage.data, notificationTitle = remoteMessage.notification?.title, notificationBody = remoteMessage.notification?.body ) } } override fun onNewToken(token: String) { super.onNewToken(token) LogDrop.onNewFcmPushToken(token) } } ``` - `isLogDropPush(data)` Identifies messages owned by LogDrop without intercepting the application's other FCM messages. - `onRemoteMessageReceived(...)` Displays and tracks LogDrop pushes or handles silent fetch-logs commands. - `onNewFcmPushToken(token: String)` Updates the FCM token used by LogDrop. - Make sure the service is declared in your `AndroidManifest.xml`. ### 8.2. Show a Pending In-App Push [#82-show-a-pending-in-app-push] An in-app message is a modal or banner that a LogDrop push shows inside your app. LogDrop keeps in-app popups and internal-browser actions from pushes in a queue until your app asks to show them. When an activity is ready to present UI, ask LogDrop to show any queued in-app popup or internal-browser action: ```kotlin override fun onResume() { super.onResume() LogDrop.showPendingPushPopup(this) } ``` The method returns `LogDropPopupShowResult`, which can be used if the application needs to react to whether an item was shown, unavailable, or not pending. ### 8.3. Huawei Mobile Services (HMS) – optional [#83-huawei-mobile-services-hms--optional] Huawei devices without Google Mobile Services (GMS) receive pushes through HMS instead of FCM. Skip this section if your app does not support those devices. If you support Huawei devices without GMS, implement `HmsMessageService`: ```kotlin class LogDropDemoHmsMessagingService : HmsMessageService() { override fun onNewToken(token: String) { super.onNewToken(token) LogDrop.onNewHmsPushToken(token) } override fun onMessageReceived(remoteMessage: RemoteMessage) { super.onMessageReceived(remoteMessage) if (LogDrop.isLogDropPush(remoteMessage.dataOfMap)) { LogDrop.onRemoteMessageReceived( context = this, data = remoteMessage.dataOfMap ) } } } ``` - `onRemoteMessageReceived(...)` Handles LogDrop alert and silent pushes via HMS. - `onNewHmsPushToken(token: String)` Updates the HMS push token used by LogDrop. --- ## 9. User Identification (UUID Customization) [#9-user-identification-uuid-customization] By default, logs are tied to a device identifier. Set your own user ID when you want to find a user's data by that ID: you can then search for it as **User UUID** on the panel's **Devices** page. To associate logs with your own user ID: ```kotlin LogDrop.userUpdate(userId = "user-1234@example.com") ``` You can use any stable, unique identifier, such as: - Email address - Internal customer ID - Other application-specific user ID All subsequent logs will be associated with this user in the LogDrop panel. --- ## 10. Custom Events [#10-custom-events] Use custom events to track application-specific actions that are not covered by LogDrop's built-in events. Send a stable event name together with optional JSON-compatible properties. ### 10.1. Track a Custom Event [#101-track-a-custom-event] Call `trackCustomEvent` when the action happens in your app. Pass the event name and, if you need them, properties that describe this occurrence. ```kotlin LogDrop.trackCustomEvent( eventName = "purchase_completed", properties = mapOf( "coupon_code" to "SUMMER10", "amount" to 49.9, "item_count" to 2, "is_first_order" to true ) ) ``` Properties are optional. To track an event without properties: ```kotlin LogDrop.trackCustomEvent(eventName = "onboarding_completed") ``` Provide only the readable event name and properties. Event and property codes shown in the panel are managed by LogDrop. ### 10.2. Supported Property Values [#102-supported-property-values] Custom properties may contain strings, numbers, booleans, `Date` values, null, nested maps, collections, and arrays. Map keys must be strings. ```kotlin LogDrop.trackCustomEvent( eventName = "product_viewed", properties = mapOf( "sku" to "LD-100", "viewed_at" to java.util.Date(), "product" to mapOf( "name" to "LogDrop Hoodie", "price" to 79.95 ), "categories" to listOf("merch", "hoodies"), "variants" to listOf( mapOf("color" to "black", "size" to "M"), mapOf("color" to "green", "size" to "L") ), "campaign" to null ) ) ``` `Date` values are represented as UTC ISO-8601 strings in LogDrop. Nested objects and arrays remain structured values. ### 10.3. Naming and Property Types [#103-naming-and-property-types] LogDrop keeps one schema per event name, built from the properties you send. Follow these rules so the same action always lands in the same event, with the same property types: - Use stable and consistent names. For example, do not alternate between `purchase_completed` and `purchaseCompleted` for the same event. - Do not put IDs, timestamps, or other dynamic values in the event name. Add them as properties instead. - Do not use the name of a LogDrop default event for a custom event. - Keep each property's type stable. For example, always send `amount` as a number rather than sometimes sending a number and sometimes a string. - Reusing the same event name updates the same custom event schema. Changing the name creates a different custom event. > **Warning** > > If a property is later sent with a different type, LogDrop keeps the event but marks the > property as a type conflict in the panel. Type conflict tracking helps find integration > mistakes; it should not be used as a replacement for a stable event contract. ### 10.4. Limits and Validation [#104-limits-and-validation] The SDK checks each event on the device before sending it. An event that breaks any of these rules is not sent. - Event names can contain up to **128 characters**. - Property names can contain up to **128 characters**. - One event can contain up to **100 top-level properties**. - The complete properties JSON can contain up to **16 KB in UTF-8**, including property names, primitive values, nested objects, and arrays. - Event names and property names cannot be empty. - Property values must be JSON-compatible. > **Warning** > > If validation fails, the SDK rejects the complete event and writes the reason to the SDK > log. Names, properties, and payloads are never silently truncated. ### 10.5. Panel Behavior [#105-panel-behavior] No custom event definition is required before tracking. After the first valid event reaches LogDrop, the **Events** page shows the event, its generated code, observed properties, property types, and any type conflicts. You can then use the event in event details and Event Analytics funnels. --- ## 11. Custom User Attributes [#11-custom-user-attributes] Custom user attributes let you attach stable profile information to the current LogDrop device and use it for segment-based push targeting in the panel. Call the API after `LogDrop.init(...)` has completed. Customer Journeys also use these attributes as the recipient phone and consent fields of SMS and WhatsApp steps. ### 11.1. Set or Update Attributes [#111-set-or-update-attributes] Pass the attribute keys with string values. Call it whenever a profile value changes. ```kotlin LogDrop.setCustomAttributes( mapOf( "plan_type" to "premium", "country" to "TR", "preferred_language" to "tr" ) ) ``` New attributes are merged with the values already stored by the SDK. Sending an existing key replaces its value; other keys remain unchanged. Valid changes are persisted locally and synchronized with LogDrop automatically. ### 11.2. Remove an Attribute [#112-remove-an-attribute] Remove a key when its value no longer applies to the device. ```kotlin LogDrop.removeCustomAttribute("plan_type") ``` Removing a key also synchronizes the deletion with LogDrop, so the old value is no longer available for future segment targeting. ### 11.3. Limits and Validation [#113-limits-and-validation] The SDK checks each update on the device before it stores or sends it. - A device can have up to **30** custom attributes in total. - Keys must contain only letters, numbers, underscores (`_`), or hyphens (`-`). - Keys can contain up to **64 characters**. - Values must be non-blank strings containing up to **256 characters**. - If one entry in a call is invalid, the SDK rejects the complete update. - If the merged result would exceed 30 keys, the SDK keeps the previous attribute set unchanged. > **Note** > > Custom user attributes are different from `LogFlow.customAttributes`. User attributes > describe a device for audience targeting, while flow attributes add context only to the > logs recorded with that `LogFlow`. ### 11.4. Use Attributes in the Panel [#114-use-attributes-in-the-panel] After the device synchronizes, open **Push Notification → Send Push**, select **Segment** under Recipients, and build a filter with the attribute key. See [Segment Targeting with Custom Attributes](/docs/panel/push-notification/send-push#segment-targeting-with-custom-attributes). --- ## 12. Screen Tracking [#12-screen-tracking] From SDK 2.1.16, the SDK knows which screen the user is looking at. Each screen change is recorded as a `screen_view` event with the screen name (`screen_name`), the previous screen (`previous_screen_name`) and how the screen was detected (`screen_kind`). App Health uses the screen names to break performance metrics down by screen, and HTTP records show the screen a request started on. > **Note: App Health metrics** > > The SDK also sends app start time, slow and frozen frames, freezes and ANRs, memory, CPU, battery, > network and HTTP timing metrics with each session for the panel's App Health page. They need no code. ### 12.1. Automatic Tracking [#121-automatic-tracking] Activities and AndroidX Fragments are tracked automatically, under their class name. A Fragment shown with its Activity is tracked instead of the Activity. Give a screen a stable name, or leave it out, with the `@LogDropScreen` annotation: ```kotlin @LogDropScreen(name = "Checkout") class CheckoutFragment : Fragment() @LogDropScreen(ignore = true) class DebugMenuActivity : AppCompatActivity() ``` > **Warning** > > R8 renames classes in release builds. Fragments whose class name is obfuscated are not tracked > unless they have `@LogDropScreen(name = ...)`, so name the Fragments you want to see in release builds. ### 12.2. Jetpack Navigation [#122-jetpack-navigation] Call `trackNavigation` once for each `NavController`, for example right after you create it. Destinations are then tracked by route template (for example `product/{id}`) or label, and the hosting Activity and its Fragments are no longer tracked separately. ```kotlin import io.logdrop.sdk.trackNavigation LogDrop.trackNavigation(navController) ``` From Java, call `LogDropNavigation.trackNavigation(LogDrop.INSTANCE, navController)`. ### 12.3. Manual Screens [#123-manual-screens] For UIs automatic tracking cannot see, such as Jetpack Compose without Navigation, set the screen yourself. A `screen_view` is recorded when the name differs from the current screen. ```kotlin LogDrop.trackScreen("ProductDetail") ``` - Keep screen names stable and free of user data: `ProductDetail`, not the product's name. - Names longer than 100 characters are cut; blank names are ignored. To name screens only from your code, turn automatic tracking off: ```kotlin val config = LogDropConfig.Builder() .appId("YOUR_APP_ID") .automaticScreenTracking(false) .build() ``` --- ## 13. Troubleshooting [#13-troubleshooting] If data does not reach LogDrop, crash reports stay unreadable, pushes do not arrive, or events and attributes are missing, check these common causes first. - Verify that the `logdrop-services.json` file exists in the app module and that its `projects` keys match your application IDs. - Make sure the LogDrop Gradle plugin is applied and the repository URL is correct. - Confirm that mapping files are being uploaded for release builds (check the Gradle build output). - Ensure that `LogDrop.registerActivityLifecycleCallback(this)` is called before `LogDrop.init(...)`. - Check that your FCM/HMS messaging services are correctly registered in `AndroidManifest.xml`. - Confirm that custom event names do not match LogDrop default event names. - Check SDK logs when a custom event is missing; invalid names, properties, or oversized payloads are rejected locally. - Check SDK logs when custom user attributes are missing; invalid updates and updates exceeding 30 keys are rejected locally. - In development, enable verbose logging with: ```kotlin val config = LogDropConfig.Builder() .appId("YOUR_APP_ID") .logcatEnabled(true) // ... .build() ``` # Tracing (/docs/sdk/android/tracing) The Android SDK adds a W3C `traceparent` header to every OkHttp request it tracks and sends each request as one client span, so the request and the backend spans it causes form one trace in LogDrop. Nothing changes in your init code. Rules that all LogDrop mobile SDKs share (authentication, which requests are traced, delivery and limits) are on [End-to-end Tracing](/docs/sdk/tracing). ## 1. Use SDK 2.1.11 or later with the LogDrop Gradle plugin [#1-use-sdk-2111-or-later-with-the-logdrop-gradle-plugin] Tracing is part of the Android SDK from version 2.1.11. Earlier versions do not trace requests. On Android, tracing also needs the LogDrop Gradle plugin, described below. ```groovy title="app/build.gradle" plugins { id "io.logdrop.gradle.plugin" } dependencies { implementation "io.logdrop:sdk:2.1.16" } ``` Tracing needs the **LogDrop Gradle plugin** (`io.logdrop.gradle:plugin:1.1.3`). The plugin adds LogDrop's interceptor to every `OkHttpClient` your app builds, including those inside Retrofit, image loaders and other libraries; without it, no OkHttp client is traced. Its setup, including the repository and `logdrop-services.json`, is in [Crash Tracking (mapping upload)](/docs/sdk/android#4-crash-tracking-mapping-upload). Apps that already upload mappings have it. ## 2. Initialize as usual [#2-initialize-as-usual] Tracing needs no extra code. The usual initialization below is enough. ```kotlin class App : Application() { override fun onCreate() { super.onCreate() LogDrop.registerActivityLifecycleCallback(this) // on the main thread val config = LogDropConfig.Builder() .appId("YOUR_APP_ID") .baseUrl("YOUR_BASE_URL") // optional: self-hosted LogDrop .build() LogDrop.init(this, config) } } ``` The App ID is all the SDK needs: it sends spans to `/v1/traces` (by default `https://server.logdrop.io/v1/traces`) with the header `x-logdrop-app-id`. Turn on **HTTP Logging** for the project in the panel; tracing starts as soon as the SDK has LogDrop's confirmed settings. `service.name` is your package name, and the service version is your app's version. Your backend must send its traces to the **same LogDrop project** as this app, with an ingest key created in the app's project ([why](/docs/sdk/tracing#what-you-need)). ## What is traced [#what-is-traced] The SDK traces only OkHttp requests that pass through LogDrop's interceptor. This section lists which Android requests get a `traceparent` header and a span. - Requests made with OkHttp, directly or through a library that builds an `OkHttpClient` (for example Retrofit). `HttpURLConnection`, Cronet, other HTTP engines and WebViews are not traced. - Each attempt OkHttp makes is its own span in the same trace: redirects and OkHttp's own retries get a new span ID each and keep the trace ID. - The app configuration's **Ignored domains** stop tracing. On Android an entry matches when it appears anywhere in the request URL. **Ignored host and path rules** do not stop tracing: they only skip the HTTP records of requests that are not traced. - A redirect keeps the first request's decision. - The SDK sees a request once OkHttp has a connection. Requests that fail before that (DNS, connection or TLS errors) and responses served from OkHttp's cache get no span and no HTTP record. The other rules are in [Which requests are traced](/docs/sdk/tracing#which-requests-are-traced). ## Delivery [#delivery] The SDK does not send a span the moment a request ends. It queues spans on the device and sends them in batches, so spans recorded offline are sent later. You do not need to do anything; this section explains the timing and limits on Android. Spans are kept in the SDK's encrypted database queue (AES-GCM with an Android Keystore key, at most 1,000 spans). The first queued span schedules a one-time WorkManager job that waits for the network and about 15 seconds, then sends batches of at most 50 spans and about 48 KiB, split so that one request never holds spans that start in more than 32 different minutes. A 400 answer drops the request. 408, 425, 429, 5xx and no answer are retried by WorkManager with exponential backoff from 10 seconds, at most 3 attempts per span in all, always with the identical request. Spans older than about 7 days or more than 5 minutes ahead of the device clock are dropped before their first send. ## Send queued spans now (optional) [#send-queued-spans-now-optional] The SDK sends spans on its own. Call `flushOtlpTracing` only where you need the queued spans sent right away, for example at the end of an integration test or before the user signs out. ```kotlin // Blocks the calling thread for at most the timeout (1 to 5,000 ms, default 2,000): call it off the main thread. val delivered: Boolean = LogDrop.flushOtlpTracing(timeoutMillis = 2_000) ``` - `true` means the queue is empty and no span was lost since the previous flush. It is also `true` when HTTP Logging is off and the queue was cleared, so it does not tell you whether tracing is on. - A flush sends only spans that were never attempted. While a batch waits for its retry, WorkManager resends it on its own schedule and the flush answers `false`. - A timeout outside 1 to 5,000 ms throws `IllegalArgumentException`. ## Changing the App ID [#changing-the-app-id] This applies only if your app switches to another LogDrop project at runtime. The SDK makes sure no span is sent with the wrong project's App ID. `LogDrop.setAppId(newAppId)` drops the spans queued for the previous App ID; a request already on its way finishes. The SDK adds no `traceparent` until it has the new project's settings, then sends later spans with the new App ID only. ## Upgrading from 2.1.10 [#upgrading-from-2110] Read this if you update an app from SDK 2.1.10. Besides adding tracing, 2.1.11 changes which HTTP records the SDK makes. - No code change is needed: the SDK migrates its database and starts exporting once HTTP Logging is on. The first launch after the upgrade behaves like a first launch: requests sent before the SDK has the project's settings carry no header. - HTTP records are now made once per network attempt, so redirects and OkHttp's own retries appear as separate requests. Requests that fail before a connection is made, and responses served from OkHttp's cache, are no longer recorded. - Disabling the SDK or HTTP Logging stops the export and clears the queued spans. ## Check it [#check-it] After setup, make one test request to confirm that the device span and the backend spans show up in the same trace. Follow [Check it](/docs/sdk/tracing#check-it). To see the header itself, use a proxy such as Charles, Proxyman or mitmproxy: the request carries `traceparent: 00---01`, and the same trace ID is in Trace Explorer under your package name. In-app HTTP inspectors that run as OkHttp interceptors, such as Chucker, run before LogDrop's interceptor and do not show the header. ## Known limits [#known-limits] On Android, some requests are traced differently from what you might expect. Check these cases when a device span is missing or a request starts a new trace. - The device clock must not run more than 5 minutes ahead of LogDrop's; otherwise the request is refused and its spans are lost. - Requests your app retries itself start a new trace. - A request that waits for its retry is resent unchanged, even if one of its spans has meanwhile aged past the 7-day window; LogDrop then refuses the whole request. This needs a device that stays offline for about a week with a retry pending. # Changelog (/docs/sdk/flutter/changelog) {/* AGENT/MAINTAINER NOTE — this file is parsed by scripts/generate-sdk-release-feed.js and consumed by the CRM SDK release campaign sync. Required format: 1. The newest release must be the first `##` heading in this file. 2. Every release must have its own `##` heading with a full `x.y.z` semver. Example: `## Flutter SDK 3.1.0`. 3. The release date must be the first metadata line and must keep this exact shape: `Released: **YYYY-MM-DD**` 4. End the release entry with a standalone `---` before the previous release. 5. Do not add an introductory or unreleased `##` section above the newest release. Historical release `##` headings and lower-level headings inside a release are safe. 6. Keep release notes customer-facing. Describe observable features, fixes, compatibility changes, upgrade requirements, and public APIs. Do not include internal class or method names, source-code mechanics, test/reproduction setup, or implementation-only details unless users need them to take action. Changing this contract can prevent the wiki build or CRM changelog sync from working. Do not edit public/sdk-releases.json manually; it is generated during the wiki build. */} ## Flutter SDK 3.1.0 [#flutter-sdk-310] Released: **2026-11-27** ### Compatibility [#compatibility] - iOS: the minimum iOS version is now 15.0. Set your app's iOS deployment target to 15.0 or later before updating. ### New Features [#new-features] - Screen tracking: `LogDropNavigatorObserver` tracks named page routes as screens, with an optional `nameExtractor` to map route names to stable screen names. `LogDrop.trackScreen(name)` sets the screen for tabs and other UIs that are not routes. - `LogDropFlutter.initLogDrop` (Android) and `LogDropFlutter.initialize` (iOS) take `automaticScreenTracking`. It is off by default, because native tracking only sees the Flutter host screen; turn it on only if your app also shows its own native screens. - App Health: the native SDKs send app start time, slow and frozen frames, freezes, memory, CPU, battery, network and HTTP timing metrics with each session for the panel's new App Health page. No code changes are needed. - Native LogDrop Android SDK 2.1.16 and iOS SDK 2.1.16. - Guide: [Flutter Screen Tracking](/docs/sdk/flutter#12-screen-tracking) --- ## Flutter SDK 3.0.16 [#flutter-sdk-3016] Released: **2026-11-25** ### Bug Fixes [#bug-fixes] - iOS: HTTP Logging is stable on iOS 16 and earlier. Recommended update for apps that support these iOS versions. - Native LogDrop Android SDK 2.1.15 and iOS SDK 2.1.15. --- ## Flutter SDK 3.0.15 [#flutter-sdk-3015] Released: **2026-11-20** ### Improvements [#improvements] - iOS with CocoaPods: the plugin includes the LogDrop iOS SDK, so `pod install` works without CocoaPods trunk and without Podfile changes. CocoaPods trunk becomes read-only on December 2, 2026. If your `ios/Podfile` has a `pod 'LogDrop'` line in the `Runner` target, remove it. - Notification Service Extension with CocoaPods: add `pod 'LogDrop', :path => '.symlinks/plugins/logdrop_flutter_sdk/ios/ios-sdk'` to the extension target, replacing an earlier `pod 'LogDrop'` line there once. The extension then always uses the plugin's version. - Apps using Swift Package Manager need no change. Native LogDrop Android SDK 2.1.15 and iOS SDK 2.1.14. --- ## Flutter SDK 3.0.13 [#flutter-sdk-3013] Released: **2026-11-20** ### Improvements [#improvements-1] - Notification Service Extension with Swift Package Manager: add the LogDrop-iOS package with **Up to Next Major Version** from 2.1.0, so the extension always uses the same version as your app. ### Bug Fixes [#bug-fixes-1] - HTTP capture keeps large request and response bodies short and no longer holds uploads or downloads in memory, so upload progress is reported correctly. - iOS: `onNewFcmPushToken` and `onNewHmsPushToken` can be called on iOS. - iOS: log tags are kept. - Native LogDrop Android SDK 2.1.15 and iOS SDK 2.1.14. Recommended update. --- ## Flutter SDK 3.0.12 [#flutter-sdk-3012] Released: **2026-11-19** ### New Features [#new-features-1] - iOS: Swift Package Manager support. CocoaPods keeps working. ### Bug Fixes [#bug-fixes-2] - Your app's own Flutter error handlers, such as Firebase Crashlytics, keep receiving errors alongside LogDrop. - Cookie and API key headers are masked in HTTP records. - Native LogDrop Android SDK 2.1.14 and iOS SDK 2.1.13. Recommended update. --- ## Flutter SDK 3.0.11 [#flutter-sdk-3011] Released: **2026-11-18** ### Bug Fixes [#bug-fixes-3] - Android: native LogDrop Android SDK 2.1.13, with more reliable log storage after uploads and smaller uploads. iOS stays on native SDK 2.1.12. --- ## Flutter SDK 3.0.10 [#flutter-sdk-3010] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-4] - iOS: native LogDrop iOS SDK 2.1.12. With HTTP Logging on, repeated requests for cacheable responses made by native iOS code, such as plugins, are served from the cache again instead of going to the network, and memory used by finished requests is released. Requests made from Dart are not affected. Android stays on native SDK 2.1.12. --- ## Flutter SDK 3.0.9 [#flutter-sdk-309] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-5] - Android: native LogDrop Android SDK 2.1.12. OkHttp requests made by native Android code, such as plugins, are recorded again when they fail before they reach the server or are served from the OkHttp cache. Bodies of gzip-compressed responses are captured again. Requests made from Dart are not affected. --- ## Flutter SDK 3.0.8 [#flutter-sdk-308] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-6] - Android: apps no longer need the `logDropUsername` and `logDropPassword` Gradle properties. Without them, Android builds stopped during Gradle configuration with `Could not get unknown property 'logDropUsername'`. Update to 3.0.8; no other change is needed. --- ## Flutter SDK 3.0.7 [#flutter-sdk-307] Released: **2026-11-12** ### New Features [#new-features-2] #### End-to-end Tracing [#end-to-end-tracing] - W3C `traceparent` propagation for requests made with `dart:io`, `package:http` and Dio, with span export through the native LogDrop SDKs. - Added `LogDrop.flushOtlpTracing(timeout:)` to send queued spans on demand. - Guide: [Flutter Tracing](/docs/sdk/flutter/tracing) ### Improvements [#improvements-2] #### Native SDK Updates [#native-sdk-updates] - Updated the Android SDK to `2.1.11`. See the [Android SDK 2.1.11 changelog](/docs/sdk/android/changelog#android-sdk-2111). - Updated the iOS SDK to `2.1.11`. See the [iOS SDK 2.1.11 changelog](/docs/sdk/ios/changelog#2111). --- ## Flutter SDK 3.0.6 [#flutter-sdk-306] Released: **2026-10-27** ### Improvements [#improvements-3] #### Native SDK Updates [#native-sdk-updates-1] - Updated the Android SDK to `2.1.10`. See the [Android SDK 2.1.10 changelog](/docs/sdk/android/changelog#android-sdk-2110). - Updated the iOS SDK to `2.1.10`. See the [iOS SDK 2.1.10 changelog](/docs/sdk/ios/changelog#2110). - Custom event and property names passed to `LogDrop.trackCustomEvent(...)` must now follow the native SDK naming rules. Events with invalid names are rejected. --- ## Flutter SDK 3.0.5 [#flutter-sdk-305] Released: **2026-10-07** ### Improvements [#improvements-4] #### Native SDK Updates [#native-sdk-updates-2] - Updated the Android SDK to `2.1.9`. See the [Android SDK 2.1.9 changelog](/docs/sdk/android/changelog#android-sdk-219). - Updated the iOS SDK to `2.1.9`. See the [iOS SDK 2.1.9 changelog](/docs/sdk/ios/changelog#219). --- ## Flutter SDK 3.0.4 [#flutter-sdk-304] Released: **2026-09-16** ### New Features [#new-features-3] #### Custom Events [#custom-events] - Added `LogDrop.trackCustomEvent(...)` for tracking application-specific events with optional JSON-compatible properties. - Added support for strings, numbers, booleans, null values, nested maps, and lists. - Guide: [Flutter Custom Events](/docs/sdk/flutter#10-custom-events) ### Improvements [#improvements-5] #### Native SDK Updates [#native-sdk-updates-3] - Updated the Android SDK to `2.1.8`. See the [Android SDK 2.1.8 changelog](/docs/sdk/android/changelog#android-sdk-218). - Updated the iOS SDK to `2.1.8`. See the [iOS SDK 2.1.8 changelog](/docs/sdk/ios/changelog#218). --- ## Flutter SDK 3.0.3 [#flutter-sdk-303] Released: **2026-09-07** ### New Features [#new-features-4] #### Custom User Attributes [#custom-user-attributes] - Added `LogDrop.setCustomAttributes(...)` and `LogDrop.removeCustomAttribute(...)` for custom profile attributes. - Added support for segment-based push targeting using attributes synchronized through the native SDKs. - Updated the bundled native SDKs to Android `2.1.6` and iOS `2.1.7`. - Guide: [Flutter Custom User Attributes](/docs/sdk/flutter#11-custom-user-attributes) --- ## 3.0.2 [#302] Released: **2026-07-28** ### Improvements [#improvements-6] #### Native SDK Updates [#native-sdk-updates-4] - Updated the Android SDK to `2.1.3`. See the [Android SDK 2.1.3 changelog](/docs/sdk/android/changelog#android-sdk-213). - Updated the iOS SDK to `2.1.4`. See the [iOS SDK 2.1.4 changelog](/docs/sdk/ios/changelog#214). --- ## 3.0.1 [#301] Released: **2026-07-27** ### Improvements [#improvements-7] #### Push Notification Integration [#push-notification-integration] - Added bridge APIs for forwarding push messages and device tokens to LogDrop. - Added LogDrop push detection and pending push popup support. - Guide: [Flutter Push Notification Integration](/docs/sdk/flutter#7-push-notification-integration) #### Manual Deep Link Integration [#manual-deep-link-integration] - Added manual deep link tracking for app-managed navigation flows. - After the application resolves an incoming URL, forward it to `LogDrop.trackDeepLink(uri.toString())`. - Apply this for both cold-start and already-running link deliveries. - Guide: [Flutter Deep Links](/docs/sdk/flutter#8-deep-links) #### Native SDK Updates [#native-sdk-updates-5] - Updated the Android SDK to `2.1.2`. See the [Android SDK changelog](/docs/sdk/android/changelog). - Updated the iOS SDK to `2.1.3`. See the [iOS SDK changelog](/docs/sdk/ios/changelog). # LogDrop Flutter SDK (/docs/sdk/flutter) The LogDrop Flutter SDK provides a Dart-friendly API on top of the native iOS and Android SDKs. It lets you initialize LogDrop once in your Flutter app and automatically forward logs, crashes and network data to the LogDrop backend. --- ## 1. SDK Installation [#1-sdk-installation] The Flutter SDK is the `logdrop_flutter_sdk` package. It runs on the native iOS and Android SDKs, so after adding the package you also set the App ID in the native projects, as described in [Native Configuration](#3-native-configuration). Minimum requirements: Android 6.0 and iOS 15.0. Your app's iOS deployment target must be 15.0 or later. ### 1.1. Add the package to `pubspec.yaml` [#11-add-the-package-to-pubspecyaml] In your Flutter project, open `pubspec.yaml` and add: ```yaml dependencies: flutter: sdk: flutter logdrop_flutter_sdk: ^3.1.0 ``` The latest version is resolved automatically at build time. Then run: ```bash flutter pub get ``` --- ## 2. Initialization [#2-initialization] `LogDropFlutter.init()` starts LogDrop in the Dart layer and registers the handlers that report Flutter and Dart errors. Call it early, before `runApp`, so that errors during startup are captured. It takes no App ID: you set that in the native projects in [Native Configuration](#3-native-configuration). Initialize LogDrop in your `main()` method using `LogDropFlutter.init` after ensuring bindings are initialized. In your `lib/main.dart`: ```dart import 'package:flutter/material.dart'; import 'package:logdrop_flutter_sdk/logdrop_flutter.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); await LogDropFlutter.init(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'LogDrop SDK Demo', debugShowCheckedModeBanner: false, home: const Scaffold( body: Center( child: Text('Hello LogDrop'), ), ), ); } } ``` > **Note: End-to-end tracing** > > From SDK 3.0.7, requests your Dart code makes also carry a W3C `traceparent` header, so you can follow them into a backend traced by LogDrop. See [Tracing](/docs/sdk/flutter/tracing). --- ## 3. Native Configuration [#3-native-configuration] Since the Flutter SDK bridges to native layers, you must configure your LogDrop Application ID (App ID / API Key) and settings (like base URL) in your native iOS and Android projects. Use the **Mobile SDK App ID** from **Project Settings → App ID** in the LogDrop panel. ### 3.1. Android Setup [#31-android-setup] On Android, you add the LogDrop repositories and the LogDrop Gradle plugin, which uploads ProGuard/R8 mapping files so that crash reports from release builds are readable. You then start the native Android SDK from your `Application` class. Edit your project-level `android/build.gradle`: ```groovy buildscript { repositories { google() mavenCentral() maven(uri("https://artifactory.logdrop.io/repository/logdrop-gradle-plugin/")) } dependencies { classpath("io.logdrop.gradle:plugin:1.1.3") } } allprojects { repositories { google() mavenCentral() maven { url "https://artifactory.logdrop.io/repository/android-logdrop-sdk/" } maven { url "https://artifactory.logdrop.io/repository/logdrop-gradle-plugin/" } } } ``` Edit your app-level `android/app/build.gradle`: ```groovy apply plugin: "io.logdrop.gradle.plugin" // or plugins { ... // other plugins id("io.logdrop.gradle.plugin") } ``` ```groovy android { ... defaultConfig { buildConfigField("String", "LOGDROP_BASE_URL", "YOUR_SERVER_URL") buildConfigField("String", "LOGDROP_APP_ID", "YOUR_APP_ID") buildConfigField("boolean", "LOGDROP_LOGCAT_ENABLED", "true") } } ``` Create a file named `logdrop-services.json` under the `android/app` folder. It tells the LogDrop Gradle plugin which LogDrop project and App ID belong to your package name: ```json { "base_url": "https://server.logdrop.io", "projects": { "YOUR_APP_PACKAGE_NAME": { "app_id": "YOUR_APP_ID" } } } ``` Edit your `YourApp.kt` file in the Android module of your Flutter project as follows. This starts the native Android SDK with the values you set in `build.gradle`: ```kotlin import android.app.Application import com.logdrop_flutter_sdk.LogDropFlutter class YourApp : Application() { override fun onCreate() { super.onCreate() LogDropFlutter.initLogDrop( logcatEnabled = BuildConfig.LOGDROP_LOGCAT_ENABLED, appId = BuildConfig.LOGDROP_APP_ID, baseUrl = BuildConfig.LOGDROP_BASE_URL, context = this.applicationContext ) } } ``` ### 3.2. iOS Setup [#32-ios-setup] On iOS, you store the App ID, base URL and logging setting in `Info.plist`, then start the native iOS SDK with those values from `AppDelegate.swift`. Add the following keys to your `Runner/Info.plist` file: ```xml LogDropBaseUrl YOUR_API_URL LogDropAppId YOUR_APP_ID LogDropLoggingEnabled ``` Update `AppDelegate.swift`: ```swift import Flutter import UIKit import logdrop_flutter_sdk @main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let infoDict = Bundle.main.infoDictionary let appId = infoDict?["LogDropAppId"] as? String ?? "" let baseUrl = infoDict?["LogDropBaseUrl"] as? String ?? "" let loggingEnabled = infoDict?["LogDropLoggingEnabled"] as? Bool ?? true LogDropFlutter.initialize( appId: appId, baseUrl: baseUrl, loggingEnabled: loggingEnabled, pushAppGroupSuiteName: "group.com.yourcompany.yourapp" ) GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ``` --- ## 4. Crash Tracking [#4-crash-tracking] The Flutter SDK automatically registers crash tracking listeners for both Flutter framework errors and uncaught Dart errors under the hood during `LogDropFlutter.init(...)`. The native iOS and Android layers handle platform-level native crashes (see their respective SDK docs for symbol/mapping files upload). Without those files, native stack traces from release builds are not readable. Make sure the native LogDrop SDK is initialized before these handlers through the Android and iOS native setup described above. --- ## 5. Logging Methods [#5-logging-methods] Logging methods record your own messages in LogDrop, so you can see what the app did before a problem. Each call sets a level (error, warning, info or debug), a tag that names the part of the app, the message and, optionally, a [`LogFlow`](#6-logflow). After upload, the logs appear on the panel's [Logs](/docs/panel/logs) page. Use the LogDrop logging API from anywhere in your Flutter code: ```dart // Without flow LogDrop.logError(tag: 'PaymentActivity', message: 'Payment failed'); // Error LogDrop.logWarning(tag: 'Network', message: 'Slow network'); // Warning LogDrop.logInfo(tag: 'Auth', message: 'User logged in'); // Info LogDrop.logDebug(tag: 'Parser', message: 'Parsing response'); // Debug // With flow final flow = LogFlow( name: 'SuccessTransaction', id: transactionId, customAttributes: { 'amount': '149.90', 'currency': 'TRY', }, ); LogDrop.logInfo(tag: 'Transaction', message: 'Transaction completed successfully.', logFlow: flow); ``` Logs are stored locally on the device first. To trigger an upload to the server: ```dart LogDrop.sendLogs(); ``` - Schedules a background job that runs approximately 60 seconds later. - If a job is already scheduled or running, additional calls do not create new jobs. --- ## 6. LogFlow [#6-logflow] `LogFlow` lets you group related logs under a specific business flow or transaction. A flow has a name, an ID and optional attributes. Pass the same flow to every log of one piece of work, such as one checkout, so the panel can show those logs together. ```dart final flow = LogFlow( name: 'CartCheckout', id: checkoutId, customAttributes: { 'itemsCount': '3', 'total': '249.90', 'currency': 'TRY', }, ); LogDrop.logInfo(tag: 'Checkout', message: 'Checkout started.', logFlow: flow); LogDrop.logInfo(tag: 'Checkout', message: 'Payment step opened.', logFlow: flow); LogDrop.logInfo(tag: 'Checkout', message: 'Checkout completed.', logFlow: flow); ``` In the LogDrop panel you can filter and analyze logs by `flowName` and `flowId`. --- ## 7. Push Notification Integration [#7-push-notification-integration] With push integrated, you can send alert, rich, in-app, deep-link and internal-browser messages to the app from the panel. The panel's [Fetch Logs](/docs/panel/fetch-logs) also uses a silent LogDrop push to ask a device to upload its logs. For this, the app passes its push token and LogDrop's messages to the SDK. Keep your application's existing push provider integration. Forward its token and messages identified by `LogDrop.isLogDropPush(...)` to the Flutter bridge. ### 7.1. Android with FlutterFire Messaging [#71-android-with-flutterfire-messaging] On Android, LogDrop pushes arrive through Firebase Cloud Messaging (FCM), or through Huawei Mobile Services (HMS) on Huawei devices. The SDK needs the device's push token to reach the device, and each LogDrop message to show it or to run a fetch-logs request. `LogDrop.isLogDropPush(...)` picks out LogDrop's messages, so your app's other messages are left alone. Register the background handler at top level. Forward LogDrop messages from both foreground and background handlers, and register both the current FCM token and future token updates. ```dart import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:logdrop_flutter_sdk/logdropsdk.dart'; Map _logDropData(RemoteMessage message) => message.data.map((key, value) => MapEntry(key, value.toString())); @pragma('vm:entry-point') Future firebaseMessagingBackgroundHandler(RemoteMessage message) async { await Firebase.initializeApp(); final data = _logDropData(message); if (await LogDrop.isLogDropPush(data)) { LogDrop.onRemoteMessageReceived(data); } } Future registerLogDropPushHandlers() async { FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler); final messaging = FirebaseMessaging.instance; final token = await messaging.getToken(); if (token != null) { LogDrop.onNewFcmPushToken(token); } messaging.onTokenRefresh.listen(LogDrop.onNewFcmPushToken); FirebaseMessaging.onMessage.listen((message) async { final data = _logDropData(message); if (await LogDrop.isLogDropPush(data)) { LogDrop.onRemoteMessageReceived(data); } }); } ``` Call `registerLogDropPushHandlers()` during startup after initializing LogDrop and Firebase. For HMS, forward the provider token with `LogDrop.onNewHmsPushToken(token)` and use the same message forwarding methods. ### 7.2. iOS APNs Forwarding [#72-ios-apns-forwarding] On iOS, LogDrop pushes arrive through Apple Push Notification service (APNs). The SDK needs the APNs device token to reach the device, and the remote notifications to handle LogDrop's messages, including silent fetch-logs requests. Forward the APNs token and remote notifications from `AppDelegate.swift`: ```swift override func application( _ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data ) { LogDropFlutter.onNewApnsToken(apnsToken: deviceToken) } override func application( _ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void ) { LogDropFlutter.onRemoteMessageReceived(userInfo: userInfo) completionHandler(.newData) } ``` ### 7.3. iOS Notification Service Extension [#73-ios-notification-service-extension] A Notification Service Extension lets LogDrop process and record an alert push even when the app is not running. The app and the extension share data through an App Group, so both must use the same App Group identifier. Complete the [iOS Notification Service Extension and App Group setup](/docs/sdk/ios#83-notification-service-extension-and-app-group). Use the same App Group identifier in `LogDropFlutter.initialize(...)`, both target entitlements, and the extension configuration: > **Note** > > With Swift Package Manager, add the `LogDrop-iOS` package to the extension with **Up to Next > Major Version** from 2.1.0. Xcode then uses the same LogDrop version as the plugin, so the > extension needs no update when you upgrade the plugin. > > With CocoaPods, add the iOS SDK that ships with the plugin to the extension target in > `ios/Podfile`, then run `pod install`: > > ```ruby > target 'NotificationServiceExtension' do > use_frameworks! > pod 'LogDrop', :path => '.symlinks/plugins/logdrop_flutter_sdk/ios/ios-sdk' > end > ``` ```swift import LogDropSDK final class NotificationService: LogDropNotificationServiceExtension { override func logDropConfiguration() -> LogDropConfig? { LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setBaseUrl("YOUR_BASE_URL") // Optional: for self-hosted LogDrop .setPushAppGroupSuiteName("group.com.yourcompany.yourapp") .build() } } ``` ### 7.4. Show a Pending Push Action [#74-show-a-pending-push-action] In-app messages and internal-browser pushes open inside your app, not in the notification tray. LogDrop keeps them in a queue until your app asks to show them. When the application UI becomes active, ask LogDrop to present a queued in-app popup or internal-browser action: ```dart final result = await LogDrop.showPendingPushPopup(); // shown / nothingToShow / notInitialized ``` --- ## 8. Deep Links [#8-deep-links] A deep link opens a specific screen of your app from a link, a LogDrop push or an in-app message. Your app does the routing; forwarding the URL lets LogDrop track the deep link. Keep routing links through your existing Flutter router. After the application receives and resolves a URL, forward that URL once to LogDrop: ```dart await LogDrop.trackDeepLink(uri.toString()); ``` Use the same call for cold-start and already-running link deliveries. --- ## 9. User Identification (UUID Customization) [#9-user-identification-uuid-customization] By default, logs are tied to a device identifier. Set your own user ID, for example after the user signs in, when you want to find that user's data in the panel. You can then search for it as **User UUID** on the Devices page. To associate logs with your own user ID: ```dart LogDrop.userUpdate('user-1234@example.com'); ``` You can use any stable, unique identifier, for example: - Email address - Internal customer ID - Other application-specific user ID All subsequent logs will be associated with this user in the LogDrop panel. --- ## 10. Custom Events [#10-custom-events] Use custom events to track application-specific actions that are not covered by LogDrop's built-in events. Send a stable event name together with optional JSON-compatible properties. You do not need to set anything up in the panel first. ### 10.1. Track a Custom Event [#101-track-a-custom-event] Call `trackCustomEvent` when the action happens, with the event name and, optionally, a map of properties that describe it. ```dart await LogDrop.trackCustomEvent('purchase_completed', { 'coupon_code': 'SUMMER10', 'amount': 49.9, 'item_count': 2, 'is_first_order': true, }); ``` Properties are optional. To track an event without properties: ```dart await LogDrop.trackCustomEvent('onboarding_completed'); ``` Provide only the readable event name and properties. Event and property codes shown in the panel are managed by LogDrop. ### 10.2. Supported Property Values [#102-supported-property-values] Custom properties may contain strings, numbers, booleans, null, nested maps, and lists. Map keys must be strings. ```dart await LogDrop.trackCustomEvent('product_viewed', { 'sku': 'LD-100', 'viewed_at': DateTime.now().toUtc().toIso8601String(), 'product': { 'name': 'LogDrop Hoodie', 'price': 79.95, }, 'categories': ['merch', 'hoodies'], 'variants': [ {'color': 'black', 'size': 'M'}, {'color': 'green', 'size': 'L'}, ], 'campaign': null, }); ``` Flutter's method channel accepts codec-compatible values. Convert `DateTime` instances to ISO-8601 strings before passing them. Nested maps and lists remain structured values. ### 10.3. Naming and Property Types [#103-naming-and-property-types] LogDrop groups custom events by name and records the type of each property. Follow these rules so that one action always arrives as the same event, with the same property types. - Use stable and consistent names. For example, do not alternate between `purchase_completed` and `purchaseCompleted` for the same event. - Do not put IDs, timestamps, or other dynamic values in the event name. Add them as properties instead. - Do not use the name of a LogDrop default event for a custom event. - Keep each property's type stable. For example, always send `amount` as a number rather than sometimes sending a number and sometimes a string. - Reusing the same event name updates the same custom event schema. Changing the name creates a different custom event. > **Warning** > > If a property is later sent with a different type, LogDrop keeps the event but marks the > property as a type conflict in the panel. Type conflict tracking helps find integration > mistakes; it should not be used as a replacement for a stable event contract. ### 10.4. Limits and Validation [#104-limits-and-validation] The native SDK checks every event against these limits before it sends the event. - Event names can contain up to **128 characters**. - Property names can contain up to **128 characters**. - One event can contain up to **100 top-level properties**. - The complete properties JSON can contain up to **16 KB in UTF-8**, including property names, primitive values, nested objects, and arrays. - Event names and property names cannot be empty. - Property values must be JSON-compatible. > **Warning** > > If validation fails, the native SDK rejects the complete event and writes the reason to > the SDK log. Names, properties, and payloads are never silently truncated. ### 10.5. Panel Behavior [#105-panel-behavior] No custom event definition is required before tracking. After the first valid event reaches LogDrop, the **Events** page shows the event, its generated code, observed properties, property types, and any type conflicts. You can then use the event in event details and Event Analytics funnels. --- ## 11. Custom User Attributes [#11-custom-user-attributes] Custom user attributes let you attach stable profile information to the current LogDrop device and use it for segment-based push targeting in the panel. Customer Journeys also use them as the recipient and consent fields of SMS and WhatsApp steps. Call these APIs after `LogDropFlutter.init()` has completed. ### 11.1. Set or Update Attributes [#111-set-or-update-attributes] Call `setCustomAttributes` with string keys and values, for example when the user's plan or language changes. ```dart await LogDrop.setCustomAttributes({ 'plan_type': 'premium', 'country': 'TR', 'preferred_language': 'tr', }); ``` The update is an additive upsert. New keys are added and existing keys receive the new value, while attributes omitted from the call remain unchanged. Valid changes are persisted by the native SDK and synchronized with LogDrop automatically. ### 11.2. Remove an Attribute [#112-remove-an-attribute] Remove an attribute when it no longer applies, for example after a plan ends. ```dart await LogDrop.removeCustomAttribute('plan_type'); ``` Removing a key also synchronizes the deletion with LogDrop, so the previous value is no longer available for future segment targeting. ### 11.3. Limits and Validation [#113-limits-and-validation] The native SDK checks every update against these rules. An update that breaks a rule is rejected, and the device keeps its previous attributes. - Attributes must be provided as a `Map`. - A device can have up to **30** custom attributes in total. - Keys must contain only letters, numbers, underscores (`_`), or hyphens (`-`). - Keys can contain up to **64 characters**. - Values must be non-blank strings containing up to **256 characters**. - If one entry in a call is invalid, the native SDK rejects the complete update. - If the merged result would exceed 30 keys, the previous attribute set remains unchanged. > **Note** > > Custom user attributes are different from `LogFlow.customAttributes`. User attributes > describe a device for audience targeting, while flow attributes add context only to the > logs recorded with that `LogFlow`. ### 11.4. Use Attributes in the Panel [#114-use-attributes-in-the-panel] A segment sends a push only to the devices whose attributes match your filter, for example every device with `plan_type` set to `premium`. After the device synchronizes, open **Push Notification → Send Push**, select **Segment** under Recipients, and build a filter with the attribute key. See [Segment Targeting with Custom Attributes](/docs/panel/push-notification/send-push#segment-targeting-with-custom-attributes). --- ## 12. Screen Tracking [#12-screen-tracking] From SDK 3.1.0, LogDrop records the screen the user is looking at. Each screen change is a `screen_view` event with the screen name, the previous screen and how the screen was detected. App Health uses the screen names to break performance metrics down by screen. > **Note: App Health metrics** > > The native SDKs also send app start time, slow and frozen frames, freezes, memory, CPU, battery, > network and HTTP timing metrics with each session for the panel's App Health page. They need no code. ### 12.1. Navigator Routes [#121-navigator-routes] A Flutter app runs in a single native screen, so Flutter screens are named from Dart. Add `LogDropNavigatorObserver` to your navigator. It tracks every named page route when it becomes visible (push, pop back to it, replace) and skips unnamed routes, dialogs and bottom sheets. ```dart import 'package:logdrop_flutter_sdk/logdropsdk.dart'; MaterialApp( navigatorObservers: [LogDropNavigatorObserver()], routes: { '/': (_) => const HomePage(), '/product': (_) => const ProductPage(), }, ); ``` Routes pushed with `MaterialPageRoute` need a name to be tracked: `MaterialPageRoute(settings: const RouteSettings(name: '/product'), builder: ...)`. If your router puts IDs in route names, map them to a stable name with `nameExtractor`; return `null` to skip a route. ```dart LogDropNavigatorObserver( nameExtractor: (settings) => settings.name?.split('?').first, ); ``` ### 12.2. Manual Screens [#122-manual-screens] For screens that are not routes, such as tabs or custom UIs, call `trackScreen`. A `screen_view` is recorded when the name differs from the current screen. ```dart await LogDrop.trackScreen('ProductDetail'); ``` - Keep screen names stable and free of user data: `ProductDetail`, not the product's name. - Names longer than 100 characters are cut; blank names are ignored. ### 12.3. Native Automatic Tracking [#123-native-automatic-tracking] The native SDKs can track Activities and view controllers automatically, but in a Flutter app they would only see the Flutter host screen. `LogDropFlutter.initLogDrop` (Android) and `LogDropFlutter.initialize` (iOS) therefore turn it off by default. If your app also shows its own native Activities or view controllers, turn it on: ```kotlin LogDropFlutter.initLogDrop( logcatEnabled = BuildConfig.LOGDROP_LOGCAT_ENABLED, appId = BuildConfig.LOGDROP_APP_ID, baseUrl = BuildConfig.LOGDROP_BASE_URL, context = this.applicationContext, automaticScreenTracking = true ) ``` ```swift LogDropFlutter.initialize( appId: appId, baseUrl: baseUrl, loggingEnabled: loggingEnabled, automaticScreenTracking: true ) ``` If you build the native `LogDropConfig` yourself instead, call `.automaticScreenTracking(false)` (Android) or `.setAutomaticScreenTracking(false)` (iOS) and track Flutter screens as shown above. --- ## 13. Troubleshooting [#13-troubleshooting] Check these points when data does not reach LogDrop, custom events or attributes are missing, or pushes do not arrive. - Verify that the native iOS and Android SDK configurations are correctly set up. - Ensure `LogDropFlutter.init(...)` is called early in app startup. - Check that the `logdrop_flutter_sdk` package version matches the native SDK versions if you override them. - Confirm that custom event names do not match LogDrop default event names. - Check native SDK logs when a custom event is missing; invalid names, properties, or oversized payloads are rejected locally. - Check native SDK logs when custom user attributes are missing; invalid updates and updates exceeding 30 keys are rejected locally. - For FCM integration: - Confirm that Firebase is initialized before using `FirebaseMessaging`. - Make sure background handlers are registered as top-level functions. - Verify that `isLogDropPush`, `onNewFcmPushToken`, and `onRemoteMessageReceived` are being called. # Tracing (/docs/sdk/flutter/tracing) The Flutter SDK adds a W3C `traceparent` header to the requests your Dart code makes through `dart:io`, and the native Android and iOS SDKs send each request as one client span. Flutter itself creates, queues and sends no spans, so there is no OpenTelemetry package to add and nothing to configure in Dart. A backend traced by LogDrop continues the same trace, so one request shows up in Trace Explorer from the device into your services. Rules that all LogDrop mobile SDKs share (authentication, which requests are traced, delivery and limits) are on [End-to-end Tracing](/docs/sdk/tracing). ## 1. Use SDK 3.0.7 or later [#1-use-sdk-307-or-later] Tracing needs Flutter SDK 3.0.7 or later. Set the package version in `pubspec.yaml`: ```yaml title="pubspec.yaml" dependencies: logdrop_flutter_sdk: ^3.1.0 ``` Version 3.0.7 brings the native Android and iOS SDKs 2.1.11, which contain the tracing. The native setup on Android and iOS is unchanged; see [Native Configuration](/docs/sdk/flutter#3-native-configuration). ## 2. Initialize in Dart [#2-initialize-in-dart] Tracing starts with the `LogDropFlutter.init()` call your app already makes; there is no separate tracing call. Where you place that call matters, as the notes below the code explain. ```dart Future main() async { WidgetsFlutterBinding.ensureInitialized(); await LogDropFlutter.init(); runApp(const MyApp()); } ``` `LogDropFlutter.init()` installs LogDrop's `HttpOverrides`, wrapping any override that was already set. - If your app sets `HttpOverrides.global` itself, do it **before** `LogDropFlutter.init()`. An override set afterwards replaces LogDrop's and turns tracing off for Dart requests. - Call `LogDropFlutter.init()` before your app creates HTTP clients: an `HttpClient` created earlier is never traced. Dio, for example, keeps the client it creates for its first request. The App ID from the native configuration is all the SDK needs: spans go to `/v1/traces` with the header `x-logdrop-app-id`. Turn on **HTTP Logging** for the project in the panel. Your backend must send its traces to the **same LogDrop project** as this app, with an ingest key created in the app's project ([why](/docs/sdk/tracing#what-you-need)). ## What is traced [#what-is-traced] Not every request gets a trace. This list shows which requests get a `traceparent` header and a span, and how Dart and the native SDK share the work. - Requests through `dart:io` `HttpClient` and the packages built on it: `package:http` (`IOClient`), Dio's default adapter, `Image.network` and similar. - Clients that bypass `dart:io`, such as `cronet_http` or `cupertino_http`, are not traced by the Dart layer. - Requests that your plugins make natively are traced by the native SDKs, as described for [Android](/docs/sdk/android/tracing) and [iOS](/docs/sdk/ios/tracing). On Android this needs the LogDrop Gradle plugin; Dart requests do not. - For each request, Dart asks the native SDK once whether to trace it, then keeps or sets `traceparent` and hands one HTTP record to the native SDK, which turns it into the client span. A valid `traceparent` your app set itself is kept, and no span is sent for it. The other rules are in [Which requests are traced](/docs/sdk/tracing#which-requests-are-traced). ## Delivery [#delivery] The native SDKs queue, split and send the spans, with the limits and retries in [Delivery](/docs/sdk/tracing#delivery). ## Send queued spans now (optional) [#send-queued-spans-now-optional] The SDK sends spans on its own. `flushOtlpTracing` asks it to send the queued spans now and tells you whether that worked. Use it where you need the spans out right away, for example at the end of an integration test or before the user signs out. ```dart import 'package:logdrop_flutter_sdk/logdropsdk.dart'; final delivered = await LogDrop.flushOtlpTracing(timeout: const Duration(seconds: 2)); ``` - It waits at most the timeout (default 2 seconds, at most 5 seconds; a longer timeout waits 5 seconds) and returns `true` only when the native SDK confirms delivery. - `false` means a timeout, no network, a batch waiting for its retry, or spans dropped since the previous flush. The queued spans are still sent later. - It throws a `PlatformException` with the code `OTLP_SDK_UNAVAILABLE` when the native SDK in the app has no span exporter, which happens only if your app forces a native SDK older than 2.1.11. ## Changing the App ID [#changing-the-app-id] `LogDrop.setAppId(...)` drops the spans queued for the previous App ID. This way a span is never sent with another project's App ID. ## Check it [#check-it] To confirm that tracing works, make one request from the app and find its trace in the panel. Follow [Check it](/docs/sdk/tracing#check-it). The device span is under your app's package name (Android) or bundle identifier (iOS) in Trace Explorer. ## Known limits [#known-limits] In these cases a trace can miss spans, a request can carry `traceparent` where you did not expect it, or a request sent again shows up as a separate trace. - **`dart:io` follows redirects itself, with the first request's decision.** The ignore rules are checked for the first URL only, so a redirect to an ignored host still carries `traceparent`, and a redirect is not a separate span. - **App-level retries start a new trace.** `dart:io` has no retry hook, so a request your code (or a Dio retry interceptor) sends again is a new request with a new trace. - The device clock must not run more than 5 minutes ahead of LogDrop's. - Requests that plugins send natively follow the native limits; for example, on iOS URLSession's own connection retries share one client span ([iOS](/docs/sdk/ios/tracing#known-limits)). # Changelog (/docs/sdk/ios/changelog) {/* AGENT/MAINTAINER NOTE — this file is parsed by scripts/generate-sdk-release-feed.js and consumed by the CRM SDK release campaign sync. Required format: 1. The newest release must be the first `##` heading in this file. 2. Every release must have its own `##` heading with a full `x.y.z` semver. Example: `## iOS SDK 2.2.0`. 3. The release date must be the first metadata line and must keep this exact shape: `Released: **YYYY-MM-DD**` 4. End the release entry with a standalone `---` before the previous release. 5. Do not add an introductory or unreleased `##` section above the newest release. Historical release `##` headings and lower-level headings inside a release are safe. 6. Keep release notes customer-facing. Describe observable features, fixes, compatibility changes, upgrade requirements, and public APIs. Do not include internal class or method names, source-code mechanics, test/reproduction setup, or implementation-only details unless users need them to take action. Changing this contract can prevent the wiki build or CRM changelog sync from working. Do not edit public/sdk-releases.json manually; it is generated during the wiki build. */} ## 2.1.16 [#2116] Released: **2026-11-27** ### Compatibility [#compatibility] - The minimum iOS version is now 15.0. Set your app's deployment target (and your Notification Service Extension's, if you have one) to iOS 15.0 or later before updating. Apps that still support iOS 14 can stay on 2.1.15. ### New Features [#new-features] #### App Health [#app-health] - The SDK sends app performance metrics with each session for the panel's new App Health page: cold and warm start time, slow and frozen frames, hangs, memory use (average and peak) and low-memory warnings, CPU use, battery drain, time the device runs hot, app storage size, data used per session and time spent offline. No code changes are needed. - HTTP records show how long connection setup, sending the request, waiting for the server and downloading the response took, the bytes sent and received, and the screen the request started on. #### Screen Tracking [#screen-tracking] - View controllers are tracked as screens automatically. Each screen change is recorded as a `screen_view` event with the screen name, the previous screen and the screen type. Navigation and tab bar controllers, system view controllers and SwiftUI hosting controllers are not tracked as screens. - SwiftUI: add `.logDropScreen("Checkout")` to a view to track it as a screen when it appears. - Adopt `LogDropScreenNaming` in a view controller to give it a stable name with `logDropScreenName`, or return `nil` to leave it out. - `LogDrop.trackScreen(_:)` sets the current screen for UIs automatic tracking cannot see. - To track screens only from your code, use `LogDropConfig.Builder().setAutomaticScreenTracking(false)`. - Guide: [iOS Screen Tracking](/docs/sdk/ios#12-screen-tracking) ### Bug Fixes [#bug-fixes] - When the SDK is initialized while the app is already on screen, for example after sign-in or a remote config fetch, the session starts right away instead of the next time the app returns from the background. --- ## 2.1.15 [#2115] Released: **2026-11-25** ### Bug Fixes [#bug-fixes-1] - HTTP Logging is stable on iOS 16 and earlier. Recommended update for apps that support these iOS versions. ### CocoaPods [#cocoapods] - CocoaPods trunk becomes read-only on December 2, 2026, so new releases are published to the LogDrop-iOS git repository. Replace `pod 'LogDrop'` or `pod 'LogDrop', ''` in your `Podfile` once with `pod 'LogDrop', :git => 'https://github.com/initialcodess/LogDrop-iOS.git'`, then run `pod update LogDrop`. Swift Package Manager needs no change. --- ## 2.1.14 [#2114] Released: **2026-11-20** ### Bug Fixes [#bug-fixes-2] #### HTTP Logging [#http-logging] - HTTP Logging uses your app's own URL session settings, such as cache, cookies and ephemeral sessions, and lets your app decide how redirects are followed. - Large downloads, uploads and streaming responses are not held in memory, and requests your app cancels are not reported as failures. #### Logs [#logs] - Failed log uploads are retried at increasing intervals; `LogDrop.sendLogs()` and remote log requests also send the current session. - When the app starts offline, the SDK completes its setup once the network is back. - Crash reports created while an upload is running are kept. #### HTTP Whitelist and WebView [#http-whitelist-and-webview] - Risk blocking also applies to redirects, and the whitelist callback runs once, on the main thread. - WebView capture records the page's own requests once each. #### End-to-end Tracing [#end-to-end-tracing] - The `traceparent` header is no longer added to requests to well-known third-party services, such as Google and Firebase, Apple, Meta, payment providers, analytics and crash reporting services. Your own backends keep receiving it. --- ## 2.1.13 [#2113] Released: **2026-11-19** ### Bug Fixes [#bug-fixes-3] #### WebView [#webview] - Pages that open a new window or popup, such as sign-in and payment pages, work as expected with HTTP Logging on. #### Logs [#logs-1] - Logs written after `LogDrop.sendLogs()` or a remote log request are included in the next upload. #### Crash Reporting [#crash-reporting] - Crash reporters you use alongside LogDrop, such as Firebase Crashlytics, receive full exception details. #### HTTP Logging [#http-logging-1] - `Cookie` and `Set-Cookie` headers are masked in HTTP records. --- ## 2.1.12 [#2112] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-4] #### HTTP Logging [#http-logging-2] - With HTTP Logging on, repeated requests for cacheable responses are served from the app's `URLCache` again. Before 2.1.12 they went to the network every time, which made screens slower and used more data. Requests that explicitly skip the cache are unchanged. - Memory used by finished requests is released. Before 2.1.12 the SDK kept each tracked request, including its response body, until the app was closed. --- ## 2.1.11 [#2111] Released: **2026-11-12** ### New Features [#new-features-1] #### End-to-end Tracing [#end-to-end-tracing-1] - When HTTP Logging is on for the project, the SDK adds a W3C `traceparent` header to the `URLSession` requests it tracks (the shared session and sessions with the default or ephemeral configuration) and sends each request to LogDrop as a trace span. A backend traced by LogDrop in the same project continues the trace. - Spans are sent with your existing App ID. No code change, Info.plist entry or background mode is needed. - Added `LogDrop.flushOtlpTracing(completion:)` to send queued spans on demand. - Guide: [iOS Tracing](/docs/sdk/ios/tracing) --- ## 2.1.10 [#2110] Released: **2026-10-27** ### Improvements [#improvements] #### Custom Event Names [#custom-event-names] - Custom event names and top-level property names must now start with an ASCII letter (`A-Z`, `a-z`) and contain only ASCII letters, digits, or underscores (`_`), up to 128 characters. For example: `purchase_completed`, `coupon_used`. - Events with invalid names are rejected instead of being trimmed or rewritten. Property values and nested JSON keys are not affected. - If your app sends custom events, check that their names follow this rule before upgrading. - Guide: [iOS Custom Events](/docs/sdk/ios#10-custom-events) --- ## 2.1.9 [#219] Released: **2026-10-05** ### Bug Fixes [#bug-fixes-5] #### Custom User Attributes [#custom-user-attributes] - Fixed custom attributes being shared between different users on the same device. - Attribute updates and removals now stay associated with the user they belong to, including when the user changes during synchronization. - Fixed removing attributes that were originally set on another device. #### Device Registration [#device-registration] - Fixed incomplete device registration after changing the Base URL or App ID. Device metadata is now resent for the new configuration. --- ## 2.1.8 [#218] Released: **2026-09-02** ### Improvements [#improvements-1] #### Event and Log Upload Reliability [#event-and-log-upload-reliability] - Added persistent upload identifiers for event and log batches. - Retries now reuse the same batch and upload identifier, preventing duplicate records when the server accepts an upload but the device does not receive the response. ### Bug Fixes [#bug-fixes-6] #### Risk Score Reporting [#risk-score-reporting] - Fixed risk and bot events to report the score of each individual signal instead of the combined overall score. --- ## 2.1.7 [#217] Released: **2026-08-12** ### New Features [#new-features-2] #### Custom User Attributes [#custom-user-attributes-1] - Added `LogDrop.setCustomAttributes(...)` and `LogDrop.removeCustomAttribute(key:)` to send custom profile attributes with user update requests. - Added support for segment targeting and audience filtering in push notifications based on custom user attributes. - Guide: [iOS Custom User Attributes](/docs/sdk/ios#11-custom-user-attributes) #### HTTP Ignore Support [#http-ignore-support] - Added support for HTTP ignore rules to exclude matching HTTP network requests from SDK log collection. ### Bug Fixes [#bug-fixes-7] #### Risk Event Handling [#risk-event-handling] - Fixed an issue related to risk event processing and reporting. --- ## 2.1.6 [#216] Released: **2026-08-03** ### Bug Fixes [#bug-fixes-8] #### Log Upload Stability [#log-upload-stability] - Fixed an issue where log uploads could get stuck in a retry loop on certain devices. - Improved log upload request handling and completion management. --- ## 2.1.5 [#215] Released: **2026-07-29** ### New Features [#new-features-3] #### Custom Events [#custom-events] - Added `LogDrop.trackCustomEvent(...)` for tracking application-specific events with JSON-compatible properties. - Added support for strings, numbers, booleans, dates, null values, nested objects, and arrays. - Guide: [iOS Custom Events](/docs/sdk/ios#10-custom-events) --- ## 2.1.4 [#214] Released: **2026-07-28** ### Improvements [#improvements-2] #### Event Tracking Configuration [#event-tracking-configuration] - Added support for the `isEventTrackingEnabled` remote configuration flag. ### Bug Fixes [#bug-fixes-9] #### User Update Stability [#user-update-stability] - Fixed an issue that could occasionally trigger a user update with an empty UUID. --- ## 2.1.3 [#213] Released: **2026-07-17** ### Improvements [#improvements-3] #### Background Upload Reliability [#background-upload-reliability] - Improved the reliability of log and event uploads during background execution. - Uploads are now safely retried when device data or authentication is temporarily unavailable. ### Bug Fixes [#bug-fixes-10] #### Keychain and Local Storage Stability [#keychain-and-local-storage-stability] - Fixed potential Keychain access issues affecting encrypted SDK data. - Corrected local storage size limits. --- ## 2.1.2 [#212] Released: **2026-07-08** ### Improvements [#improvements-4] #### Manual Deep Link Integration [#manual-deep-link-integration] - Added manual deep link tracking for app-managed link flows. - Use `LogDrop.handleIncomingURL(_:)` for custom-scheme links. - Use `LogDrop.handleUserActivity(_:)` for universal links. - Guide: [iOS Deep Links](/docs/sdk/ios#3-deep-links) ```swift LogDrop.handleIncomingURL(url) LogDrop.handleUserActivity(userActivity) ``` ### Bug Fixes [#bug-fixes-11] #### Push and Swizzling Stability [#push-and-swizzling-stability] - Fixed a Flutter-related push swizzling issue on iOS. - Fixed an issue where `push_received` was not triggered when the app was fully terminated. - Fixed a swizzling-related crash issue. # LogDrop iOS SDK (/docs/sdk/ios) The LogDrop iOS SDK is written in Swift and can be integrated into your project using either **CocoaPods** or **Swift Package Manager (SPM)**. --- ## 1. SDK Installation [#1-sdk-installation] Add the LogDrop package to your app target before you write any LogDrop code. Use one of the two options below, Swift Package Manager or CocoaPods. You do not need both. The SDK requires iOS 15.0 or later. ### 1.1. Install via Swift Package Manager (SPM) (recommended) [#11-install-via-swift-package-manager-spm-recommended] This is the recommended option. Use it if you add packages through Xcode with Swift Package Manager. 1. Open your project in Xcode. 2. Go to **File → Add Packages...** 3. Enter the following URL: ```text https://github.com/initialcodess/LogDrop-iOS ``` 4. Select **Up to Next Major Version**. 5. Add the **LogDrop** package to your app target. ### 1.2. Install via CocoaPods [#12-install-via-cocoapods] Use this option if your project manages its dependencies with CocoaPods. Add LogDrop to your Podfile from its git repository: ```ruby target 'YourAppTarget' do pod 'LogDrop', :git => 'https://github.com/initialcodess/LogDrop-iOS.git' end ``` Then run: ```bash pod install ``` - `pod install` keeps the version recorded in `Podfile.lock`. Run `pod update LogDrop` to move to the latest release. - To stay on a specific version, add its tag: `pod 'LogDrop', :git => 'https://github.com/initialcodess/LogDrop-iOS.git', :tag => '2.1.16'`. > **Note** > > The CocoaPods trunk becomes read-only on December 2, 2026, so new LogDrop releases are published to the > LogDrop-iOS git repository instead. If your `Podfile` has `pod 'LogDrop'` or `pod 'LogDrop', ''`, > replace it once with the line above, then run `pod update LogDrop`. --- ## 2. Initialization [#2-initialization] Initialization starts the SDK and connects it to your LogDrop project. Initialize once, as early as possible, so that crashes and requests made during startup are captured. Replace `YOUR_APP_ID` with the **Mobile SDK App ID** from **Project Settings → App ID** in the panel. Set a base URL only if you use a self-hosted LogDrop. Call the following during app startup (for example in `AppDelegate` or your main app entry point): ```swift let config = LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setLoggingEnabled(true) .setBaseUrl("YOUR_BASE_URL") // Optional: for self-hosted LogDrop .build() LogDrop.initialize(with: config) ``` > **Note: End-to-end tracing** > > From SDK 2.1.11, requests the SDK tracks also carry a W3C `traceparent` header, so you can follow them into a backend traced by LogDrop. See [Tracing](/docs/sdk/ios/tracing). --- ## 3. Deep Links [#3-deep-links] A deep link is a URL that opens a specific screen in your app. LogDrop pushes and in-app messages can carry one. If your app owns deep link routing, forward incoming links to LogDrop manually after the URL reaches your app layer, so the SDK can track them. ### 3.1. Custom Scheme Deep Links [#31-custom-scheme-deep-links] Custom-scheme links use your app's own URL scheme, such as `myapp://home`. In an `AppDelegate`, iOS delivers them to `application(_:open:options:)`. Forward the URL from there: ```swift func application( _ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:] ) -> Bool { LogDrop.handleIncomingURL(url) return true } ``` ### 3.2. Universal Links [#32-universal-links] Universal links are `https://` links that open your app. iOS delivers them as an `NSUserActivity` to `application(_:continue:restorationHandler:)`. Forward the activity from there: ```swift func application( _ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void ) -> Bool { LogDrop.handleUserActivity(userActivity) return true } ``` ### 3.3. SwiftUI App Lifecycle [#33-swiftui-app-lifecycle] If your app uses the SwiftUI app lifecycle instead of an `AppDelegate`, forward links with these view modifiers. `.onOpenURL` receives custom-scheme links, and `.onContinueUserActivity` receives universal links. ```swift .onOpenURL { url in LogDrop.handleIncomingURL(url) } .onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { userActivity in LogDrop.handleUserActivity(userActivity) } ``` > **Note** > > Use `LogDrop.handleIncomingURL(_:)` for custom-scheme links and `LogDrop.handleUserActivity(_:)` for universal links. --- ## 4. LogDropConfig Overview [#4-logdropconfig-overview] `LogDropConfig` is the configuration you pass to `LogDrop.initialize(with:)`. `appId` is required. The other fields turn on SDK logging, point the SDK to a self-hosted LogDrop, or connect your push, deep link and in-app callbacks. Some behavior, such as crash tracking, is not set here: you control it from the panel under **Settings → App Config**. Key configuration fields: - `appId: String` Your LogDrop project Application ID. **Required.** - `isLoggingEnabled: Bool` Enables or disables SDK logging. Useful in development for debugging. - `baseUrl: String?` Custom backend URL for on-prem / self-hosted LogDrop deployments. - `pushAppGroupSuiteName: String?` App Group shared by the main application and Notification Service Extension. - `pushCallbacks: LogDropPushCallbacks?` Receives notification received, opened, and silent-push callbacks. - `pushDeeplinkHandler: LogDropPushDeeplinkHandler?` Lets the application take over routing for push actions and deep links. - `inAppLifecycleCallbacks: LogDropInAppLifecycleCallbacks?` Observes in-app popup presentation and dismissal. - `internalBrowserLifecycleCallbacks: LogDropInternalBrowserLifecycleCallbacks?` Observes LogDrop's internal browser lifecycle. - `automaticScreenTracking: Bool` Tracks view controllers as screens automatically. Default `true`; set it with `setAutomaticScreenTracking(_:)`. See [Screen Tracking](#12-screen-tracking). Use the builder to construct the configuration in a safe and fluent way. --- ## 5. Crash Tracking (dSYM Upload) [#5-crash-tracking-dsym-upload] A dSYM file holds the debug symbols of an app build. Without it, crash stack traces from release builds are unreadable. To symbolicate crash reports, dSYM files must be uploaded to LogDrop. The panel can then show file names, functions and line numbers. The steps below add a build phase that uploads the dSYM files when Xcode builds your app. ### 5.1. Add a Run Script Phase [#51-add-a-run-script-phase] A Run Script phase runs a shell script when Xcode builds the target. This one runs LogDrop's `upload_dsym.sh`, which uploads the dSYM files of the build to your LogDrop project. 1. Select your app **Target** in Xcode. 2. Open the **Build Phases** tab. 3. Click `+` and choose **New Run Script Phase**. 4. Move the Run Script **to the bottom** of the Build Phases list. Script: ```bash export LOGDROP_BASE_URL="" export LOGDROP_API_KEY="" SCRIPT=$(find "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/LogDrop-iOS" -name "upload_dsym.sh" | head -n 1) /bin/sh "$SCRIPT" ``` - `LOGDROP_BASE_URL` – Optional. If not set, the default production backend is used. - `LOGDROP_API_KEY` – API key of the LogDrop project that will receive crash reports. ### 5.2. Input Files [#52-input-files] Input Files list the files a Run Script phase reads. These entries point to the dSYM of the current build and to the app executable. In the same Run Script phase, add the following entries under **Input Files** (one per line): ```text ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME} ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist $(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH) ``` ### 5.3. Enable Crash Tracking in the Config [#53-enable-crash-tracking-in-the-config] Crash tracking is resolved and controlled dynamically from the LogDrop backend (Settings -> App Config) rather than locally in the config builder. If dSYM files are missing or outdated, you can also upload them manually from the LogDrop panel. --- ## 6. Logging Methods [#6-logging-methods] Logging methods record your own messages at four levels: error (`e`), warning (`w`), info (`i`) and debug (`d`). Use them to record what happens in your app, so you can follow it later in the LogDrop panel. In these examples, each log also carries a `LogFlow`, described in the next section. ```swift LogDrop.e("Payment failed", logFlow: flow) // Error LogDrop.w("Slow network", logFlow: flow) // Warning LogDrop.i("User logged in", logFlow: flow) // Info LogDrop.d("Parsing response", logFlow: flow) // Debug ``` Logs are stored locally first. To send them to the server: ```swift LogDrop.sendLogs() ``` - Schedules a background job that runs approximately 60 seconds later. - If a job is already scheduled or running, additional calls do not create new jobs. --- ## 7. LogFlow [#7-logflow] `LogFlow` lets you group related logs under a specific business flow or transaction. A flow has a name, an ID and optional custom attributes. Pass the same flow to every log of one piece of work, such as one checkout or one payment, so the panel can show those logs together. ```swift let flow = LogFlow( name: "SuccessTransaction", id: transactionId, customAttributes: [ "amount": "149.90", "currency": "TRY" ] ) LogDrop.i("Transaction completed successfully.", logFlow: flow) ``` In the LogDrop panel you can filter and analyze logs by `flowName` and `flowId`. --- ## 8. Push Notification Integration (APNs) [#8-push-notification-integration-apns] LogDrop supports alert, rich, in-app, deep-link, internal-browser, and silent fetch-logs pushes through APNs. With push integrated, you can send messages to your users from **Push Notification** in the panel or from a Customer Journey. **Fetch Logs** in the panel also uses a silent push to ask a device to upload its logs. The panel needs your APNs credentials under **Settings → Push Backends**. ### 8.1. Permission and APNs Token [#81-permission-and-apns-token] iOS shows notifications only after the user grants permission, and APNs delivers pushes to a device by its device token. LogDrop needs this token to send pushes to the device. Request permission through LogDrop. When permission is granted, the SDK also registers the application for remote notifications. ```swift LogDrop.requestPushNotificationAuthorization() ``` Forward the APNs device token from `AppDelegate`: ```swift func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { LogDrop.onNewApnsToken(apnsToken: deviceToken) } ``` ### 8.2. Remote Notification Handling [#82-remote-notification-handling] Forward remote notification payloads delivered to the application. LogDrop distinguishes its own push payloads from silent fetch-logs commands internally. ```swift func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { LogDrop.onRemoteMessageReceived(userInfo) completionHandler(.noData) } ``` ### 8.3. Notification Service Extension and App Group [#83-notification-service-extension-and-app-group] A Notification Service Extension allows LogDrop to process and record an alert push even when the application is not running. The application and extension share the required state through an App Group. #### 8.3.1. Add the App Groups Capability [#831-add-the-app-groups-capability] An App Group lets your app and its extensions share data. Add it to the app target first. The App Group identifier is important because LogDrop uses it to share `UserDefaults` data between the application and the Notification Service Extension. 1. Select your **app target** in Xcode. 2. Open **Signing & Capabilities** and click **+ Capability**. 3. Add **App Groups**, then create a group identifier or select an existing one. ![Xcode App Groups capability configured for the app target](/sdk/ios/app-group-capability.jpeg) Pass the selected identifier to the main application configuration: ```swift let config = LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setBaseUrl("YOUR_BASE_URL") // Optional: for self-hosted LogDrop .setPushAppGroupSuiteName("group.com.yourcompany.yourapp") .build() LogDrop.initialize(with: config) ``` #### 8.3.2. Add a Notification Service Extension [#832-add-a-notification-service-extension] The extension is a separate target with its own LogDrop configuration. Create it, link the SDK, give it the same App Group as the app, and let its `NotificationService` class inherit from `LogDropNotificationServiceExtension`. 1. In Xcode, select **File → New → Target...**, then choose **Notification Service Extension**. ![Creating a new target in Xcode](/sdk/ios/new-extension-target.png) 2. Enter a product name, select your project, choose the application under **Embed in Application**, and click **Finish**. ![Notification Service Extension target options](/sdk/ios/notification-extension-options.png) 3. Select the newly created extension target and set its **Minimum Deployments** iOS version to the same value as the app target. ![Notification Service Extension minimum deployment setting](/sdk/ios/notification-extension-deployment.png) 4. Make sure `LogDropSDK` is linked to the extension target under **General → Frameworks and Libraries**. If you use CocoaPods, also add `pod 'LogDrop', :git => 'https://github.com/initialcodess/LogDrop-iOS.git'` to the extension target in your `Podfile` (the same line as in the app target) and run `pod install`. 5. Open the extension target's **Signing & Capabilities** tab, add **App Groups**, and select the same group identifier used by the app target. 6. Replace the generated `NotificationService.swift` implementation with: ```swift import LogDropSDK final class NotificationService: LogDropNotificationServiceExtension { override func logDropConfiguration() -> LogDropConfig? { LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setBaseUrl("YOUR_BASE_URL") // Optional: for self-hosted LogDrop .setPushAppGroupSuiteName("group.com.yourcompany.yourapp") .build() } } ``` > **Warning** > > Use the same App Group identifier in the app target, extension target, main application > configuration, and extension configuration. ### 8.4. Show a Pending In-App Push [#84-show-a-pending-in-app-push] An in-app message is a modal or banner that a LogDrop push shows inside your app. LogDrop keeps in-app popups and internal-browser actions from pushes in a queue until your app asks to show them. When the application's UI is ready, ask LogDrop to show any queued in-app popup or internal-browser action: ```swift LogDrop.showPendingPushPopup() ``` The method returns `LogDropPopupShowResult`, which can be used if the application needs to react to whether an item was shown, unavailable, or not pending. --- ## 9. User Identification (UUID Customization) [#9-user-identification-uuid-customization] By default, logs are tied to a device identifier. Set your own user ID when you want to find a user's data by that ID: you can then search for it as **User UUID** on the panel's **Devices** page. To associate logs with your own user ID: ```swift LogDrop.updateUser(userUuid: "user-1234@example.com") ``` You can use any stable, unique identifier: - Email address - Internal customer ID - Other application-specific user ID All subsequent logs will be associated with this user in the LogDrop panel. --- ## 10. Custom Events [#10-custom-events] Use custom events to track application-specific actions that are not covered by LogDrop's built-in events. Send a stable event name together with optional JSON-compatible properties. ### 10.1. Track a Custom Event [#101-track-a-custom-event] Call `trackCustomEvent` when the action happens in your app. Pass the event name and, if you need them, properties that describe this occurrence. ```swift LogDrop.trackCustomEvent( eventName: "purchase_completed", properties: [ "coupon_code": "SUMMER10", "amount": 49.9, "item_count": 2, "is_first_order": true ] ) ``` Properties are optional. To track an event without properties: ```swift LogDrop.trackCustomEvent(eventName: "onboarding_completed") ``` Provide only the readable event name and properties. Event and property codes shown in the panel are managed by LogDrop. ### 10.2. Supported Property Values [#102-supported-property-values] Custom properties may contain strings, numbers, booleans, `Date` values, `NSNull`, nested dictionaries, and arrays. Dictionary keys must be strings. ```swift LogDrop.trackCustomEvent( eventName: "product_viewed", properties: [ "sku": "LD-100", "viewed_at": Date(), "product": [ "name": "LogDrop Hoodie", "price": 79.95 ], "categories": ["merch", "hoodies"], "variants": [ ["color": "black", "size": "M"], ["color": "green", "size": "L"] ], "campaign": NSNull() ] ) ``` `Date` values are represented as ISO-8601 strings in LogDrop. Nested dictionaries and arrays remain structured values. ### 10.3. Naming and Property Types [#103-naming-and-property-types] LogDrop keeps one schema per event name, built from the properties you send. Follow these rules so the same action always lands in the same event, with the same property types: - Use stable and consistent names. For example, do not alternate between `purchase_completed` and `purchaseCompleted` for the same event. - Do not put IDs, timestamps, or other dynamic values in the event name. Add them as properties instead. - Do not use the name of a LogDrop default event for a custom event. - Keep each property's type stable. For example, always send `amount` as a number rather than sometimes sending a number and sometimes a string. - Reusing the same event name updates the same custom event schema. Changing the name creates a different custom event. > **Warning** > > If a property is later sent with a different type, LogDrop keeps the event but marks the > property as a type conflict in the panel. Type conflict tracking helps find integration > mistakes; it should not be used as a replacement for a stable event contract. ### 10.4. Limits and Validation [#104-limits-and-validation] The SDK checks each event on the device before sending it. An event that breaks any of these rules is not sent. - Event names can contain up to **128 characters**. - Property names can contain up to **128 characters**. - One event can contain up to **100 top-level properties**. - The complete properties JSON can contain up to **16 KB in UTF-8**, including property names, primitive values, nested objects, and arrays. - Event names and property names cannot be empty. - Property values must be JSON-compatible. > **Warning** > > If validation fails, the SDK rejects the complete event and writes the reason to the SDK > log. Names, properties, and payloads are never silently truncated. ### 10.5. Panel Behavior [#105-panel-behavior] No custom event definition is required before tracking. After the first valid event reaches LogDrop, the **Events** page shows the event, its generated code, observed properties, property types, and any type conflicts. You can then use the event in event details and Event Analytics funnels. --- ## 11. Custom User Attributes [#11-custom-user-attributes] Custom user attributes let you attach stable profile information to the current LogDrop device and use it for segment-based push targeting in the panel. Call the API after `LogDrop.initialize(with:)` has completed. Customer Journeys also use these attributes as the recipient phone and consent fields of SMS and WhatsApp steps. ### 11.1. Set or Update Attributes [#111-set-or-update-attributes] Pass the attribute keys with string values. Call it whenever a profile value changes. ```swift LogDrop.setCustomAttributes([ "plan_type": "premium", "country": "TR", "preferred_language": "tr" ]) ``` New attributes are merged with the values already stored by the SDK. Sending an existing key replaces its value; other keys remain unchanged. Valid changes are persisted locally and synchronized with LogDrop automatically. ### 11.2. Remove an Attribute [#112-remove-an-attribute] Remove a key when its value no longer applies to the device. ```swift LogDrop.removeCustomAttribute(key: "plan_type") ``` Removing a key also synchronizes the deletion with LogDrop, so the old value is no longer available for future segment targeting. ### 11.3. Limits and Validation [#113-limits-and-validation] The SDK checks each update on the device before it stores or sends it. - A device can have up to **30** custom attributes in total. - Keys must contain only letters, numbers, underscores (`_`), or hyphens (`-`). - Keys can contain up to **64 characters**. - Values must be non-blank strings containing up to **256 characters**. - If one entry in a call is invalid, the SDK rejects the complete update. - If the merged result would exceed 30 keys, the SDK keeps the previous attribute set unchanged. > **Note** > > Custom user attributes are different from `LogFlow.customAttributes`. User attributes > describe a device for audience targeting, while flow attributes add context only to the > logs recorded with that `LogFlow`. ### 11.4. Use Attributes in the Panel [#114-use-attributes-in-the-panel] After the device synchronizes, open **Push Notification → Send Push**, select **Segment** under Recipients, and build a filter with the attribute key. See [Segment Targeting with Custom Attributes](/docs/panel/push-notification/send-push#segment-targeting-with-custom-attributes). --- ## 12. Screen Tracking [#12-screen-tracking] From SDK 2.1.16, the SDK knows which screen the user is looking at. Each screen change is recorded as a `screen_view` event with the screen name (`screen_name`), the previous screen (`previous_screen_name`) and how the screen was detected (`screen_kind`). App Health uses the screen names to break performance metrics down by screen, and HTTP records show the screen a request started on. > **Note: App Health metrics** > > The SDK also sends app start time, slow and frozen frames, hangs, memory, CPU, battery, network > and HTTP timing metrics with each session for the panel's App Health page. They need no code. ### 12.1. UIKit View Controllers [#121-uikit-view-controllers] View controllers are tracked automatically, under their class name. Navigation, tab bar, page and split view controllers, alerts and other system view controllers, and SwiftUI hosting controllers are not tracked as screens. To give a view controller a stable name, or to leave it out, adopt `LogDropScreenNaming`: ```swift final class CheckoutViewController: UIViewController, LogDropScreenNaming { var logDropScreenName: String? { "Checkout" } // nil: not a screen } ``` ### 12.2. SwiftUI [#122-swiftui] SwiftUI views are not tracked automatically, because their hosting controllers' names say nothing about the content. Name each screen with the `logDropScreen(_:)` modifier; it tracks the screen when the view appears. ```swift struct CheckoutView: View { var body: some View { CheckoutContent() .logDropScreen("Checkout") } } ``` ### 12.3. Manual Screens [#123-manual-screens] For custom UIs, set the screen yourself. A `screen_view` is recorded when the name differs from the current screen. It can be called from any thread. ```swift LogDrop.trackScreen("ProductDetail") ``` - Keep screen names stable and free of user data: `ProductDetail`, not the product's name. - Names longer than 100 characters are cut; blank names are ignored. To name screens only with `trackScreen` and `logDropScreen(_:)`, turn automatic tracking off: ```swift let config = LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setAutomaticScreenTracking(false) .build() ``` --- ## 13. Troubleshooting [#13-troubleshooting] If data does not reach LogDrop, crash reports stay unreadable, or events and attributes are missing, check these common causes first. - Verify that `LOGDROP_API_KEY` (or `LOGDROP_APP_ID`) and `LOGDROP_BASE_URL` are correctly set. - Make sure the dSYM upload Run Script is at the **bottom** of the Build Phases list. - Check the Xcode build log for any errors from `upload_dsym.sh`. - Confirm that custom event names do not match LogDrop default event names. - Check SDK logs when a custom event is missing; invalid names, properties, or oversized payloads are rejected locally. - Check SDK logs when custom user attributes are missing; invalid updates and updates exceeding 30 keys are rejected locally. - In development, enable verbose SDK logging with: ```swift .setLoggingEnabled(true) ``` # Tracing (/docs/sdk/ios/tracing) The iOS SDK adds a W3C `traceparent` header to every URLSession request it tracks and sends each request as one client span, so the request and the backend spans it causes form one trace in LogDrop. Nothing changes in your init code. Rules that all LogDrop mobile SDKs share (authentication, which requests are traced, delivery and limits) are on [End-to-end Tracing](/docs/sdk/tracing). ## 1. Use SDK 2.1.11 or later [#1-use-sdk-2111-or-later] Tracing is part of the iOS SDK from version 2.1.11, so you only need to update the SDK. Earlier versions do not trace requests. With Swift Package Manager, use `https://github.com/initialcodess/LogDrop-iOS` at 2.1.11 or later. With CocoaPods, install from the LogDrop-iOS git repository and run `pod update LogDrop` in an existing project. See [SDK Installation](/docs/sdk/ios#1-sdk-installation). ## 2. Initialize as usual [#2-initialize-as-usual] Tracing needs no extra code. The usual initialization below is enough. ```swift import LogDropSDK let config = LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setBaseUrl("YOUR_BASE_URL") // optional: self-hosted LogDrop .build() LogDrop.initialize(with: config) ``` Initialize in `application(_:didFinishLaunchingWithOptions:)`, or in your `App` initializer, before the app makes requests. The App ID is all the SDK needs: it sends spans to `/v1/traces` (by default `https://server.logdrop.io/v1/traces`) with the header `x-logdrop-app-id`. Turn on **HTTP Logging** for the project in the panel; tracing starts as soon as the SDK has LogDrop's confirmed settings. `service.name` is your bundle identifier, and the service version is your app's version. No Info.plist entry or background mode is needed for tracing. Your backend must send its traces to the **same LogDrop project** as this app, with an ingest key created in the app's project ([why](/docs/sdk/tracing#what-you-need)). ## What is traced [#what-is-traced] The SDK traces only requests made through the networking APIs it instruments. This section lists which iOS requests get a `traceparent` header and a span. - URLSession requests on `URLSession.shared` and on sessions created with the `default` or `ephemeral` configuration, which covers most networking libraries (Alamofire and similar build on these). - Not traced: background sessions (`URLSessionConfiguration.background`), sessions whose `protocolClasses` your app replaces, and requests made inside a `WKWebView`. - Each redirect is its own span in the same trace, and every hop is checked against the ignore rules again; an ignored hop is sent without the header. - Both **Ignored domains** (the host and its subdomains) and **Ignored host and path rules** stop tracing. The other rules are in [Which requests are traced](/docs/sdk/tracing#which-requests-are-traced). ## Delivery [#delivery] The SDK does not send a span the moment a request ends. It queues spans on the device and sends them in batches, so spans recorded offline are sent later. You do not need to do anything; this section explains the timing and limits on iOS. Spans are kept in an encrypted queue (AES-GCM with a Keychain key, at most 1,000 spans). About 15 seconds after the first span is queued, the SDK sends them when the network is available, in requests of at most 50 spans and about 48 KiB, split so that one request never holds spans that start in more than 32 different minutes. When the app moves to the background, the SDK asks iOS for a little time to finish sending; anything left goes out on the next launch. A 400 answer drops the request. 408, 425, 429, 5xx and transport failures are retried after 10 and then 20 seconds, 3 attempts in all, also across an app restart; newer spans wait until that request is resolved. Spans older than about 7 days or more than 5 minutes ahead of the device clock are dropped before sending, also when a waiting request is resent. Other error answers, and successful answers that cannot be read, drop the request. ## Send queued spans now (optional) [#send-queued-spans-now-optional] The SDK sends spans on its own. Call `flushOtlpTracing` only where you need the queued spans sent right away, for example at the end of an integration test or before the user signs out. ```swift LogDrop.flushOtlpTracing { delivered in // Runs on the main queue. true: the queue was delivered and no span was lost since the previous flush. } ``` The flush waits for the first network status. It has no timeout of its own: each request can take up to 10 seconds, and a backlog is sent request by request before the completion reports `true`. While a request waits for its retry, the device is offline, or HTTP Logging is not confirmed, the completion reports `false`; the spans are still sent later. Objective-C callers use `logDropFlushOtlpTracing:` with an `NSNumber` completion. ## Changing the App ID [#changing-the-app-id] This applies only if your app switches to another LogDrop project at runtime. The SDK makes sure no span is sent with the wrong project's App ID. `LogDrop.setAppId(...)` keeps only the new project's spans. A request already on its way finishes under its own App ID; export pauses until the SDK has the new project's settings, and the next request carries only spans of the new project. ## Disabling [#disabling] Tracing runs only while the SDK is enabled and HTTP Logging is on for the project. This is what happens to queued spans when either is turned off. Disabling the SDK or HTTP Logging clears the queue once the SDK has LogDrop's confirmed configuration. Before that (on the first launch, or after a new App ID), export only pauses. ## Check it [#check-it] After setup, make one test request to confirm that the device span and the backend spans show up in the same trace. Follow [Check it](/docs/sdk/tracing#check-it). In a proxy such as Charles or Proxyman, the outgoing request carries `traceparent: 00---01`; the same trace ID is in Trace Explorer under your bundle identifier. ## Known limits [#known-limits] On iOS, some requests are traced differently from what you might expect. Check these cases when a trace looks incomplete or a request starts a new trace. - **URLSession's own retries share one client span.** When a reused connection closes before any response, URLSession may resend an idempotent request by itself. The SDK cannot see that retry, so both attempts carry the same `traceparent`: the trace stays connected, but the device side shows one attempt. - **Ignore rules on later launches.** The SDK learns the ignore rules from the project's settings on each launch. Requests sent before the settings arrive can carry `traceparent` even to ignored hosts, and are sent as spans. - The device clock must not run more than 5 minutes ahead of LogDrop's; otherwise the request is refused and its spans are lost. - Requests your app retries itself start a new trace. # Changelog (/docs/sdk/react-native/changelog) {/* AGENT/MAINTAINER NOTE — this file is parsed by scripts/generate-sdk-release-feed.js and consumed by the CRM SDK release campaign sync. Required format: 1. The newest release must be the first `##` heading in this file. 2. Every release must have its own `##` heading. Put every artifact version released together in that heading using full `x.y.z` semver. Single artifact: `## React Native SDK 2.1.0` Combined release: `## React Native SDK 2.1.0 / React Native Android Gradle Plugin 1.1.0` All versions in a combined heading become part of the campaign deduplication key. 3. The release date must be the first metadata line and must keep this exact shape: `Released: **YYYY-MM-DD**` 4. End the release entry with a standalone `---` before the previous release. 5. Do not add an introductory or unreleased `##` section above the newest release. Historical release `##` headings and lower-level headings inside a release are safe. 6. Keep release notes customer-facing. Describe observable features, fixes, compatibility changes, upgrade requirements, and public APIs. Do not include internal class or method names, source-code mechanics, test/reproduction setup, or implementation-only details unless users need them to take action. Changing this contract can prevent the wiki build or CRM changelog sync from working. Do not edit public/sdk-releases.json manually; it is generated during the wiki build. */} ## React Native SDK 2.2.0 [#react-native-sdk-220] Released: **2026-11-27** ### New Features [#new-features] - Screen tracking: `LogDrop.trackScreen(name)` sets the current screen. For React Navigation, `createLogDropNavigationTracker(navigationRef)` returns `onReady` and `onStateChange` handlers for `NavigationContainer`; pass `{ screenName }` to rename or skip routes. - Native automatic screen tracking is off by default, because it mostly sees the React Native host screen. Turn it on with `setAutomaticScreenTracking(true)` on `LogDropConfigBuilder` (iOS) or `automaticScreenTracking(true)` on `LogDropReactNativeConfig.Builder` (Android). - App Health: the native SDKs send app start time, slow and frozen frames, freezes, memory, CPU, battery, network and HTTP timing metrics with each session for the panel's new App Health page. No code changes are needed. - Guide: [React Native Screen Tracking](/docs/sdk/react-native#12-screen-tracking) ### Bug Fixes [#bug-fixes] - iOS: when `LogDrop.init` runs after the app is already on screen, the session starts right away. - Native LogDrop Android SDK 2.1.16 and iOS SDK 2.1.16. The native iOS SDK now requires iOS 15.0; this package already required iOS 15.1, so no project change is needed. --- ## React Native SDK 2.1.9 [#react-native-sdk-219] Released: **2026-11-25** ### Bug Fixes [#bug-fixes-1] - iOS: HTTP Logging is stable on iOS 16 and earlier. Recommended update for apps that support these iOS versions. - Native LogDrop Android SDK 2.1.15 and iOS SDK 2.1.15. --- ## React Native SDK 2.1.8 [#react-native-sdk-218] Released: **2026-11-20** ### Improvements [#improvements] - iOS Notification Service Extension: the extension can use the iOS SDK that ships with this package. In your `Podfile`, replace `pod 'LogDrop', ''` in the extension target once with `pod 'LogDrop', :path => '../node_modules/@log-drop/react-native/ios-sdk'`. The extension then always matches your app and needs no version updates. ### Bug Fixes [#bug-fixes-2] - iOS: calls made right after `LogDrop.init` are applied. - JavaScript errors: non-fatal errors are reported on Android as well, unhandled promise rejections are captured, and error messages are included. - `LogFlow` custom attributes passed as a `Map` are kept. - Pending push popups are shown from the main thread. - Native LogDrop Android SDK 2.1.15 and iOS SDK 2.1.14. Recommended update. --- ## React Native SDK 2.1.7 [#react-native-sdk-217] Released: **2026-11-19** ### Improvements [#improvements-1] - iOS: the native LogDrop iOS SDK now ships inside the package and is installed by `pod install`. No Podfile or Xcode changes are needed. ### Bug Fixes [#bug-fixes-3] - Native LogDrop Android SDK 2.1.14 and iOS SDK 2.1.13. Recommended update. --- ## React Native SDK 2.1.5 [#react-native-sdk-215] Released: **2026-11-18** ### Bug Fixes [#bug-fixes-4] - Android: native LogDrop Android SDK 2.1.13, with more reliable log storage after uploads and smaller uploads. iOS stays on native SDK 2.1.12. --- ## React Native SDK 2.1.4 [#react-native-sdk-214] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-5] - iOS: native LogDrop iOS SDK 2.1.12. With HTTP Logging on, repeated `fetch` and `XMLHttpRequest` requests for cacheable responses are served from the HTTP cache again instead of going to the network, and memory used by finished requests is released. React Native SDK 2.1.3 and earlier did not use the cache for these requests on iOS. --- ## React Native SDK 2.1.3 [#react-native-sdk-213] Released: **2026-11-13** ### Bug Fixes [#bug-fixes-6] - Android: native LogDrop Android SDK 2.1.12. Requests made with `fetch` and `XMLHttpRequest` are recorded again when they fail before they reach the server (DNS failures, refused or timed-out connections, TLS errors) or are served from the HTTP cache. Bodies of gzip-compressed responses are captured again. React Native SDK 2.1.2 did not record these on Android. --- ## React Native SDK 2.1.2 [#react-native-sdk-212] Released: **2026-11-12** ### New Features [#new-features-1] #### End-to-end Tracing [#end-to-end-tracing] - Requests made with `fetch`, `XMLHttpRequest` and libraries built on them, such as axios, carry a W3C `traceparent` header and are sent to LogDrop as trace spans by the native SDKs. On Android, the LogDrop Gradle plugin must be applied. - Added `LogDrop.flushOtlpTracing(timeoutMs)` to send queued spans on demand. - Guide: [React Native Tracing](/docs/sdk/react-native/tracing) ### Improvements [#improvements-2] #### Native SDK Updates [#native-sdk-updates] - Updated the Android SDK to `2.1.11`. See the [Android SDK 2.1.11 changelog](/docs/sdk/android/changelog#android-sdk-2111). - Updated the iOS SDK to `2.1.11`. See the [iOS SDK 2.1.11 changelog](/docs/sdk/ios/changelog#2111). --- ## React Native SDK 2.1.1 [#react-native-sdk-211] Released: **2026-10-27** ### Improvements [#improvements-3] #### Native SDK Updates [#native-sdk-updates-1] - Updated the Android SDK to `2.1.10`. See the [Android SDK 2.1.10 changelog](/docs/sdk/android/changelog#android-sdk-2110). - Updated the iOS SDK to `2.1.10`. See the [iOS SDK 2.1.10 changelog](/docs/sdk/ios/changelog#2110). - Custom event and property names must now follow the native SDK naming rules. Events with invalid names are rejected. --- ## React Native SDK 2.1.0 [#react-native-sdk-210] Released: **2026-10-07** ### Improvements [#improvements-4] #### Native SDK Updates [#native-sdk-updates-2] - Updated the Android SDK to `2.1.9`. See the [Android SDK 2.1.9 changelog](/docs/sdk/android/changelog#android-sdk-219). - Updated the iOS SDK to `2.1.9`. See the [iOS SDK 2.1.9 changelog](/docs/sdk/ios/changelog#219). --- ## React Native SDK 2.0.9 [#react-native-sdk-209] Released: **2026-09-17** ### Improvements [#improvements-5] #### iOS Crash Symbolication [#ios-crash-symbolication] - Improved iOS crash symbolication for React Native applications. - Added symbolication support for Debug and simulator builds. - Updated the iOS integration guide with the required dSYM and source map configuration. - Guide: [React Native iOS Setup](/docs/sdk/react-native#12-ios-setup) --- ## React Native SDK 2.0.8 [#react-native-sdk-208] Released: **2026-09-16** ### New Features [#new-features-2] #### Custom Events [#custom-events] - Added `LogDrop.trackCustomEvent(...)` for tracking application-specific events with optional JSON-compatible properties. - Added support for strings, numbers, booleans, null values, nested objects, and arrays. - Guide: [React Native Custom Events](/docs/sdk/react-native#10-custom-events) ### Improvements [#improvements-6] #### React Native 0.86 and Expo SDK 57 Compatibility [#react-native-086-and-expo-sdk-57-compatibility] - Added compatibility with React Native 0.86 and Expo SDK 57. - Improved Android and iOS development-build compatibility. #### Native SDK Updates [#native-sdk-updates-3] - Updated the Android SDK to `2.1.8`. See the [Android SDK 2.1.8 changelog](/docs/sdk/android/changelog#android-sdk-218). - Updated the iOS SDK to `2.1.8`. See the [iOS SDK 2.1.8 changelog](/docs/sdk/ios/changelog#218). --- ## React Native SDK 2.0.7 [#react-native-sdk-207] Released: **2026-09-07** ### New Features [#new-features-3] #### Custom User Attributes [#custom-user-attributes] - Added `LogDrop.setCustomAttributes(...)` and `LogDrop.removeCustomAttribute(...)` for custom profile attributes. - Added support for segment-based push targeting using attributes synchronized through the native SDKs. - Updated the bundled native SDKs to Android `2.1.6` and iOS `2.1.7`. - Guide: [React Native Custom User Attributes](/docs/sdk/react-native#11-custom-user-attributes) --- ## React Native SDK 2.0.6 [#react-native-sdk-206] Released: **2026-07-28** ### Improvements [#improvements-7] #### Native SDK Updates [#native-sdk-updates-4] - Updated the Android SDK to `2.1.3`. See the [Android SDK 2.1.3 changelog](/docs/sdk/android/changelog#android-sdk-213). - Updated the iOS SDK to `2.1.4`. See the [iOS SDK 2.1.4 changelog](/docs/sdk/ios/changelog#214). --- ## React Native SDK 2.0.5 / React Native Android Gradle Plugin 1.0.4 [#react-native-sdk-205--react-native-android-gradle-plugin-104] Released: **2026-07-27** ### Improvements [#improvements-8] #### App ID Support [#app-id-support] - Added App ID support to the SDK configuration and React Native Android Gradle Plugin. #### Push Notification Integration [#push-notification-integration] - Added bridge APIs for forwarding push messages and device tokens to LogDrop. - Added LogDrop push detection and pending push popup support. - Guide: [React Native Push Notification Integration](/docs/sdk/react-native#7-push-notification-integration) #### Manual Deep Link Integration [#manual-deep-link-integration] - Added manual deep link tracking for app-managed navigation flows. - After the application resolves an incoming URL, forward it to `LogDrop.trackDeepLink(url)`. - Apply this for both initial and already-running link deliveries. - Guide: [React Native Deep Links](/docs/sdk/react-native#8-deep-links) #### Native SDK Updates [#native-sdk-updates-5] - Updated the Android SDK to `2.1.2`. See the [Android SDK changelog](/docs/sdk/android/changelog). - Updated the iOS SDK to `2.1.3`. See the [iOS SDK changelog](/docs/sdk/ios/changelog). # LogDrop React Native SDK (/docs/sdk/react-native) The LogDrop React Native SDK provides a JavaScript/TypeScript API on top of the native iOS and Android SDKs. You initialize LogDrop once in your React Native app and it forwards logs, crashes and network data to the LogDrop backend. --- ## 1. SDK Installation [#1-sdk-installation] The React Native SDK runs on the native iOS and Android SDKs, so setup has three parts: the npm package for your JavaScript code, then the iOS project and the Android project. The native steps also set up the uploads of symbol files and source maps, which make crash reports from release builds readable. ### 1.1. Add the npm package [#11-add-the-npm-package] The `@log-drop/react-native` package gives your JavaScript and TypeScript code the LogDrop API. Using **yarn**: ```bash yarn add @log-drop/react-native ``` or using **npm**: ```bash npm install @log-drop/react-native --save ``` ### 1.2. iOS setup [#12-ios-setup] On iOS, the package uses the native LogDrop iOS SDK, which CocoaPods installs. You then tell the build which LogDrop project the app belongs to and add the uploads that make iOS crash reports readable. Install the native dependencies from the `ios` folder: ```bash cd ios pod install cd .. ``` #### Configure the LogDrop project [#configure-the-logdrop-project] `LogDrop-Services.plist` maps each bundle identifier to the App ID of its LogDrop project. The upload scripts below read the base URL and the App ID from this file. Create `ios/LogDrop-Services.plist`. Replace `com.example.app` with the target's bundle identifier and `YOUR_LOGDROP_APP_ID` with the **Mobile SDK App ID** from **Project Settings → App ID** in the LogDrop panel. ```xml base_url https://server.logdrop.io projects com.example.app app_id YOUR_LOGDROP_APP_ID ``` Add another entry under `projects` for each bundle identifier that uses a different LogDrop project, such as development and production targets. #### Generate the React Native source map [#generate-the-react-native-source-map] A source map links the bundled JavaScript back to your source files. LogDrop needs it to show file names, functions and line numbers for the JavaScript frames of a crash. In **Build Phases → Bundle React Native code and images**, add this line before the standard React Native bundle command: ```sh export EXTRA_PACKAGER_ARGS="--sourcemap-output $CONFIGURATION_BUILD_DIR/main.jsbundle.map" ``` #### Upload dSYMs and source maps [#upload-dsyms-and-source-maps] dSYM files hold the debug symbols of your native iOS code. With the dSYM and the source map uploaded, LogDrop shows readable stack traces for both native and JavaScript frames. Add a Run Script phase after **Bundle React Native code and images**. The native dSYM and React Native source map are separate artifacts, so run both upload scripts: ```sh set -e SERVICES_PLIST="${SRCROOT}/LogDrop-Services.plist" export LOGDROP_BASE_URL=$(/usr/libexec/PlistBuddy -c "Print :base_url" "$SERVICES_PLIST" 2>/dev/null) export LOGDROP_API_KEY=$(/usr/libexec/PlistBuddy -c "Print :projects:${PRODUCT_BUNDLE_IDENTIFIER}:app_id" "$SERVICES_PLIST" 2>/dev/null) export REACT_NATIVE_PATH="${SRCROOT}/../node_modules/react-native" WITH_ENVIRONMENT="${REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh" UPLOAD_DSYM_SCRIPT="${PODS_ROOT}/LogDrop/upload_dsym.sh" UPLOAD_RN_IOS_SCRIPT="${SRCROOT}/../node_modules/@log-drop/react-native/scripts/upload_rn_ios.sh" /bin/sh "$UPLOAD_DSYM_SCRIPT" /bin/sh -c "\"$WITH_ENVIRONMENT\" \"$UPLOAD_RN_IOS_SCRIPT\"" ``` Add all of these paths under the Run Script phase's **Input Files**: ```text ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME} ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist $(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH) $(SRCROOT)/.xcode.env.local $(SRCROOT)/.xcode.env $(SRCROOT)/LogDrop-Services.plist ``` > **Note** > > `upload_rn_ios.sh` reads `base_url` and the current bundle identifier's `app_id` > from `LogDrop-Services.plist`, matching the native `upload_dsym.sh` configuration. > `LOGDROP_APP_ID` or `LOGDROP_API_KEY` can override the App ID when needed. React > Native source maps are uploaded for Debug and simulator builds as well as Release > device builds. ### 1.3. Android setup [#13-android-setup] On Android, the package uses the native LogDrop Android SDK. You add the LogDrop repositories, apply the LogDrop Gradle plugins that upload ProGuard/R8 mapping files and React Native source maps, and start the SDK in native code. In your project-level `android/build.gradle` (or `android/settings.gradle`), make sure the LogDrop repositories are included: ```groovy allprojects { repositories { google() maven { url "https://artifactory.logdrop.io/repository/android-logdrop-sdk/" } maven { url "https://artifactory.logdrop.io/repository/logdrop-gradle-plugin/" } mavenCentral() } } ``` Add the plugin classpaths inside the `buildscript.dependencies` block of `android/build.gradle`: ```groovy dependencies { classpath "com.android.tools.build:gradle:x.x.x" classpath "io.logdrop.gradle:plugin:1.1.3" classpath "io.logdrop.gradle:rnplugin:1.0.4" } ``` Apply the plugins in `android/app/build.gradle` to automate ProGuard mapping and React Native JS sourcemap uploads: ```groovy apply plugin: "io.logdrop.gradle.plugin" apply plugin: "io.logdrop.gradle.plugin.rn" ``` Create a file named `logdrop-services.json` in your `android/app` directory. It tells the LogDrop Gradle plugin which LogDrop project and App ID belong to your application ID: ```json { "base_url": "https://server.logdrop.io", "projects": { "com.yourcompany.yourapp": { "app_id": "YOUR_LOGDROP_APP_ID" } } } ``` Initialize LogDrop natively in your `MainApplication.kt` during `onCreate()` (since Android initializes on the native thread): ```kotlin override fun onCreate() { super.onCreate() val config = LogDropReactNativeConfig.Builder(this) .appId("YOUR_APP_ID") .baseUrl("YOUR_BASE_URL") .logcatEnabled(true) .build() LogDropReactNative.initLogDrop(config) } ``` --- ## 2. Initialization [#2-initialization] Initialization connects the SDK to your LogDrop project through the App ID and starts collecting crashes, logs and network data. On iOS, `LogDrop.init` also starts the native SDK; on Android, the native SDK starts in `MainApplication.kt`, as shown in [Android setup](#13-android-setup). Initialize LogDrop **before** rendering your main React component, so that errors during startup are captured. In `index.js` or `App.tsx` (early in app startup): ```ts import { AppRegistry } from 'react-native'; import App from './App'; import { LogDrop, LogDropConfigBuilder } from '@log-drop/react-native'; async function bootstrap() { const config = new LogDropConfigBuilder() .setAppId('YOUR_APP_ID') .setBaseUrl('YOUR_BASE_URL') // Optional: for self-hosted LogDrop .setLoggingEnabled(true) .build(); LogDrop.init(config); AppRegistry.registerComponent('YourApp', () => App); } bootstrap(); ``` > **Note** > > The native iOS and Android SDKs handle native crashes; the React Native layer adds JS error capture on top. > **Note: End-to-end tracing** > > From SDK 2.1.2, requests made with `fetch` and `XMLHttpRequest` also carry a W3C `traceparent` header, so you can follow them into a backend traced by LogDrop. See [Tracing](/docs/sdk/react-native/tracing). --- ## 3. LogDropConfig Overview [#3-logdropconfig-overview] `LogDropConfig` is the configuration you pass to `LogDrop.init`. It holds the App ID, the base URL (only for a self-hosted LogDrop), SDK logging and, on iOS, the App Group used for push. Some behavior, such as crash tracking, is not set in code: you turn it on or off in the panel under **Settings → App Config**. Key configuration fields (JavaScript/TypeScript): ```ts interface LogDropConfig { appId: string; baseUrl: string; isLoggingEnabled: boolean; defaultSDKDisabled: boolean; pushAppGroupSuiteName?: string; // iOS only automaticScreenTracking?: boolean; // iOS only, default false } ``` Use `new LogDropConfigBuilder()` to construct the configuration options and pass the result to `LogDrop.init(config)`. --- ## 4. Crash Tracking [#4-crash-tracking] Crash tracking reports crashes to LogDrop with their stack traces, without any call from your code. You review them in the panel's [Crash Reports](/docs/panel/crashes). Crash tracking is composed of: 1. **Native iOS/Android crashes** – handled by the underlying native SDKs. 2. **JavaScript errors** – captured and reported automatically on calling `LogDrop.init(...)` via global error hooks. On iOS, native frames require the dSYM and JavaScript frames require the React Native source map. Configure both uploads in the [iOS setup](#12-ios-setup). On Android, the LogDrop Gradle plugins upload ProGuard/R8 mappings and React Native source maps. --- ## 5. Logging Methods [#5-logging-methods] Logging methods record your own messages in LogDrop, so you can see what the app did before a problem. Use the LogDrop logging methods anywhere in your React Native code. After upload, the logs appear on the panel's [Logs](/docs/panel/logs) page. ### 5.1. Basic logging [#51-basic-logging] Each method sets the level: `e` for error, `w` for warning, `i` for info and `d` for debug. Pass a tag that names the part of the app, the message and, optionally, a [`LogFlow`](#6-logflow). ```ts import { LogDrop } from '@log-drop/react-native'; LogDrop.e('Payment', 'Payment failed'); // Error LogDrop.w('Network', 'Slow network'); // Warning LogDrop.i('Auth', 'User logged in'); // Info LogDrop.d('Parser', 'Parsing response'); // Debug // With flow import { LogFlow } from '@log-drop/react-native'; const flow = new LogFlow( 'SuccessTransaction', transactionId, new Map([ ['amount', '149.90'], ['currency', 'TRY'] ]) ); LogDrop.i('Transaction', 'Transaction completed successfully.', flow); ``` ### 5.2. Sending logs [#52-sending-logs] Logs are buffered locally on the device. To force an upload to the server: ```ts LogDrop.sendLogs(); ``` - Schedules a background job that runs approximately 60 seconds later. - If a job is already scheduled or running, additional calls do not create new jobs. --- ## 6. LogFlow [#6-logflow] `LogFlow` allows you to group related logs into a single business flow or transaction. A flow has a name, an ID and optional attributes. Pass the same flow to every log of one piece of work, such as one checkout, so the panel can show those logs together. ```ts const checkoutFlow = new LogFlow( 'CartCheckout', checkoutId, new Map([ ['itemsCount', String(items.length)], ['total', totalPrice.toFixed(2)], ['currency', 'TRY'] ]) ); LogDrop.i('Checkout', 'Checkout started.', checkoutFlow); LogDrop.i('Checkout', 'Payment screen opened.', checkoutFlow); LogDrop.i('Checkout', 'Checkout completed.', checkoutFlow); ``` In the LogDrop panel you can filter and analyze logs by `flowName` and `flowId`. --- ## 7. Push Notification Integration [#7-push-notification-integration] With push integrated, you can send alert, rich, in-app, deep-link and internal-browser messages to the app from the panel. The panel's [Fetch Logs](/docs/panel/fetch-logs) also uses a silent LogDrop push to ask a device to upload its logs. For this, the app passes its push token and LogDrop's messages to the SDK. The React Native SDK does not install a push provider. Keep the application's existing provider and forward its token and messages identified by `LogDrop.isLogDropPush(...)` to the bridge. ### 7.1. Android with React Native Firebase [#71-android-with-react-native-firebase] On Android, LogDrop pushes arrive through Firebase Cloud Messaging (FCM). The SDK needs the device's FCM token to reach the device, and each LogDrop message to show it or to run a fetch-logs request. `LogDrop.isLogDropPush(...)` picks out LogDrop's messages, so your app's other messages are left alone. With `@react-native-firebase/messaging`, register the background handler at module scope. Forward LogDrop messages from both foreground and background handlers, and register both the current FCM token and future token updates. ```ts import { getMessaging, getToken, onMessage, onTokenRefresh, setBackgroundMessageHandler, type FirebaseMessagingTypes, } from '@react-native-firebase/messaging'; import { LogDrop } from '@log-drop/react-native'; const messaging = getMessaging(); const logDropData = ( data: FirebaseMessagingTypes.RemoteMessage['data'] ): Record => Object.fromEntries( Object.entries(data ?? {}).filter( (entry): entry is [string, string] => typeof entry[1] === 'string' ) ); async function forwardLogDropMessage( message: FirebaseMessagingTypes.RemoteMessage ) { const data = logDropData(message.data); if (await LogDrop.isLogDropPush(data)) { LogDrop.onRemoteMessageReceived(data); } } setBackgroundMessageHandler(messaging, forwardLogDropMessage); export async function registerLogDropPushHandlers() { onTokenRefresh(messaging, LogDrop.onNewFcmPushToken); onMessage(messaging, forwardLogDropMessage); LogDrop.onNewFcmPushToken(await getToken(messaging)); } ``` Import the module during startup and call `registerLogDropPushHandlers()` after `LogDrop.init(config)`. For a native FCM or HMS integration, use the equivalent methods exposed by `LogDropReactNative`. ### 7.2. iOS APNs Forwarding [#72-ios-apns-forwarding] On iOS, LogDrop pushes arrive through Apple Push Notification service (APNs). The SDK needs the APNs device token to reach the device, and the remote notifications to handle LogDrop's messages, including silent fetch-logs requests. iOS does not require a Firebase dependency. Forward the APNs token and remote notifications from `AppDelegate`: ```swift import LogDropSDK override func application( _ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data ) { LogDrop.onNewApnsToken(apnsToken: deviceToken) } override func application( _ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void ) { LogDrop.onRemoteMessageReceived(userInfo) completionHandler(.newData) } ``` If the application's messaging library exposes the APNs token as hexadecimal text, forward it from JavaScript with `LogDrop.onNewApnsToken(token)` instead. ### 7.3. iOS Notification Service Extension [#73-ios-notification-service-extension] A Notification Service Extension lets LogDrop process and record an alert push even when the app is not running. The app and the extension share data through an App Group, so both must use the same App Group identifier. Complete the [iOS Notification Service Extension and App Group setup](/docs/sdk/ios#83-notification-service-extension-and-app-group). Pass the same App Group identifier from the React Native configuration: > **Note** > > In a React Native app, add LogDrop to the extension target with the iOS SDK that ships with > `@log-drop/react-native`, then run `pod install`. It always matches your app's version: > > ```ruby > target 'NotificationServiceExtension' do > pod 'LogDrop', :path => '../node_modules/@log-drop/react-native/ios-sdk' > end > ``` ```ts const config = new LogDropConfigBuilder() .setAppId('YOUR_APP_ID') .setBaseUrl('YOUR_BASE_URL') .setPushAppGroupSuiteName('group.com.yourcompany.yourapp') .build(); ``` Use the matching value in the extension configuration: ```swift import LogDropSDK final class NotificationService: LogDropNotificationServiceExtension { override func logDropConfiguration() -> LogDropConfig? { LogDropConfig.Builder() .setAppId("YOUR_APP_ID") .setBaseUrl("YOUR_BASE_URL") // Optional: for self-hosted LogDrop .setPushAppGroupSuiteName("group.com.yourcompany.yourapp") .build() } } ``` ### 7.4. Show a Pending Push Action [#74-show-a-pending-push-action] In-app messages and internal-browser pushes open inside your app, not in the notification tray. LogDrop keeps them in a queue until your app asks to show them. Ask LogDrop to present a queued in-app popup or internal-browser action when the application starts and whenever it becomes active: ```tsx import { useEffect } from 'react'; import { AppState } from 'react-native'; useEffect(() => { const showPendingPushAction = () => { void LogDrop.showPendingPushPopup(); }; showPendingPushAction(); const subscription = AppState.addEventListener('change', state => { if (state === 'active') { showPendingPushAction(); } }); return () => subscription.remove(); }, []); ``` --- ## 8. Deep Links [#8-deep-links] A deep link opens a specific screen of your app from a link, a LogDrop push or an in-app message. Your app does the routing; forwarding the URL lets LogDrop track the deep link. Keep routing links through the application's existing React Native navigation. After the application receives and resolves a URL, forward that URL once to LogDrop: ```ts LogDrop.trackDeepLink(url); ``` Use the same call for initial and already-running link deliveries. --- ## 9. User Identification (UUID Customization) [#9-user-identification-uuid-customization] By default, logs are tied to a device identifier. Set your own user ID, for example after the user signs in, when you want to find that user's data in the panel. You can then search for it as **User UUID** on the Devices page. To associate logs with your own user ID: ```ts LogDrop.userUpdate('user-1234@example.com'); ``` You can use any stable, unique identifier, for example: - Email address - Internal customer ID - Other application-specific user ID All subsequent logs will be associated with this user in the LogDrop panel. --- ## 10. Custom Events [#10-custom-events] Use custom events to track application-specific actions that are not covered by LogDrop's built-in events. Send a stable event name together with optional JSON-compatible properties. You do not need to set anything up in the panel first. ### 10.1. Track a Custom Event [#101-track-a-custom-event] Call `trackCustomEvent` when the action happens, with the event name and, optionally, an object of properties that describe it. ```ts LogDrop.trackCustomEvent('purchase_completed', { coupon_code: 'SUMMER10', amount: 49.9, item_count: 2, is_first_order: true, }); ``` Properties are optional. To track an event without properties: ```ts LogDrop.trackCustomEvent('onboarding_completed'); ``` Provide only the readable event name and properties. Event and property codes shown in the panel are managed by LogDrop. ### 10.2. Supported Property Values [#102-supported-property-values] Custom properties may contain strings, numbers, booleans, null, nested objects, and arrays. Object keys must be strings. ```ts LogDrop.trackCustomEvent('product_viewed', { sku: 'LD-100', viewed_at: new Date().toISOString(), product: { name: 'LogDrop Hoodie', price: 79.95, }, categories: ['merch', 'hoodies'], variants: [ { color: 'black', size: 'M' }, { color: 'green', size: 'L' }, ], campaign: null, }); ``` React Native's native-module bridge accepts JSON-compatible values. Convert JavaScript `Date` instances to ISO-8601 strings before passing them. Nested objects and arrays remain structured values. ### 10.3. Naming and Property Types [#103-naming-and-property-types] LogDrop groups custom events by name and records the type of each property. Follow these rules so that one action always arrives as the same event, with the same property types. - Use stable and consistent names. For example, do not alternate between `purchase_completed` and `purchaseCompleted` for the same event. - Do not put IDs, timestamps, or other dynamic values in the event name. Add them as properties instead. - Do not use the name of a LogDrop default event for a custom event. - Keep each property's type stable. For example, always send `amount` as a number rather than sometimes sending a number and sometimes a string. - Reusing the same event name updates the same custom event schema. Changing the name creates a different custom event. > **Warning** > > If a property is later sent with a different type, LogDrop keeps the event but marks the > property as a type conflict in the panel. Type conflict tracking helps find integration > mistakes; it should not be used as a replacement for a stable event contract. ### 10.4. Limits and Validation [#104-limits-and-validation] The native SDK checks every event against these limits before it sends the event. - Event names can contain up to **128 characters**. - Property names can contain up to **128 characters**. - One event can contain up to **100 top-level properties**. - The complete properties JSON can contain up to **16 KB in UTF-8**, including property names, primitive values, nested objects, and arrays. - Event names and property names cannot be empty. - Property values must be JSON-compatible. > **Warning** > > If validation fails, the native SDK rejects the complete event and writes the reason to > the SDK log. Names, properties, and payloads are never silently truncated. ### 10.5. Panel Behavior [#105-panel-behavior] No custom event definition is required before tracking. After the first valid event reaches LogDrop, the **Events** page shows the event, its generated code, observed properties, property types, and any type conflicts. You can then use the event in event details and Event Analytics funnels. --- ## 11. Custom User Attributes [#11-custom-user-attributes] Custom user attributes let you attach stable profile information to the current LogDrop device and use it for segment-based push targeting in the panel. Customer Journeys also use them as the recipient and consent fields of SMS and WhatsApp steps. Call these APIs after `LogDrop.init(config)` has completed. ### 11.1. Set or Update Attributes [#111-set-or-update-attributes] Call `setCustomAttributes` with string keys and values, for example when the user's plan or language changes. ```ts LogDrop.setCustomAttributes({ plan_type: 'premium', country: 'TR', preferred_language: 'tr', }); ``` The update is an additive upsert. New keys are added and existing keys receive the new value, while attributes omitted from the call remain unchanged. Valid changes are persisted by the native SDK and synchronized with LogDrop automatically. ### 11.2. Remove an Attribute [#112-remove-an-attribute] Remove an attribute when it no longer applies, for example after a plan ends. ```ts LogDrop.removeCustomAttribute('plan_type'); ``` Removing a key also synchronizes the deletion with LogDrop, so the previous value is no longer available for future segment targeting. ### 11.3. Limits and Validation [#113-limits-and-validation] The native SDK checks every update against these rules. An update that breaks a rule is rejected, and the device keeps its previous attributes. - Attributes must be provided as a `Record`. - A device can have up to **30** custom attributes in total. - Keys must contain only letters, numbers, underscores (`_`), or hyphens (`-`). - Keys can contain up to **64 characters**. - Values must be non-blank strings containing up to **256 characters**. - If one entry in a call is invalid, the native SDK rejects the complete update. - If the merged result would exceed 30 keys, the previous attribute set remains unchanged. > **Note** > > Custom user attributes are different from `LogFlow.customAttributes`. User attributes > describe a device for audience targeting, while flow attributes add context only to the > logs recorded with that `LogFlow`. ### 11.4. Use Attributes in the Panel [#114-use-attributes-in-the-panel] A segment sends a push only to the devices whose attributes match your filter, for example every device with `plan_type` set to `premium`. After the device synchronizes, open **Push Notification → Send Push**, select **Segment** under Recipients, and build a filter with the attribute key. See [Segment Targeting with Custom Attributes](/docs/panel/push-notification/send-push#segment-targeting-with-custom-attributes). --- ## 12. Screen Tracking [#12-screen-tracking] From SDK 2.2.0, LogDrop records the screen the user is looking at. Each screen change is a `screen_view` event with the screen name, the previous screen and how the screen was detected. App Health uses the screen names to break performance metrics down by screen. > **Note: App Health metrics** > > The native SDKs also send app start time, slow and frozen frames, freezes, memory, CPU, battery, > network and HTTP timing metrics with each session for the panel's App Health page. They need no code. ### 12.1. React Navigation [#121-react-navigation] `createLogDropNavigationTracker` reads the current route from your navigation container ref and calls `LogDrop.trackScreen(route.name)` when it changes. Pass its `onReady` and `onStateChange` handlers to `NavigationContainer`: ```tsx import { NavigationContainer, createNavigationContainerRef, } from '@react-navigation/native'; import { createLogDropNavigationTracker } from '@log-drop/react-native'; const navigationRef = createNavigationContainerRef(); const logDropNavigation = createLogDropNavigationTracker(navigationRef); export default function App() { return ( {/* ... */} ); } ``` The ref can be the object from `createNavigationContainerRef()` or a `useRef` holder. To rename routes, pass `screenName` as the second argument; return `undefined` to skip a route: ```ts const logDropNavigation = createLogDropNavigationTracker(navigationRef, { screenName: (route) => (route.name === 'Debug' ? undefined : route.name), }); ``` ### 12.2. Manual Screens [#122-manual-screens] With other navigation libraries, or for screens that are not routes, call `trackScreen`. A `screen_view` is recorded when the name differs from the current screen. ```ts LogDrop.trackScreen('ProductDetail'); ``` - Keep screen names stable and free of user data: `ProductDetail`, not the product's name. - Names longer than 100 characters are cut; blank names are ignored. ### 12.3. Native Automatic Tracking [#123-native-automatic-tracking] The native SDKs can track Activities and view controllers automatically, but in a React Native app they mostly see the one host screen. This SDK therefore turns native automatic tracking off by default. To turn it back on: - **iOS:** `new LogDropConfigBuilder().setAutomaticScreenTracking(true)` before `LogDrop.init`. - **Android:** `LogDropReactNativeConfig.Builder(this).automaticScreenTracking(true)` in `MainApplication.kt`. --- ## 13. Troubleshooting [#13-troubleshooting] Check these points when data does not reach LogDrop, crash reports are not readable, or pushes do not arrive. - Ensure `LogDrop.init(config)` is called before logging or sending logs. - Confirm that your App ID and `baseUrl` (if used) are correctly configured. - On iOS, make sure `pod install` has been run, the workspace is opened in Xcode, and the upload phase runs after **Bundle React Native code and images**. - If an iOS JavaScript crash is not symbolicated, confirm that `main.jsbundle.map` is generated and that the build log contains `React Native iOS source map upload completed`. - If the iOS upload cannot resolve the project, confirm that `LogDrop-Services.plist` contains an `app_id` for the exact `PRODUCT_BUNDLE_IDENTIFIER`. - On Android, verify that the LogDrop Maven repository is configured, plugins are applied, and Gradle sync succeeds. - Confirm that custom event names do not match LogDrop default event names. - Check native SDK logs when a custom event is missing; invalid names, properties, or oversized payloads are rejected locally. - Check native SDK logs when custom user attributes are missing; invalid updates and updates exceeding 30 keys are rejected locally. - If using FCM: - Check that Firebase is initialized correctly. - Ensure background handlers are registered early (before app mount). - Confirm that `isLogDropPush`, `onNewFcmPushToken`, and `onRemoteMessageReceived` are being called. # Tracing (/docs/sdk/react-native/tracing) The native LogDrop SDKs that the React Native package depends on trace the HTTP requests your app makes with `fetch`, `XMLHttpRequest` and libraries built on them, such as axios: each request gets a W3C `traceparent` header and is sent as one client span. The JavaScript layer creates, queues and sends no spans, so there is no OpenTelemetry package to add and nothing to configure in JavaScript. A backend traced by LogDrop continues the same trace, so one request shows up in Trace Explorer from the device into your services. Rules that all LogDrop mobile SDKs share (authentication, which requests are traced, delivery and limits) are on [End-to-end Tracing](/docs/sdk/tracing). ## 1. Use SDK 2.1.2 or later [#1-use-sdk-212-or-later] Tracing needs React Native SDK 2.1.2 or later. Update the package, then run `pod install` so the iOS app gets the matching native SDK: ```bash npm install @log-drop/react-native@2.2.0 cd ios && pod install && cd .. ``` Version 2.1.2 brings the native Android and iOS SDKs 2.1.11, which contain the tracing. An app can pin a newer native Android SDK with `ext.logdropSdkVersion` in its root `build.gradle`. **Android:** apply the LogDrop Gradle plugin, as in [Android setup](/docs/sdk/react-native#13-android-setup). It adds LogDrop's interceptor to every OkHttp client in the app, including the one React Native's networking uses. Without it, nothing is traced on Android. **iOS:** nothing beyond `pod install` and the usual initialization: React Native's networking uses the default URLSession configuration, which the SDK instruments. ## 2. Initialize as usual [#2-initialize-as-usual] Tracing uses the initialization your app already has; there is no separate tracing call. The Android and iOS SDKs start in different places: Android, in `MainApplication.kt`: ```kotlin val config = LogDropReactNativeConfig.Builder(this) .appId("YOUR_APP_ID") .baseUrl("YOUR_BASE_URL") .build() LogDropReactNative.initLogDrop(config) ``` JavaScript, in `index.js` before `AppRegistry.registerComponent` (this initializes the iOS SDK): ```ts import { LogDrop, LogDropConfigBuilder } from '@log-drop/react-native'; LogDrop.init(new LogDropConfigBuilder().setAppId('YOUR_APP_ID').setBaseUrl('YOUR_BASE_URL').build()); ``` The App ID is all the SDK needs: spans go to `/v1/traces` with the header `x-logdrop-app-id`. Turn on **HTTP Logging** for the project in the panel. On the first launch after install, tracing starts once the SDK has the project's settings from LogDrop; requests sent before that carry no header. Your backend must send its traces to the **same LogDrop project** as this app, with an ingest key created in the app's project ([why](/docs/sdk/tracing#what-you-need)). ## What is traced [#what-is-traced] Not every request gets a trace. This list shows which requests get a `traceparent` header and a span, and what a span contains. - `fetch`, `XMLHttpRequest` and libraries built on them. Requests that native modules make are traced by the native SDKs, as described for [Android](/docs/sdk/android/tracing) and [iOS](/docs/sdk/ios/tracing). - A valid `traceparent` you set yourself is kept, sampled or not, and no span is sent for it; a missing, malformed or all-zero one is replaced. Requests to LogDrop's own endpoints are never traced. - A span carries the method, scheme, host and port, the status code or an error type, timing, the trace and span IDs, and your app's identifier and version. No paths, query strings, headers or bodies. The other rules are in [Which requests are traced](/docs/sdk/tracing#which-requests-are-traced). ## Delivery [#delivery] The native SDKs store spans encrypted, then send them in the background with the limits and retries in [Delivery](/docs/sdk/tracing#delivery). `LogDrop.setAppId(...)` drops the spans queued for the previous App ID. ## Send queued spans now (optional) [#send-queued-spans-now-optional] The SDK sends spans on its own. `flushOtlpTracing` asks it to send the queued spans now and tells you whether that worked. ```ts const delivered = await LogDrop.flushOtlpTracing(3000); // milliseconds: 1 to 5,000, default 2,000 ``` - It resolves `true` only when the native queue was delivered. A timeout outside 1 to 5,000 ms is brought into that range. - It resolves `false` on timeout, while delivery is still pending, after spans were dropped since the previous flush, when the SDK is not initialized, and on platforms other than Android and iOS. It never rejects. - When the SDK or HTTP Logging is off, it resolves `false` on iOS but `true` on Android, where the queue is cleared. The result does not tell you whether tracing is on. Use it, for example, before a test ends or before the user signs out. ## Check it [#check-it] To confirm that tracing works, make one request from the app and find its trace in the panel. Follow [Check it](/docs/sdk/tracing#check-it). The device span is under your app's package name (Android) or bundle identifier (iOS) in Trace Explorer. ## Known limits [#known-limits] In these cases a trace can miss device spans, or a request sent again shows up as a separate trace. - **iOS: URLSession's own retries share one client span.** When a reused connection closes before any response, URLSession may resend an idempotent request (a `GET` from `fetch`, for example) by itself; both attempts carry the same `traceparent`. The trace stays connected, but the device side shows one attempt. Android gives each attempt its own span. - **App-level retries start a new trace**, for example a request that axios-retry sends again. - The device clock must not run more than 5 minutes ahead of LogDrop's. # End-to-end Tracing (/docs/sdk/tracing) The LogDrop mobile SDKs start a trace on the device. Each HTTP request they track gets a W3C `traceparent` header and becomes one client span. A backend traced by LogDrop continues the same trace, so one request shows up in Trace Explorer as device, backend services, databases and brokers, and the request's HTTP record in the panel opens its backend trace. This page holds what all LogDrop mobile SDKs share. The platform pages cover setup and platform details: - [iOS](/docs/sdk/ios/tracing): URLSession requests, iOS SDK 2.1.11 or later. - [Android](/docs/sdk/android/tracing): OkHttp requests, Android SDK 2.1.11 or later. - [React Native](/docs/sdk/react-native/tracing): `fetch` and `XMLHttpRequest`, React Native SDK 2.1.2 or later. - [Flutter](/docs/sdk/flutter/tracing): `dart:io`, `package:http` and Dio, Flutter SDK 3.0.7 or later. ## What you need [#what-you-need] Check these requirements before you start. Requests are linked to backend traces only when all of them are met. - A LogDrop project whose plan includes HTTP monitoring, with **HTTP Logging** turned on in **Settings → App Config → HTTP Monitoring**. - An SDK version with tracing: iOS 2.1.11, Android 2.1.11, React Native 2.1.2 or Flutter 3.0.7, or later. React Native and Flutter use the tracing of the native SDKs they include. - A backend traced by LogDrop. The [LogDrop backend agents](/docs/backend-tracing) continue the trace out of the box. - **The app and the backend in the same LogDrop project.** The backend's agent must send with an ingest key created in the **mobile app's project**: LogDrop looks up a request's backend trace only inside the project of the app that made the request. Journeys across projects are not supported. If the backend sends to another project, the app's HTTP record finds no backend spans, and the backend's trace starts with a missing parent. - If an API gateway, WAF or proxy in front of your backend filters request headers, let `traceparent` and `tracestate` through. There is nothing new to configure in the app: tracing uses the App ID and base URL you already pass to the SDK. ## How the SDK authenticates [#how-the-sdk-authenticates] LogDrop must know which project a span belongs to. Backend agents send traces with an ingest key, but the device never holds an ingest key. The SDK sends its spans to `/v1/traces` (by default `https://server.logdrop.io/v1/traces`) with the project's **App ID** in the header `x-logdrop-app-id`, the same App ID it already uses for logs. LogDrop resolves the project from it and accepts it for traces only; the App ID is never copied into a span. Changing the App ID at runtime (`setAppId`) drops the spans queued for the previous App ID, so a span is never sent with another project's App ID. ## Which requests are traced [#which-requests-are-traced] The trace context is the `traceparent` header that links a request to the backend work it causes. The SDK does not add it to every request. A request gets a trace context only when all of these hold: - The SDK is enabled, and LogDrop has confirmed that HTTP Logging is on for the project, in this launch or an earlier one. On the very first launch after install, requests sent before the SDK has received the project's settings carry no header. - The request goes through an HTTP stack the SDK instruments (see your platform page). - The URL is not LogDrop's own base URL (same scheme, host and port). - The app configuration does not ignore it. **Ignored domains** stop tracing on every platform; **Ignored host and path rules** stop tracing on iOS only. For such a request the SDK: - keeps a valid `traceparent` your app already set, sampled or not, and does **not** send a span for it: your own tracer owns that context, so nothing is counted twice; - replaces a missing, malformed or all-zero `traceparent` with a new sampled one, and records the request as one client span with the same trace and span IDs; - records every attempt it can see as its own span in the same trace: redirects, and on Android also the HTTP client's own retries. A traced request also keeps its HTTP record, so the HTTP log and the trace match. Trace propagation works with request and response body and header capture turned off. ## What a span contains [#what-a-span-contains] A span is the record of one request attempt that the SDK sends to LogDrop. Use this list to check what leaves the device. The method, scheme, server host (and port, when the URL names one), the status code or an error type, timing, the trace and span IDs, and your app's identity: `service.name` is the Android package name or the iOS bundle identifier, and the service version is your app's version. Never paths, query strings, headers or bodies. ## Delivery [#delivery] The SDK does not send a span the moment a request ends. It queues spans on the device and sends them in the background, so spans recorded offline arrive later. These rules apply to every mobile SDK; the platform pages add details. - Spans are stored **encrypted** on the device (AES-GCM, with a key in the Android Keystore or the iOS Keychain), at most 1,000. When the queue is full, new spans are dropped. - The SDK waits about 15 seconds to collect spans, then sends them in the background when the network is available, in requests of at most 50 spans and about 48 KiB. No timer runs while nothing is queued. - LogDrop accepts at most 256 spans per request, whose start times fall in at most 32 different minutes. The SDK splits an offline backlog into several requests to stay inside both. - Spans that started more than about 7 days ago, or more than 5 minutes ahead of the device clock, are dropped before sending, so one stale span cannot cost a whole request. - A 400 answer drops the request's spans and is never retried. 408, 425, 429, 5xx and no answer at all are retried with the identical request (Android: exponential backoff from 10 seconds; iOS: after 10 and 20 seconds), **at most 3 attempts in all**. Other error answers drop the request. - Disabling the SDK or HTTP Logging for the project clears the queue once the SDK has the confirmed configuration. ## Send queued spans now (optional) [#send-queued-spans-now-optional] The SDK sends on its own. Call `flushOtlpTracing` only where you need the spans out now, for example at the end of an integration test or before the user signs out. It answers `true` only when the queue was delivered and no span was lost since the previous flush. `false` (timeout, no network, a request waiting for its retry, spans dropped) never loses anything that is still queued. Signatures and timeouts are on each platform page. ## Known limits [#known-limits] These cases can make a trace look incomplete or split it in two. Check them when a trace is not what you expect. - **One project only.** The device-to-backend journey shows only when the app and the backend send to the same LogDrop project. - **The device clock must not run more than 5 minutes ahead of LogDrop's.** LogDrop refuses spans that start more than 5 minutes in its future, and those spans are lost. - **Retries your app makes itself start a new trace.** Only attempts inside the HTTP client are linked; a request your code sends again is a new request with a new trace. - **WebView requests are not traced.** - **iOS:** URLSession may resend a request by itself without the SDK seeing it; both attempts then share one client span. See [iOS tracing](/docs/sdk/ios/tracing#known-limits). - **Flutter:** `dart:io` follows redirects with the first request's decision. See [Flutter tracing](/docs/sdk/flutter/tracing#known-limits). ## Check it [#check-it] After setup, make one test request to confirm that the device span and the backend spans show up in the same trace. 1. Make sure HTTP Logging is on for the project and the app has started once with network, so the SDK has the confirmed settings. 2. Make one request from the app to an API that your LogDrop-traced backend serves. 3. In the panel, open the request in [HTTP Monitoring](/docs/panel/http-monitoring): its **Backend Trace** section shows the device span with the backend spans under it. The panel keeps checking for 30 seconds while backend spans arrive. Or open **Trace Explorer** and filter by your app's service name (the package name or bundle identifier). ## Troubleshooting [#troubleshooting] Find what you see in the left column, then check the likely causes on the right. | You see | Check | |---|---| | No `traceparent` on the wire | HTTP Logging is off or not yet confirmed (first launch), the SDK is disabled, the URL is ignored by the app configuration, or the request does not go through an instrumented HTTP stack | | The HTTP record has no **Backend Trace** | The request was not traced (above), or **This SDK record cannot be correlated**: the record comes from an SDK version without tracing | | **Waiting for backend spans** that never ends | The backend sends to another LogDrop project than the app (not supported), is not traced by LogDrop, drops `traceparent`, or a gateway in front of it strips the header | | The device span is missing, the backend spans are there | The app set its own `traceparent` (not sent by LogDrop, by design), the device is offline (the spans arrive later), or the device clock is more than 5 minutes ahead | | Device spans arrive late | They wait in the offline queue and go out when the network returns or on the next launch. Use `flushOtlpTracing` where timing matters | # Changelog (/docs/sdk/web/changelog) {/* AGENT/MAINTAINER NOTE — this file is parsed by scripts/generate-sdk-release-feed.js and consumed by the CRM SDK release campaign sync. Required format: 1. The newest release must be the first `##` heading in this file. 2. Every release must have its own `##` heading. Put every artifact version released together in that heading using full `x.y.z` semver. Single artifact: `## Web SDK 1.1.0` Combined release: `## Web SDK 1.1.0 / Other Artifact 1.0.0` All versions in a combined heading become part of the campaign deduplication key. 3. The release date must be the first metadata line and must keep this exact shape: `Released: **YYYY-MM-DD**` 4. End the release entry with a standalone `---` before the previous release. 5. Do not add an introductory or unreleased `##` section above the newest release. Historical release `##` headings and lower-level headings inside a release are safe. 6. Keep release notes customer-facing. Describe observable features, fixes, compatibility changes, upgrade requirements, and public APIs. Do not include internal class or method names, source-code mechanics, test/reproduction setup, or implementation-only details unless users need them to take action. Changing this contract can prevent the wiki build or CRM changelog sync from working. Do not edit public/sdk-releases.json manually; it is generated during the wiki build. */} ## Web SDK 1.0.0 [#web-sdk-100] Released: **2026-11-17** First stable release of the LogDrop Web SDK (`@log-drop/web`) for browsers. Install it from npm or the LogDrop CDN. Guide: [Web SDK](/docs/sdk/web) ### Features [#features] - Logs with `LogFlow`, crash reports for uncaught errors, and HTTP monitoring for `fetch` and `XMLHttpRequest`. - Default events, custom events (`LogDrop.trackCustomEvent`) and custom user attributes for push targeting. - User identification with `LogDrop.updateUser`. - Web push notifications and in-app messages. - Risk detection, risk policies, IP reputation actions and the HTTP whitelist. # LogDrop Web SDK (/docs/sdk/web) The LogDrop Web SDK is a vanilla JavaScript SDK for browsers. It works with plain HTML pages and with frontend frameworks such as React, Vue, Angular, Svelte and Next.js client components. You initialize LogDrop once when the page loads, and it sends logs, crashes, HTTP activity, events and security signals from the browser to the LogDrop backend. > **Note** > > The SDK runs in the browser. A PHP, Python, Spring or .NET application can include it in > the HTML it serves, but logs from the server itself need [Backend Tracing](/docs/backend-tracing). --- ## 1. SDK Installation [#1-sdk-installation] Add the SDK as an npm package if your site is built with a bundler, or load it with a script tag if it is not. Either way, you then need your project's Web App ID. ### 1.1. npm [#11-npm] Use the `@log-drop/web` package when your site is built with a bundler, for example in a React, Vue, Angular, Svelte or Next.js project. Using **npm**: ```bash npm install @log-drop/web ``` or using **yarn**: ```bash yarn add @log-drop/web ``` ### 1.2. Script tag (CDN) [#12-script-tag-cdn] Without a bundler, load a pinned version from the LogDrop CDN. The script defines the global `LogDrop`, `LogFlow` and `LogLevel` objects. ```html ``` ### 1.3. Find your Web App ID [#13-find-your-web-app-id] The Web App ID identifies your LogDrop project, so the SDK knows where to send data. In the LogDrop panel, open **Project Settings → App ID** and copy the **Web App ID**. The Web SDK uses this ID; the **Mobile SDK App ID** on the same page is for the iOS and Android SDKs. ### 1.4. Limit the sites that can use it (optional) [#14-limit-the-sites-that-can-use-it-optional] The Web App ID is visible in your website's source. To stop other websites from using it, add your domains under **Project Settings → App ID → Allowed domains**, for example `shop.com`, `*.shop.com` or `localhost:3000`. Requests from other sites are then rejected. Leave the list empty to allow every site. --- ## 2. Initialization [#2-initialization] Call `LogDrop.init` once, as early as possible when the page loads, so that errors and requests made during startup are captured. ```js import { LogDrop } from '@log-drop/web'; LogDrop.init({ appId: 'YOUR_WEB_APP_ID', release: '1.4.0', // Your website's version, shown in the panel env: 'production', // baseUrl: 'YOUR_BASE_URL', // Optional: for self-hosted LogDrop }); ``` With the script tag: ```html ``` > **Note** > > A second `LogDrop.init` call on the same page is ignored. In single-page applications, > initialize in the entry file, not in a component that can mount more than once. > **Note: If LogDrop cannot be reached** > > The SDK keeps recording when the LogDrop server is offline or unreachable. Logs, crashes > and events are stored in the browser (IndexedDB) and uploaded once the connection is > back, including when the browser reports it is online again. --- ## 3. LogDropConfig Overview [#3-logdropconfig-overview] `LogDropConfig` is the object you pass to `LogDrop.init`. Only `appId` is required. Set the other fields when the defaults do not fit your site, for example to change upload timing, limit which requests are recorded, set up push or react to security actions. ```ts interface LogDropConfig { appId: string; // Web App ID from the panel (required) baseUrl?: string; // Self-hosted LogDrop URL release?: string; // Your website version env?: string; // Default "prod" debugLogEnabled?: boolean; // Print SDK diagnostics to the browser console flushIntervalMs?: number; // Log upload interval, default 60000 maxBatchSize?: number; // Upload early after this many new logs, default 50 crashTracking?: boolean; // Overrides the project setting when set network?: { enabled?: boolean; // Default true captureFetch?: boolean; // Default true captureXHR?: boolean; // Default true stripQuery?: boolean; // Remove query strings from recorded URLs, default true stripHash?: boolean; // Remove #fragments from recorded URLs, default true sampleRate?: number; // 0-1, default 1 onlyErrors?: boolean; // Record only failed or slow requests slowThresholdMs?: number; // With onlyErrors, also record requests slower than this excludeUrls?: Array; }; // Push notifications (see section 8) vapidPublicKey?: string; serviceWorkerUrl?: string; // Default "/_logdrop/logdrop-sw.js" serviceWorkerScope?: string; // Default "/" serviceWorkerRegistration?: ServiceWorkerRegistration; manualServiceWorkerRegistration?: boolean; onRemoteMessageReceived?: (payload) => void; // Security callbacks (see section 12) onSessionThreatChanged?: (threat) => void; onRiskPolicyActionTaken?: (action) => void; onWhitelistActionTaken?: (action) => void; } ``` HTTP logging, crash tracking, event tracking, push and the security rules can also be turned on or off for the whole project in the panel under **Project Settings → App Config**. --- ## 4. Crash Tracking [#4-crash-tracking] After `LogDrop.init`, uncaught JavaScript errors (`window.onerror`) and unhandled promise rejections are reported as crashes automatically. To report an error your code already handled: ```js try { checkout(); } catch (error) { LogDrop.saveCustomCrashReport('checkout', error.stack ?? String(error), 'CheckoutError'); } ``` > **Note** > > Stack traces are reported as the browser provides them. If your production bundle is > minified, the panel shows the minified file names and positions. --- ## 5. Logging Methods [#5-logging-methods] Logging methods record your own messages in LogDrop, so you can see what happened in the browser before a problem. ### 5.1. Basic logging [#51-basic-logging] Each method sets the level: `e` for error, `w` for warning, `i` for info and `d` for debug. Pass an optional tag that names the part of your site, the message and, optionally, a [`LogFlow`](#6-logflow). ```js import { LogDrop, LogFlow } from '@log-drop/web'; LogDrop.e('Payment', 'Payment failed'); // Error LogDrop.w('Network', 'Slow network'); // Warning LogDrop.i('Auth', 'User logged in'); // Info LogDrop.d('Parser', 'Parsing response'); // Debug // The tag is optional; objects are recorded as JSON LogDrop.i({ step: 'cart', items: 3 }); ``` ### 5.2. Sending logs [#52-sending-logs] Logs are stored in the browser and uploaded every 60 seconds (`flushIntervalMs`), or earlier when `maxBatchSize` new logs are waiting. To upload right away: ```js await LogDrop.sendLogs((success) => { console.log('Logs uploaded:', success); }); ``` Logs that could not be uploaded, for example because the user closed the tab, are sent on the next visit. --- ## 6. LogFlow [#6-logflow] `LogFlow` groups related logs into a single business flow or transaction. A flow has a name, an ID and optional attributes. Pass the same flow to every log of one piece of work, such as one checkout, so the panel can show those logs together. ```js const checkoutFlow = new LogFlow('CartCheckout', checkoutId, { itemsCount: String(items.length), total: totalPrice.toFixed(2), currency: 'TRY', }); LogDrop.i('Checkout', 'Checkout started.', checkoutFlow); LogDrop.i('Checkout', 'Checkout completed.', checkoutFlow); ``` In the LogDrop panel you can filter and analyze logs by `flowName` and `flowId`. --- ## 7. HTTP Monitoring [#7-http-monitoring] When HTTP logging is on for the project, requests made with `fetch` and `XMLHttpRequest` are recorded with their method, URL, status, duration, headers and bodies. Requests to LogDrop itself are never recorded. You review them in the panel's [HTTP Monitoring](/docs/panel/http-monitoring), for example to find slow or failing endpoints. - The domain and path rules, payload capture rules and sensitive data filters from **App Config** are applied before anything leaves the browser. - `Authorization`, `Cookie`, `Set-Cookie`, `X-Api-Key` and LogDrop's own headers are always masked. - Use `network.excludeUrls` to skip URLs from the browser side as well: ```js LogDrop.init({ appId: 'YOUR_WEB_APP_ID', network: { excludeUrls: ['https://analytics.example.com', /\/health$/], onlyErrors: true, slowThresholdMs: 2000, }, }); ``` --- ## 8. Push Notifications [#8-push-notifications] Web push lets you send browser notifications and in-app messages to your site's visitors from the panel. Web push needs HTTPS and a service worker served from your own domain. ### 8.1. Serve the service worker [#81-serve-the-service-worker] A service worker is a script that the browser runs in the background, apart from your page. LogDrop's push handlers run in `logdrop-sw.js`, so the browser must be able to load that file from your domain. Copy `logdrop-sw.js` from the npm package (`node_modules/@log-drop/web/dist/logdrop-sw.js`) or from the CDN folder to your site's public directory, and tell the SDK where it is: ```js LogDrop.init({ appId: 'YOUR_WEB_APP_ID', serviceWorkerUrl: '/logdrop-sw.js', serviceWorkerScope: '/', }); ``` If your site already registers its own service worker, register a worker that includes LogDrop's handlers and pass its registration with `serviceWorkerRegistration`. ### 8.2. Ask for permission and subscribe [#82-ask-for-permission-and-subscribe] A browser receives LogDrop pushes only after the visitor allows notifications and the page subscribes. `LogDrop.push.subscribe()` asks the browser for that permission. Configure Web Push for the project in the panel; the SDK receives the VAPID public key from there. Then subscribe after a user action, such as a button click: ```js button.addEventListener('click', async () => { try { await LogDrop.push.subscribe(); } catch (error) { // e.g. permission denied, unsupported browser, page not on HTTPS console.warn(error.message); } }); LogDrop.push.getPermissionState(); // 'default' | 'granted' | 'denied' | 'unsupported' await LogDrop.push.unsubscribe(); ``` Pushes sent from the panel are shown as browser notifications, and in-app messages are shown on the page. Receives and clicks are tracked as events. To react to a push in your own code, pass `onRemoteMessageReceived` to `LogDrop.init`. --- ## 9. User Identification (UUID Customization) [#9-user-identification-uuid-customization] By default, data is tied to a browser identifier. Set your own user ID, for example after the user signs in, when you want to find that user's data in the panel. You can then search for it as **User UUID** on the Devices page. To associate it with your own user ID: ```js await LogDrop.updateUser('user-1234@example.com'); ``` The ID is remembered across page loads. Call `LogDrop.updateUser(null)` when the user signs out. --- ## 10. Sessions [#10-sessions] A session lasts as long as the browser tab, the Web equivalent of an app process on mobile. Reloads and navigations in the same tab continue the session, and `app_open` is sent once per session. A new tab or a new browser window starts a new session, and so does switching to a different identified user. --- ## 11. Custom Events [#11-custom-events] Use custom events to track application-specific actions that are not covered by LogDrop's built-in events. Send a stable event name together with optional JSON-compatible properties. You do not need to set anything up in the panel first. ### 11.1. Track a Custom Event [#111-track-a-custom-event] Call `trackCustomEvent` when the action happens, with the event name and, optionally, an object of properties that describe it. ```js LogDrop.trackCustomEvent('purchase_completed', { coupon_code: 'SUMMER10', amount: 49.9, item_count: 2, is_first_order: true, completed_at: new Date(), }); ``` Properties are optional. `Date` values are sent as ISO-8601 strings; strings, numbers, booleans, null, nested objects and arrays are sent as they are. ### 11.2. Naming and Property Types [#112-naming-and-property-types] LogDrop groups custom events by name and records the type of each property. Follow these rules so that one action always arrives as the same event, with the same property types. - Event names and property names must start with an ASCII letter (`A-Z`, `a-z`) and contain only ASCII letters, digits or underscores (`_`). - Use stable and consistent names. For example, do not alternate between `purchase_completed` and `purchaseCompleted` for the same event. - Do not put IDs, timestamps or other dynamic values in the event name. Add them as properties instead. - Do not use the name of a LogDrop default event for a custom event. - Keep each property's type stable. For example, always send `amount` as a number. ### 11.3. Limits and Validation [#113-limits-and-validation] The SDK checks every event against these limits before it sends the event. - Event names and property names can contain up to **128 characters**. - One event can contain up to **100 top-level properties**. - The complete properties JSON can contain up to **16 KB in UTF-8**. - Property values must be JSON-compatible (no functions, circular references, `BigInt` or `NaN`). > **Warning** > > If validation fails, the SDK rejects the complete event and prints the reason to the > browser console as a warning. Names, properties and payloads are never silently truncated. ### 11.4. Panel Behavior [#114-panel-behavior] No custom event definition is required before tracking. After the first valid event reaches LogDrop, the **Events** page shows the event, its observed properties and property types. --- ## 12. Custom User Attributes [#12-custom-user-attributes] Custom user attributes attach stable profile information to the current user and can be used for segment-based push targeting in the panel. Call them after `LogDrop.init`. ```js LogDrop.setCustomAttributes({ plan_type: 'premium', country: 'TR', }); LogDrop.removeCustomAttribute('plan_type'); LogDrop.getCustomAttributes(); // { country: 'TR' } ``` - The update is an additive upsert: omitted attributes stay unchanged. - Up to **30** attributes in total. - Keys contain only letters, numbers, underscores (`_`) or hyphens (`-`), up to **64 characters**. - Values are non-blank strings up to **256 characters**. - If one entry is invalid, or the merged result would exceed 30 keys, the complete update is rejected. - Attributes belong to the identified user. After `updateUser` switches to another user, that user's own attributes apply. See [Segment Targeting with Custom Attributes](/docs/panel/push-notification/send-push#segment-targeting-with-custom-attributes). --- ## 13. Security and Risk Signals [#13-security-and-risk-signals] When risk detection is enabled for the project, the SDK reports browser risk signals (for example automation tools, headless browsers and open DevTools) and applies the risk policies, IP reputation actions and HTTP whitelist configured in the panel. Actions can show a warning, block the page, or block network requests. To react to these actions in your own code, pass the callbacks below to `LogDrop.init`. ```js LogDrop.init({ appId: 'YOUR_WEB_APP_ID', onRiskPolicyActionTaken: (action) => console.log(action.actionNames), onWhitelistActionTaken: (action) => console.log(action.domain, action.blocked), onSessionThreatChanged: (threat) => console.log(threat), }); LogDrop.getSessionThreat(); ``` --- ## 14. Troubleshooting [#14-troubleshooting] Check these points when the SDK cannot reach LogDrop, push does not subscribe, or an event or attribute does not appear. - Set `debugLogEnabled: true` to print SDK diagnostics to the browser console. - If requests fail with `403` and `Origin not allowed`, add the site's domain under **Allowed domains**. - Make sure you used the **Web App ID**, not the Mobile SDK App ID. With an unknown ID the SDK stops calling LogDrop for the rest of the page; with `debugLogEnabled: true` the console shows `App ID invalid or project deleted`. - If your site has a Content Security Policy, allow `https://server.logdrop.io` (or your `baseUrl`) in `connect-src`, and `https://cdn.logdrop.io` in `script-src` when you use the script tag. - If push `subscribe()` fails, check that the page is on HTTPS, Web Push is configured for the project, and the service worker URL returns the `logdrop-sw.js` file. - A custom event or attribute that does not appear was rejected locally; the browser console shows the reason. # LogDrop Taint Analysis (/docs/taint) LogDrop Taint follows user-controlled, personal, credential, and secret data through your mobile source code and reports dangerous flows that reach a sink without the right sanitisation. It also includes focused checks for hardcoded credentials and unsafe platform network configuration. The analyzers run locally and emit the same **SARIF 2.1.0** report shape. Teams shipping both iOS and Android apps get one kind of finding, a shared `.logdrop.json` configuration format, and one signed suppressions format. > **Note: Your repository stays local** > > The analyzers open no network connection and never upload your repository. A SARIF report contains finding metadata, file paths, locations, and the relevant data-flow trace. On iOS and Android it also contains the offending line with two lines of context on either side by default; if you optionally send that report to LogDrop, those snippets are sent with it. Set `snippets: "false"` to remove every source snippet before saving or sending the report. React Native reports include the offending line only when you set `snippets: "true"`, and Flutter reports never include source code. ## Choose a platform [#choose-a-platform] Each platform has its own analyzer. Pick the one for the source code you want to scan. - [iOS / Swift](/docs/taint/ios): Run data-flow analysis on macOS 15+ with the LogDrop Taint GitHub Action or standalone executable. - [Android / Kotlin & Java](/docs/taint/android): Run data-flow analysis on JVM 17+ with the LogDrop Taint Android Action or standalone JAR. - [React Native / JavaScript & TypeScript](/docs/taint/react-native): Scan JavaScript and TypeScript source with the LogDrop Taint GitHub Action or on another CI system. Needs Node 20 or newer, and none of your dependencies. - [Flutter / Dart](/docs/taint/flutter): Scan Dart and Flutter source with the LogDrop Taint GitHub Action or a self-contained binary for `linux-x64` and `macos-arm64`. No Flutter or Dart SDK needed. ## Shared security coverage [#shared-security-coverage] The iOS and Android analyzers both report these scenarios. Each maps to a CWE id, the public identifier for a kind of software weakness, so you can compare findings with other security tools. | Scenario | CWE | | --- | --- | | Unsanitised user or network data reaches a WebView | CWE-79 | | Untrusted data is interpolated into a SQL query | CWE-89 | | Personal data is written to a log | CWE-532 | | Personal data is stored locally in clear text | CWE-312 | | An API key, token, or secret is written directly into source | CWE-798 | | A hardcoded key reaches a cryptographic API | CWE-321 | | Personal data or credentials reach the system clipboard | CWE-200 | | Untrusted data is built into a predicate or selection clause | CWE-943 | | The app globally permits cleartext network traffic | CWE-319 | ## Where findings appear [#where-findings-appear] The analyzer writes its findings to a SARIF file, a standard JSON format for the results of code analysis tools. On GitHub they show up here: - **Pull request:** an inline annotation above the relevant line in Files changed. - **Job summary:** a location, rule, and finding table on the workflow run. - **CI gate:** enable `fail-on-findings` to block a merge when findings exist. - **Code Scanning:** upload standard SARIF when the repository has Code Scanning enabled. Panel reporting is optional and off by default. Without `panel-url`, the scan and its report stay entirely local. # LogDrop Taint for Android (/docs/taint/android) LogDrop Taint follows a value from a source—user input, an Intent, a server response, or a constant in code—to a sink and reports values that arrive unsanitised with a label accepted by that sink. It also checks for hardcoded credentials and unsafe manifest network configuration. The analyzer opens no network connection: not for licensing, usage counting, or telemetry. The licence is verified offline. Your repository is never uploaded. A report contains finding metadata, file paths, locations, and the relevant data-flow trace. By default it also contains the offending line with two lines of context on either side—never the whole file or the rest of your source. > **Note** > > Set `snippets: "false"` to remove every source line from the report. Sending a report to the LogDrop panel is a separate step and stays off unless you enable it. The [iOS counterpart](/docs/taint/ios) emits the same SARIF report shape. Both analyzers use the same `.logdrop.json` format and accept the same signed suppressions format. Most configuration can be shared; custom `sinks` use platform-specific rule ids and must match the analyzer that reads them. ## GitHub Actions [#github-actions] The LogDrop Taint Action runs the scan as a step of a GitHub Actions workflow, here on every pull request. It reads your licence key from the repository secret `LOGDROP_LICENSE`. ```yaml title=".github/workflows/security.yml" name: Security scan on: [pull_request] jobs: taint: runs-on: ubuntu-latest # Linux. No Mac or Android SDK. permissions: contents: read security-events: write # only if you upload to Code Scanning steps: - uses: actions/checkout@v4 - uses: initialcodess/logdrop-taint-android-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} path: . # scan the repository, including every app module fail-on-findings: "true" ``` The analyzer runs on a standard Linux runner. It requires no macOS, Android SDK, or Gradle installation. ## Run it without GitHub [#run-it-without-github] Outside GitHub Actions, for example on another CI system or your own machine, run the analyzer directly. The analyzer is a single JAR and needs only a JVM. ```bash title="Download, verify, and run" # Download and verify once; change the version when needed V=v1.0.2 curl -fsSL -o install.sh \ "https://raw.githubusercontent.com/initialcodess/logdrop-taint-android-action/$V/examples/install-logdrop-taint.sh" chmod +x install.sh LOGDROP_VERSION=$V LOGDROP_DIR="$HOME/logdrop" ./install.sh # Run it export LOGDROP_LICENSE="LOGDROP...." java -jar "$HOME/logdrop/logdrop-taint-android-$V.jar" . \ --sarif report.sarif --verbose --fail-on-findings ``` Use it in several environments: - **Developer machines:** scan your own source before pushing. - **Build servers:** add the commands to Jenkins, TeamCity, Bitrise, or another JVM-capable host. Exit code `1` means findings. - **Gradle tasks:** use the ready-made integration in `examples/gradle`. - **Self-hosted runners:** run the Action as-is. The output is standard SARIF 2.1.0 and works with SARIF viewers or your own dashboard. The repository's `examples/` directory includes recipes for CircleCI, GitLab CI, Jenkins, Bitrise, and Gradle. ## Where findings appear [#where-findings-appear] All three views work on every GitHub plan: 1. **Pull request annotation:** the finding appears above the relevant line in Files changed. 2. **Job summary:** the run page shows a location, rule, and finding table. 3. **CI gate:** with `fail-on-findings: "true"`, findings block the merge. If Code Scanning is enabled, SARIF is uploaded there too. It is free for public repositories and depends on GitHub Code Security licensing for private repositories. When upload is unavailable, the step warns and continues; it does not break the build. ## Test code is skipped [#test-code-is-skipped] Test fixtures often contain fake credentials that look exactly like real credentials. Files under `src/test` or `src/androidTest` and files named `*Test.kt` or `*Test.java` are excluded by default. The exclusion is printed clearly: ```text Skipped 214 test file(s). Use --include-tests to scan them. ``` A file named directly on the command line is always scanned. Set `include-tests: "true"` to scan the full test tree. ## What it finds [#what-it-finds] Most findings are flows. A source is where user, network, Intent, personal or secret data enters your code, and a sink is a call where that data does harm, such as a log, a SQL query or a WebView. Each row names the weakness by its CWE id, the public identifier for that kind of weakness. | Scenario | CWE | | --- | --- | | User, network, or Intent data reaches a WebView unsanitised | CWE-79 | | User or network data is built into a shell command | CWE-78 | | User or network data is concatenated into a SQL query | CWE-89 | | Personal data is written to the log | CWE-532 | | Personal data or credentials are stored locally in clear text in SharedPreferences, DataStore, Room, SQLite, or a file | CWE-312 | | An API key, token, or secret is written directly into source | CWE-798 | | A key hardcoded in source reaches `SecretKeySpec` | CWE-321 | | Personal data or credentials are copied to the clipboard | CWE-200 | | Untrusted data is built into a selection clause instead of using `selectionArgs` | CWE-943 | | The manifest permits cleartext HTTP for every host without a network security configuration | CWE-319 | `EncryptedSharedPreferences` is recognised as the fix and is never reported, even though its `edit().putString(...)` calls resemble regular SharedPreferences. The analyzer also uses the name a value is read from. For example, `cvvEditText.text` is a CVV, while `searchEditText.text` is ordinary user input and does not become personal data merely because a user typed it. Flows are followed across functions and files. A value that passes through a recognised sanitizer is not reported for the matching label. Sanitisation is label-specific: escaping HTML prevents injection but does not make an email non-personal, so logging that escaped email is still a finding. ## Send reports to the LogDrop panel [#send-reports-to-the-logdrop-panel] Panel reporting is optional and off by default. Enable it to track findings over time, view binary and source scans for the same app together, and carry false-positive decisions across scans. ```yaml title="Optional panel upload" - uses: initialcodess/logdrop-taint-android-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} path: . bundle-id: com.company.app panel-url: https://analyze.logdrop.io ``` Sending requires `panel-url`, `license`, and `bundle-id` together. Without all three, nothing is sent. The bundle id must be registered for the project; an unknown id is rejected so a typo cannot fail silently. Every recipe in `examples/` ends with `examples/report-to-panel.sh`, which performs the same POST from CircleCI, GitLab, Jenkins, Bitrise, or a developer machine. It does nothing until `PANEL_URL`, `LOGDROP_LICENSE`, and `BUNDLE_ID` are all present. The analyzer itself still contacts nothing. Sending is a separate step that authenticates with the licence and uploads the SARIF together with the bundle id, app name, version/ref, and commit metadata used to group the report. SARIF includes finding metadata, file paths, locations, flow traces, and—when snippets are enabled—the offending line with context. It never uploads repository files or the complete source tree. Disable snippets with `snippets: "false"`, or disable sending entirely by omitting `panel-url`. > **Note** > > If the panel is unreachable, the action warns and leaves the scan result, annotations, summary, and exit code unchanged. ## Adapt it to your codebase [#adapt-it-to-your-codebase] Add `.logdrop.json` at the repository root to teach the analyzer about project-specific sanitizers, field names, logging wrappers, and excluded paths. In a shared iOS/Android repository, keep platform-specific custom `sinks` in the configuration used by the matching analyzer; their rule ids are not interchangeable. ```json title=".logdrop.json" { "sanitizers": { "makeSafe": ["user-input"], "maskEmail": ["pii"] }, "sources": { "nationalId": "pii", "customerEmail": "pii" }, "sensitiveNames": { "sifre": "pii", "kartNo": "pii" }, "sinks": { "secret": { "rule": "ANDROID-TAINT-PII-LOG", "accepts": ["pii"] } }, "passthrough": ["normalise"], "exclude": ["vendor/", "generated/"] } ``` | Field | What it does | | --- | --- | | `sanitizers` | Defines your own sanitising functions and the labels they remove. | | `sources` | Defines project-specific personal-data fields such as `nationalId`. | | `sensitiveNames` | Defines your own names for sensitive inputs, including non-English names. | | `sinks` | Maps your own wrapper, such as a logging class, to a LogDrop rule and accepted labels. | | `passthrough` | Lists helpers that transform a value while preserving its taint. | | `exclude` | Lists path fragments to skip, such as vendored or generated code. | Valid labels are `user-input`, `hardcoded-secret`, `pii`, and `credential`. An invalid configuration is never ignored silently. Unknown fields, rules, or labels stop the scan with exit code `3` and list the valid options. ## Silence a reviewed finding [#silence-a-reviewed-finding] Sometimes a finding is real code but is not a problem in its specific context. Mark it as a false positive in the LogDrop panel, download `.logdrop-suppressions.json`, and commit the file at the repository root. LogDrop signs the file and the analyzer verifies it offline. ```json title=".logdrop-suppressions.json" { "version": 1, "suppressions": [ { "fingerprint": "a3f1c0d92b74e518", "reason": "Test double; this password is not a real one", "by": "ayse@example.com", "at": "2026-08-26" } ], "signature": "…" } ``` Signed suppressions make each decision explicit and reviewable. The readable file remains in your repository so pull request reviewers can see what is being suppressed and why. Add or remove suppressions through the panel and download a fresh signed file instead of editing fingerprints or the signature by hand. One file covers both platforms. If the repository also contains an iOS app, the same panel-signed file is accepted by both analyzers. A suppressed finding is not deleted. It remains in SARIF with its reason and is displayed as closed by Code Scanning and the LogDrop panel: ```text LogDrop Taint: 4 finding(s) (1 suppressed) → logdrop-taint.sarif ``` Suppressed findings do not fail the build. If a file cannot be verified—because it was edited, signed with another key, or expired—the file is ignored, all findings return, and the reason is printed. A suppression follows the finding's code fingerprint rather than its line number. Moving the code normally preserves the decision; changing the relevant code makes the finding appear again for review. > **Warning** > > Do not use `exclude` to clear an individual finding. It drops the whole path and can silently hide every future finding in that file. Reserve it for code you do not own, such as vendored dependencies. ## Inputs [#inputs] Inputs are the `with:` settings of the Action step. Only `license` is required; `bundle-id` is also required once you set `panel-url`. | Input | Default | Description | | --- | --- | --- | | `license` | — | Required licence key. Keep it in a secret. | | `path` | `.` | File or directory to scan. | | `fail-on-findings` | `false` | Fail the step when findings exist. | | `annotations` | `true` | Add inline annotations to the pull request. | | `snippets` | `true` | Include the offending line and ±2 context lines. With `false`, no code fragment leaves the runner. | | `include-tests` | `false` | Scan test code as well. | | `upload-sarif` | `true` | Attempt to upload the report to Code Scanning. | | `sarif-file` | `logdrop-taint.sarif` | SARIF output path. | | `repo-root` | `github.workspace` | Root used to make SARIF paths relative. | | `panel-url` | empty | Panel address. Empty means nothing is sent. | | `bundle-id` | empty | Registered application id; required when `panel-url` is set. | | `analyzer-version` | tested release | Analyzer version bundled and tested with the Action release. | Outputs are `findings` (the count) and `sarif-file` (the report path). ## Exit codes [#exit-codes] The analyzer ends with one of these codes. Use them in CI to tell findings apart from a licence or setup problem. | Code | Meaning | CI response | | --- | --- | --- | | `0` | Clean | Continue. | | `1` | Findings, when `fail-on-findings` is enabled | Fail the build and review the findings. | | `2` | Licence missing, invalid, or expired | Fail, but do not report a source vulnerability. | | `3` | Invalid arguments or `.logdrop.json` configuration | Fail and correct the setup. | Keeping codes `1` and `2` separate matters: an expired licence is not evidence that the application has a vulnerability. ## Requirements and licence [#requirements-and-licence] The analyzer requires **JVM 17 or newer**—the same runtime used by current Android Gradle Plugin versions. It needs no Android SDK, Gradle installation, or macOS host. LogDrop Taint is commercial software distributed as a compiled analyzer. Its time-limited key is verified offline: the program contacts no licensing server, does not count usage, and reports to nobody. It warns 14 days before expiry. To obtain a key, contact [satis@initialcode.io](mailto:satis@initialcode.io). Repository: [initialcodess/logdrop-taint-android-action](https://github.com/initialcodess/logdrop-taint-android-action) # LogDrop Taint for Flutter (/docs/taint/flutter) LogDrop Taint follows a value from a source—user input, a server response, or a constant in code—to a sink, and reports the values that arrive without being sanitised. It also reports hardcoded credentials and crypto keys, disabled TLS validation, and unsafe WebView configuration. The analyzer opens no network connection: not for licensing, usage counting, or telemetry. The licence is verified offline. > **Note** > > **No source in the report, ever.** Most analyzers put the offending line into the SARIF. This one does not: a finding is a rule, a file, and a line. There is no flag to turn it on, because there is no reason a report needs to carry your code. The [iOS](/docs/taint/ios), [Android](/docs/taint/android), and [React Native](/docs/taint/react-native) analyzers emit the same SARIF report shape, and the signed suppressions format is shared. ## GitHub Actions [#github-actions] The LogDrop Taint Action runs the scan as a step of a GitHub Actions workflow, here on every pull request. It reads your licence key from the repository secret `LOGDROP_LICENSE`. ```yaml title=".github/workflows/security.yml" name: Security scan on: [pull_request] jobs: taint: runs-on: ubuntu-latest # Linux. No Flutter or Dart SDK. permissions: contents: read security-events: write # only if you upload to Code Scanning steps: - uses: actions/checkout@v4 - uses: initialcodess/logdrop-taint-flutter-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} path: . # scan the repository ``` That is the whole minimum. Findings appear inline on the pull request and in the job summary, and **the build stays green**—see [The scan is advisory](#the-scan-is-advisory). ## It parses, it never resolves [#it-parses-it-never-resolves] The analyzer reads your Dart with `parseString`, so it never resolves a package graph. There is no `pub get`, no `.dart_tool`, no dependency download, and no Flutter or Dart SDK on the runner. It runs on a checkout exactly as it arrives. That is why the scan is fast and why it works on a repository that does not currently build. ## Pin by commit SHA, not `@v1` [#pin-by-commit-sha-not-v1] In a workflow, `@v1` after the action's name is a tag that moves to each new 1.x release. A commit SHA names one fixed version of the action instead. ```yaml - uses: initialcodess/logdrop-taint-flutter-action@a1b2c3d4... ``` This action runs inside your CI with your source checked out. A moving tag means its owner decides what executes there, whenever they like. A SHA means you decide. It also pins the checksum the installer verifies the analyzer against. That table lives *inside the action*, not beside the download, precisely so that replacing a release is not enough to change what runs on your machine. `@v1` is maintained and tracks the latest 1.x: the release flow moves it onto the commit that carries the pins, and the release gate fails unless `@v1` and `@vX.Y.Z` name the same commit. ```bash title="Find the commit v1 points to today" gh api repos/initialcodess/logdrop-taint-flutter-action/commits/v1 --jq .sha ``` ## The scan is advisory [#the-scan-is-advisory] `fail-on` defaults to `never`: findings are reported and the build stays green. This is a product decision, not an oversight. A scanner that breaks someone's pipeline on its own judgement gets removed from the pipeline. Opt into a gate when you want one: ```yaml with: license: ${{ secrets.LOGDROP_LICENSE }} fail-on: high # critical | high | medium | low | never ``` > **Warning** > > Flutter and React Native take a **levelled** `fail-on`. iOS and Android take a boolean `fail-on-findings`. The inputs are not interchangeable; a `fail-on-findings: "true"` on this action is an unrecognised input and gates nothing. ## Run it without GitHub [#run-it-without-github] Outside GitHub Actions, for example on another CI system or your own machine, run the analyzer directly. The analyzer is one self-contained binary, published for `linux-x64` and `macos-arm64`. ```bash title="Download, verify, and run" # Download and verify once; change the version when needed V=v1.0.3 T=linux-x64 # macos-arm64 on an Apple Silicon Mac curl -fsSL -o install.sh \ "https://raw.githubusercontent.com/initialcodess/logdrop-taint-flutter-action/$V/examples/install-logdrop-taint.sh" chmod +x install.sh LOGDROP_VERSION=$V LOGDROP_DIR="$HOME/logdrop" ./install.sh # Run it. The installed binary carries its version and target in the name, and # the installer prints the full path it wrote. export LOGDROP_LICENSE="LOGDROP...." "$HOME/logdrop/logdrop-taint-flutter-$V-$T" . \ --sarif report.sarif --fail-on high ``` Use it in several environments: - **Developer machines:** scan your own source before pushing. - **Build servers:** Jenkins, TeamCity, Bitrise, or a Mac mini. Exit code `1` means findings at or above `--fail-on`. - **Self-hosted runners:** run the Action as-is. The output is standard SARIF 2.1.0 and works with SARIF viewers or your own dashboard. ## Where findings appear [#where-findings-appear] All three views work on every GitHub plan: 1. **Pull request annotation:** the finding appears above the relevant line in Files changed. 2. **Job summary:** the run page shows a location, rule, and finding table. 3. **CI gate:** with `fail-on` set to a level, findings at or above it block the merge. If Code Scanning is enabled, SARIF is uploaded there too. It is free for public repositories and depends on GitHub Code Security licensing for private ones. When upload is unavailable, the step warns and continues; it does not break the build. ## Test code is skipped [#test-code-is-skipped] Test fixtures are where fake credentials live, and in the code they are indistinguishable from real ones. Test files are excluded by default. Set `include-tests: "true"` to scan them. ## What it finds [#what-it-finds] Eight rules, from three engines. The ids carry the engine, because the three ask different questions: `TAINT` asks whether a value reached a dangerous place, `CONFIG` asks whether a setting is unsafe, and `STRUCT` asks whether the line itself is wrong. ### Data flow [#data-flow] These rules follow a sensitive value from where your code gets it to a place where it leaks: the device log, unencrypted local storage or the clipboard. | Rule | CWE | What it reports | | --- | --- | --- | | `FL-TAINT-PII-LOG` | CWE-532 | Sensitive data written to the device log, including inside a `${...}` interpolation | | `FL-TAINT-CREDENTIALS-LOCAL-STORE` | CWE-312 | A credential written to unencrypted local storage, such as `SharedPreferences` | | `FL-TAINT-CLIPBOARD` | CWE-200 | A recovery key, a TOTP seed, or a card number copied to the system clipboard | ### The line itself [#the-line-itself] These rules look at one line on its own, with no flow to follow: a key or credential written into the source, or a certificate check that accepts everything. | Rule | CWE | What it reports | | --- | --- | --- | | `FL-STRUCT-HARDCODED-CRYPTO-KEY` | CWE-321 | A cryptographic key written into the source | | `FL-STRUCT-HARDCODED-CREDENTIAL` | CWE-798 | A credential written into the source | | `FL-STRUCT-TLS-VALIDATION-DISABLED` | CWE-295 | A certificate check that accepts every certificate | ### WebView configuration [#webview-configuration] A WebView shows web content inside your app. These rules check whether the WebView lets its content reach native code, and whether it is handed content assembled at run time. | Rule | CWE | What it reports | | --- | --- | --- | | `FL-CONFIG-WEBVIEW-UNGUARDED-BRIDGE` | CWE-749 | The WebView opens a native channel to content it does not restrict | | `FL-CONFIG-WEBVIEW-DYNAMIC-CONTENT` | CWE-79 | The WebView is handed content assembled at run time | The three data-flow rules were measured on nine real Flutter applications before any of them shipped: **12 findings, zero false positives**, every one read in source. The acceptance records live in the analyzer repository. ## Send reports to the LogDrop panel [#send-reports-to-the-logdrop-panel] Panel reporting is optional and off by default. Enable it to track findings over time, view binary and source scans for the same app together, and carry false-positive decisions across scans. ```yaml title="Optional panel upload" - uses: initialcodess/logdrop-taint-flutter-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} bundle-id: com.company.app panel-url: https://analyze.logdrop.io ``` Sending requires `panel-url`, `license`, and `bundle-id` together. Without all three, nothing is sent. The bundle id must be registered for the project; an unknown id is rejected so a typo cannot fail silently. Only the SARIF is sent, and because this analyzer never writes a source line into the report, no line of your code travels with it. > **Note** > > A panel that is down, a licence moved between projects, or a bundle id deleted in the panel will warn rather than fail your build—none of them is something the developer who opened the pull request can fix. Set `fail-on-delivery-error: "true"` if you would rather know loudly. ## Silence a reviewed finding [#silence-a-reviewed-finding] Suppress a finding when you have reviewed it and it is not a problem in its context. A suppression records that decision in a file that LogDrop signs and the analyzer verifies. Judge the finding in the panel and export the signed suppressions file. A suppressed finding stays in the report, marked, and stops failing the gate—it is never silently removed. A file that does not verify, or that has expired, is refused out loud and everything is reported. ## Inputs [#inputs] Inputs are the `with:` settings of the Action step. Only `license` is required; `bundle-id` is also required once you set `panel-url`. | Input | Default | What it does | | --- | --- | --- | | `license` | *(required)* | Your licence key. Keep it in a repository secret; it is verified offline. | | `path` | `.` | Directory to scan. | | `repo-root` | `${{ github.workspace }}` | Root that SARIF paths are relative to. | | `sarif-file` | `logdrop-taint.sarif` | Where to write the report. | | `fail-on` | `never` | `critical` / `high` / `medium` / `low` / `never`. | | `annotations` | `true` | Inline boxes on the pull request. Works on every plan. | | `upload-sarif` | `true` | Upload to Code Scanning; warns and continues if it is off. | | `include-tests` | `false` | Scan test code too. | | `panel-url` | — | Send the report to the panel. Empty means nothing is sent. | | `bundle-id` | — | Required when `panel-url` is set. | | `require-pinned-checksum` | `false` | Refuse an analyzer version this action has no checksum for. | | `fail-on-delivery-error` | `false` | Fail the build when the report could not be sent. | | `analyzer-version` | `v1.0.3` | Which analyzer to download. | There is no `snippets` input, by design—see the callout at the top of this page. ## Exit codes [#exit-codes] The analyzer ends with one of these codes. Use them in CI to tell findings apart from a licence or setup problem. | Code | Meaning | | --- | --- | | `0` | Clean | | `1` | Findings at or above `fail-on` | | `2` | Licence failure | | `3` | Bad arguments | | `4` | The scan could not complete | They are kept distinct on purpose: a developer whose licence lapsed must never be told their code has a vulnerability. A licence that cannot be verified stops the scan with `2`—it does not fall back to scanning without one. ## Requirements and licence [#requirements-and-licence] Nothing on the runner. The analyzer is one self-contained binary: no Flutter SDK, no Dart SDK, no `pub get`, and none of your dependencies. Published for `linux-x64` and `macos-arm64`. A licence is required and is verified offline—the analyzer makes no network call to check it. Without a valid licence the scan refuses to run and exits `2`. Repository: [initialcodess/logdrop-taint-flutter-action](https://github.com/initialcodess/logdrop-taint-flutter-action) Questions: destek@initialcode.io # LogDrop Taint for iOS (/docs/taint/ios) LogDrop Taint tracks whether data that came from a user—or data meant to stay secret—travels through Swift code and reaches a dangerous destination without being sanitised. It also checks for hardcoded credentials and unsafe App Transport Security configuration. Your repository never leaves the runner. The scan runs locally. A report contains finding metadata, file paths, locations, and the relevant data-flow trace. By default it also contains the offending line with two lines of context on either side. If you optionally send the report to LogDrop, those snippets are sent with it; repository files and the complete source tree are never uploaded. > **Note** > > Set `snippets: "false"` if you want reports to contain only the rule and `file:line`. Not a single line of source code will leave the runner. The Android counterpart is [`logdrop-taint-android-action`](/docs/taint/android). Both analyzers emit the same report shape and use the same configuration and signed suppression formats. Most `.logdrop.json` fields can be shared; custom `sinks` must use rule ids supported by the analyzer that reads them. ## GitHub Actions [#github-actions] The LogDrop Taint Action runs the scan as a step of a GitHub Actions workflow, here on every pull request. It reads your licence key from the repository secret `LOGDROP_LICENSE`. ```yaml title=".github/workflows/security.yml" name: Security scan on: [pull_request] jobs: taint: runs-on: macos-15 permissions: contents: read security-events: write # only if you upload to Code Scanning steps: - uses: actions/checkout@v4 - uses: initialcodess/logdrop-taint-ios-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} path: . # scan the repository, including every app module fail-on-findings: "true" ``` `macos-15` is required for Swift 6+. The analyzer is downloaded prebuilt; nothing is compiled in your project. ## Run it without GitHub [#run-it-without-github] Outside GitHub Actions, for example on another CI system or your own Mac, run the analyzer directly. The analyzer is a single executable and needs only macOS—no Xcode, Swift toolchain, or Homebrew. ```bash title="Download, verify, and run" # Download once; change the version when needed V=v1.24.4 curl -fsSL -O "https://github.com/initialcodess/logdrop-taint-ios-action/releases/download/$V/logdrop-taint-$V-macos-universal.tar.gz" curl -fsSL -O "https://github.com/initialcodess/logdrop-taint-ios-action/releases/download/$V/logdrop-taint-$V-macos-universal.tar.gz.sha256" shasum -a 256 -c "logdrop-taint-$V-macos-universal.tar.gz.sha256" tar -xzf "logdrop-taint-$V-macos-universal.tar.gz" # Run it export LOGDROP_LICENSE="LOGDROP...." ./logdrop-taint . --sarif report.sarif --verbose --fail-on-findings ``` This is useful in several environments: - **Developer machines:** scan your own source before pushing. - **Build servers:** add the commands to Jenkins, TeamCity, Bitrise, or a Mac mini. Exit code `1` means findings. - **fastlane or Xcode:** run the executable from a lane or Xcode Run Script phase. - **Self-hosted GitHub runners:** use the Action as-is without GitHub macOS per-minute billing. The `--sarif` output is standard SARIF 2.1.0. Open it in Xcode or a VS Code SARIF viewer, or send it to your own dashboard. The repository's `examples/` directory contains recipes for CircleCI, GitLab CI, Jenkins, Bitrise, fastlane, an Xcode build phase, and local machines. ## Where findings appear [#where-findings-appear] All three views work on every GitHub plan: 1. **Pull request annotation:** the finding appears above the relevant line in Files changed. 2. **Job summary:** the run page shows a location, rule, and finding table. 3. **CI gate:** with `fail-on-findings: "true"`, findings block the merge. If Code Scanning is enabled, SARIF is uploaded there too. It is free for public repositories and depends on GitHub Code Security licensing for private repositories. When upload is unavailable, the step warns and continues; it does not break the build. ## Test code is skipped [#test-code-is-skipped] Test fixtures often contain fake credentials that look exactly like real ones. Files under a `Tests/` or `UITests/` directory and files named `*Tests.swift` or `*Spec.swift` are excluded by default. The exclusion is printed clearly: ```text Skipped 591 test file(s). Use --include-tests to scan them. ``` A file named directly on the command line is always scanned, regardless of its name. ## What it finds [#what-it-finds] Most findings are flows. A source is where user, network, deep-link, personal or secret data enters your code, and a sink is a call where that data does harm, such as a log, a SQL query or a `WKWebView`. Each row names the weakness by its CWE id, the public identifier for that kind of weakness. | Scenario | CWE | | --- | --- | | User, network, or deep-link data reaches `WKWebView` unsanitised | CWE-79 | | An API key, token, or secret is written directly into source | CWE-798 | | A key hardcoded in source reaches a cryptographic API | CWE-321 | | Personal data—email, phone, password, card number, PIN, SSN, passport, or date of birth—is logged | CWE-532 | | Personal data is stored in clear text in a local database, UserDefaults, or Core Data | CWE-312 | | User or network data is interpolated into SQL instead of being bound | CWE-89 | | Untrusted data is built into an `NSPredicate` format string instead of being passed as an argument | CWE-943 | | Personal data or credentials are copied to the system pasteboard | CWE-200 | | App Transport Security is disabled globally | CWE-319 | The analyzer also uses the name a value is read from. For example, `cvvTextField.text` is treated as a CVV, while `searchTextField.text` is ordinary user input and does not become personal data merely because it was typed by a user. Flows are followed across functions. A value that passes through a recognised sanitizer such as `escapeHTML(...)` is not reported for the matching label. Sanitisation is label-specific: escaping HTML prevents injection but does not make an email non-personal, so logging that escaped email is still a finding. ## Send reports to the LogDrop panel [#send-reports-to-the-logdrop-panel] Panel reporting is optional and off by default. Enable it to track findings over time, view binary and source scans for the same app together, and carry false-positive decisions across scans. ```yaml title="Optional panel upload" - uses: initialcodess/logdrop-taint-ios-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} path: . bundle-id: com.company.app panel-url: https://analyze.logdrop.io ``` Sending requires `panel-url`, `license`, and `bundle-id` together. Without all three, nothing is sent. The bundle id must be registered for the project in the panel; an unknown id is rejected so a typo cannot fail silently. Every recipe in `examples/` ends with `examples/report-to-panel.sh`, which performs the same POST from CircleCI, GitLab, Jenkins, Bitrise, fastlane, or a developer machine. It does nothing until `PANEL_URL`, `LOGDROP_LICENSE`, and `BUNDLE_ID` are all present. The analyzer itself still contacts nothing. Sending is a separate step that authenticates with the licence and uploads the SARIF together with the bundle id, app name, version/ref, and commit metadata used to group the report. SARIF includes finding metadata, file paths, locations, flow traces, and—when snippets are enabled—the offending line with context. It never uploads repository files or the complete source tree. Disable snippets with `snippets: "false"`, or disable sending entirely by omitting `panel-url`. > **Note** > > If the panel is unreachable, the action warns and leaves the scan result, annotations, summary, and exit code unchanged. ## Adapt it to your codebase [#adapt-it-to-your-codebase] Add `.logdrop.json` at the repository root to teach the analyzer about your own sanitizers, field names, logging wrappers, and code that should not be scanned. In a shared iOS/Android repository, platform-specific custom `sinks` must use rule ids supported by the matching analyzer. ```json title=".logdrop.json" { "sanitizers": { "makeSafe": ["user-input"], "maskEmail": ["pii"] }, "sources": { "nationalId": "pii", "customerEmail": "pii" }, "sensitiveNames": { "sifre": "pii", "kartNo": "pii" }, "sinks": { "secret": { "rule": "SWIFT-TAINT-PII-LOG", "accepts": ["pii"] } }, "passthrough": ["normalise"], "exclude": ["Pods/", "Generated/", "Tests/"] } ``` | Field | What it does | | --- | --- | | `sanitizers` | Defines your own sanitising functions and the labels they remove. | | `sources` | Defines project-specific personal-data fields such as `nationalId`. | | `sensitiveNames` | Defines your own names for sensitive inputs, including non-English names. | | `sinks` | Maps your own wrapper, such as a logging class, to a LogDrop rule and accepted labels. | | `passthrough` | Lists helpers that transform a value while preserving its taint. | | `exclude` | Lists path fragments to skip, such as vendored or generated code. | Valid labels are `user-input`, `hardcoded-secret`, `pii`, and `credential`. An invalid configuration is never ignored silently. Unknown fields, rules, or labels stop the scan before analysis and the error lists the valid options. ## Silence a reviewed finding [#silence-a-reviewed-finding] Sometimes a finding is real code but is not a problem in its specific context. Mark it as a false positive in the LogDrop panel, download `.logdrop-suppressions.json`, and commit the file at the repository root. LogDrop signs the file and the analyzer verifies it offline. ```json title=".logdrop-suppressions.json" { "version": 1, "suppressions": [ { "fingerprint": "a3f1c0d92b74e518", "reason": "Test double; this password is not a real one", "by": "ayse@example.com", "at": "2026-08-26" } ], "signature": "…" } ``` Signed suppressions make each decision explicit and reviewable. The file stays readable and remains in the repository, so reviewers can see what is being suppressed and why. Add or remove suppressions through the panel and download a fresh signed file instead of editing fingerprints or the signature by hand. A suppressed finding is not deleted. It remains in SARIF with its reason and is displayed as closed by Code Scanning and the LogDrop panel: ```text LogDrop Taint: 4 finding(s) (1 suppressed) → logdrop-taint.sarif ``` Suppressed findings do not fail the build. If a file cannot be verified—because it was edited, signed with another key, or expired—the file is ignored, all findings return, and the reason is printed. A suppression follows the finding's code fingerprint rather than its line number. Moving the code normally preserves the decision; changing the relevant code makes the finding appear again for review. > **Warning** > > Do not use `exclude` to clear an individual finding. It drops the whole path and can silently hide every future finding in that file. Reserve it for code you do not own, such as vendored dependencies. ## Inputs [#inputs] Inputs are the `with:` settings of the Action step. Only `license` is required; `bundle-id` is also required once you set `panel-url`. | Input | Default | Description | | --- | --- | --- | | `license` | — | Required licence key. Keep it in a secret. | | `path` | `.` | File or directory to scan. | | `fail-on-findings` | `false` | Fail the step when findings exist. | | `annotations` | `true` | Add inline annotations to the pull request. | | `snippets` | `true` | Include the offending line and ±2 context lines. With `false`, no code fragment leaves the runner. | | `upload-sarif` | `true` | Attempt to upload the report to Code Scanning. | | `sarif-file` | `logdrop-taint.sarif` | SARIF output path. | | `repo-root` | `github.workspace` | Root used to make SARIF paths relative. | | `panel-url` | empty | Panel address. Empty means nothing is sent. | | `bundle-id` | empty | Registered application id; required when `panel-url` is set. | | `analyzer-version` | tested release | Analyzer version bundled and tested with the Action release. | Outputs are `findings` (the count) and `sarif-file` (the report path). ## Exit codes [#exit-codes] The analyzer ends with one of these codes. Use them in CI to tell findings apart from a licence or setup problem. | Code | Meaning | | --- | --- | | `0` | Clean—no findings. | | `1` | Findings, only when `fail-on-findings: "true"` is enabled. | | `2` | Licence missing, invalid, or expired. | | `3` | Invalid arguments or `.logdrop.json` configuration. | ## Requirements and licence [#requirements-and-licence] The analyzer requires **macOS 15 or newer**. It links against Apple system libraries, so it runs wherever iOS source is normally built, but it needs no Xcode, Swift toolchain, Homebrew, or project compilation. LogDrop Taint is commercial software distributed as a compiled analyzer. Its time-limited key is verified offline: the program contacts no licensing server, does not count usage, and reports to nobody. It warns 14 days before expiry. To obtain a key, contact [satis@initialcode.io](mailto:satis@initialcode.io). Repository: [initialcodess/logdrop-taint-ios-action](https://github.com/initialcodess/logdrop-taint-ios-action) # LogDrop Taint for React Native (/docs/taint/react-native) LogDrop Taint follows a value from a source—user input, a WebView message, a server response, or a constant in code—to a sink, and reports the values that arrive without being sanitised. It also reports hardcoded credentials, unencrypted local storage, and unsafe WebView configuration. The analyzer opens no network connection: not for licensing, usage counting, or telemetry. The licence is verified offline. Your repository is never uploaded, and by default the report carries no source code at all—only the rule, the file, and the line. > **Note** > > Snippets are **off by default** on React Native. The report contains the rule and `file:line`, and nothing of your code. Set `snippets: "true"` only if you want the offending line included. The [iOS](/docs/taint/ios), [Android](/docs/taint/android), and [Flutter](/docs/taint/flutter) analyzers emit the same SARIF report shape. The `.logdrop.json` configuration and the signed suppressions format are shared; custom `sinks` use platform-specific rule ids and must match the analyzer that reads them. ## GitHub Actions [#github-actions] The LogDrop Taint Action runs the scan as a step of a GitHub Actions workflow, here on every pull request. It reads your licence key from the repository secret `LOGDROP_LICENSE`. ```yaml title=".github/workflows/security.yml" name: Security scan on: [pull_request] jobs: taint: runs-on: ubuntu-latest # Linux. Node 20+ is all it needs. permissions: contents: read security-events: write # only if you upload to Code Scanning steps: - uses: actions/checkout@v4 - uses: initialcodess/logdrop-taint-rn-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} path: . # scan the repository ``` That is the whole minimum. Findings appear inline on the pull request and in the job summary, and **the build stays green**—see [The scan is advisory](#the-scan-is-advisory). ## Pin by commit SHA, not `@v1` [#pin-by-commit-sha-not-v1] In a workflow, `@v1` after the action's name is a tag that moves to each new 1.x release. A commit SHA names one fixed version of the action instead. ```yaml - uses: initialcodess/logdrop-taint-rn-action@a1b2c3d4... ``` This action runs inside your CI with your source checked out. A moving tag means its owner decides what executes there, whenever they like. A SHA means you decide. It also pins the checksum the installer verifies the analyzer against. That table lives *inside the action*, not beside the download, precisely so that replacing a release is not enough to change what runs on your machine. `@v1` is maintained and tracks the latest 1.x: the release flow moves it onto the commit that carries the pins, and the release gate fails unless `@v1` and `@vX.Y.Z` name the same commit. It asks you to trust us continuously rather than once, which is a reasonable thing to choose—it should just be a choice rather than the only option shown. ```bash title="Find the commit v1 points to today" gh api repos/initialcodess/logdrop-taint-rn-action/commits/v1 --jq .sha ``` ## The scan is advisory [#the-scan-is-advisory] `fail-on` defaults to `never`: findings are reported and the build stays green. This is a product decision, not an oversight. A scanner that breaks someone's pipeline on its own judgement gets removed from the pipeline. Opt into a gate when you want one: ```yaml with: license: ${{ secrets.LOGDROP_LICENSE }} fail-on: high # critical | high | medium | low | never ``` > **Warning** > > React Native and Flutter take a **levelled** `fail-on`. iOS and Android take a boolean `fail-on-findings`. The inputs are not interchangeable; a `fail-on-findings: "true"` on this action is an unrecognised input and gates nothing. ## Run it without GitHub [#run-it-without-github] Outside GitHub Actions, for example on another CI system or your own machine, run the analyzer directly. The analyzer is one self-contained JavaScript file. It needs no `npm install`, no `node_modules`, and none of your dependencies. ```bash title="Download, verify, and run" # Download and verify once; change the version when needed V=v1.0.4 curl -fsSL -o install.sh \ "https://raw.githubusercontent.com/initialcodess/logdrop-taint-rn-action/$V/examples/install-logdrop-taint.sh" chmod +x install.sh LOGDROP_VERSION=$V LOGDROP_DIR="$HOME/logdrop" ./install.sh # Run it. The installed file carries its version in the name, and the # installer prints the full path it wrote. export LOGDROP_LICENSE="LOGDROP...." node "$HOME/logdrop/logdrop-taint-rn-$V.mjs" . \ --sarif report.sarif --fail-on high ``` Use it in several environments: - **Developer machines:** scan your own source before pushing. - **Build servers:** add the commands to Jenkins, TeamCity, Bitrise, or any host with Node 20+. Exit code `1` means findings at or above `--fail-on`. - **Self-hosted runners:** run the Action as-is. The output is standard SARIF 2.1.0 and works with SARIF viewers or your own dashboard. The action repository's `examples/` directory carries the same install-and-scan recipe for CircleCI, GitLab CI, Jenkins, and Bitrise—they all call `examples/install-logdrop-taint.sh`, so every system installs and verifies the analyzer the same way. ## Where findings appear [#where-findings-appear] All three views work on every GitHub plan: 1. **Pull request annotation:** the finding appears above the relevant line in Files changed. 2. **Job summary:** the run page shows a location, rule, and finding table. 3. **CI gate:** with `fail-on` set to a level, findings at or above it block the merge. If Code Scanning is enabled, SARIF is uploaded there too. It is free for public repositories and depends on GitHub Code Security licensing for private ones. When upload is unavailable, the step warns and continues; it does not break the build. ## Test code is skipped [#test-code-is-skipped] Test fixtures are where fake credentials live, and in the code they are indistinguishable from real ones. Test files are excluded by default. Set `include-tests: "true"` to scan them. ## What it finds [#what-it-finds] Twenty-one rules, from four engines. The ids carry the engine, because each asks a different question: `TAINT` asks whether a value reached a dangerous place, `CONFIG` asks whether a setting is unsafe, `STRUCT` asks whether the line itself is wrong, and `LEAK` asks whether an effect leaves a timer or subscription running. ### Data flow [#data-flow] These rules follow an untrusted or sensitive value from where your code gets it to a place where it does harm, such as `eval`, a WebView, a file path, a log or the clipboard. | Rule | CWE | What it reports | | --- | --- | --- | | `RNJS-TAINT-UNTRUSTED-TO-INJECTED-JS` | CWE-79 | An untrusted value reaches a WebView's injected JavaScript | | `RNJS-TAINT-WEBVIEW-MESSAGE-TO-EVAL` | CWE-95 | A WebView message reaches `eval` | | `RNJS-TAINT-UNTRUSTED-TO-DYNAMIC-EVAL` | CWE-95 | An untrusted value reaches `eval` or the `Function` constructor | | `RNJS-TAINT-UNTRUSTED-TO-OPEN-URL` | CWE-601 | An untrusted value reaches `Linking.openURL` | | `RNJS-TAINT-UNTRUSTED-TO-FS-PATH` | CWE-22 | An untrusted value reaches a filesystem path | | `RNJS-TAINT-PII-LOG` | CWE-532 | Personal data or a credential reaches a log call | | `RNJS-TAINT-CREDENTIALS-LOCAL-STORE` | CWE-312 | Personal data or a credential reaches unencrypted local storage | | `RNJS-TAINT-CLIPBOARD` | CWE-200 | Personal data or a credential is copied to the clipboard | ### WebView and network configuration [#webview-and-network-configuration] A WebView shows web content inside your app. These rules check where a WebView may navigate and what its content may reach, whether requests use cleartext HTTP, and whether MMKV stores are encrypted. | Rule | CWE | What it reports | | --- | --- | --- | | `RNJS-CONFIG-WEBVIEW-ORIGIN-WILDCARD` | CWE-942 | The WebView accepts navigation to any origin | | `RNJS-CONFIG-WEBVIEW-NAVIGATION-GUARD` | CWE-1021 | The WebView has no effective navigation guard | | `RNJS-CONFIG-WEBVIEW-WINDOW-ESCAPE` | CWE-1021 | The WebView allows an iframe to escape the top-layer DOM | | `RNJS-CONFIG-WEBVIEW-FILE-ACCESS` | CWE-200 | The WebView is allowed to read local files | | `RNJS-CONFIG-WEBVIEW-MIXED-CONTENT` | CWE-319 | The WebView allows cleartext subresources on an `https` page | | `RNJS-CONFIG-WEBVIEW-INLINE-HTML` | CWE-942 | The WebView renders inline HTML, so its origin whitelist cannot apply | | `RNJS-CONFIG-CLEARTEXT-TRAFFIC` | CWE-319 | A request is sent over cleartext HTTP | | `RNJS-CONFIG-MMKV-UNENCRYPTED` | CWE-312 | An MMKV store is created without an encryption key | ### The line itself [#the-line-itself] These rules look at one line on its own, with no flow to follow: a credential written into the source, into unencrypted storage or into the log. | Rule | CWE | What it reports | | --- | --- | --- | | `RNJS-STRUCT-HARDCODED-CREDENTIAL` | CWE-798 | A credential is hardcoded in the source | | `RNJS-STRUCT-CREDENTIAL-NAMED-LITERAL` | CWE-798 | A credential-named constant holds a hardcoded key | | `RNJS-STRUCT-CREDENTIALS-LOCAL-STORE` | CWE-312 | A credential is written to unencrypted storage | | `RNJS-STRUCT-PII-LOG` | CWE-532 | A credential is written to the log | ### Lifetime [#lifetime] This rule finds React effects that start a timer or a subscription and never clean it up, so it can keep running after the component that started it is gone. | Rule | CWE | What it reports | | --- | --- | --- | | `RNJS-LEAK-EFFECT-NO-CLEANUP` | CWE-401 | An effect creates a timer or subscription and never cleans it up | The leak engine is **off by default** (`leaks: "false"`). While it is off, its rule does not run and does not appear in the report's rule list—so a report says "was not asked" rather than "loaded, found nothing". ## Send reports to the LogDrop panel [#send-reports-to-the-logdrop-panel] Panel reporting is optional and off by default. Enable it to track findings over time, view binary and source scans for the same app together, and carry false-positive decisions across scans. ```yaml title="Optional panel upload" - uses: initialcodess/logdrop-taint-rn-action@v1 with: license: ${{ secrets.LOGDROP_LICENSE }} bundle-id: com.company.app panel-url: https://analyze.logdrop.io ``` Sending requires `panel-url`, `license`, and `bundle-id` together. Without all three, nothing is sent. The bundle id must be registered for the project; an unknown id is rejected so a typo cannot fail silently. The analyzer itself still contacts nothing—sending is a separate step that authenticates with the licence and uploads the SARIF with the bundle id, app name, version/ref, and commit metadata used to group the report. With `snippets` off, which is the default here, the report carries no source line at all. > **Note** > > A panel that is down, a licence moved between projects, or a bundle id deleted in the panel will warn rather than fail your build—none of them is something the developer who opened the pull request can fix. Set `fail-on-delivery-error: "true"` if you would rather know loudly. ## Adapt it to your codebase [#adapt-it-to-your-codebase] Use this when your code has its own sources or sinks that the analyzer cannot know, for example a logging wrapper. A JSON file extends the source and sink model with your own entries: ```yaml with: config: .logdrop.json ``` A malformed configuration is refused out loud with exit code `3`, rather than being silently ignored. ## Silence a reviewed finding [#silence-a-reviewed-finding] Suppress a finding when you have reviewed it and it is not a problem in its context. A suppression records that decision in a file that LogDrop signs and the analyzer verifies. Judge the finding in the panel and export the signed suppressions file: ```yaml with: suppressions: .logdrop-suppressions.json ``` A suppressed finding stays in the report, marked, and stops failing the gate—it is never silently removed. A file that does not verify, or that has expired, is refused out loud and everything is reported. ## Inputs [#inputs] Inputs are the `with:` settings of the Action step. Only `license` is required; `bundle-id` is also required once you set `panel-url`. | Input | Default | What it does | | --- | --- | --- | | `license` | *(required)* | Your licence key. Keep it in a repository secret; it is verified offline. | | `path` | `.` | Directory to scan. | | `repo-root` | `${{ github.workspace }}` | Root that SARIF paths are relative to. | | `sarif-file` | `logdrop-taint.sarif` | Where to write the report. | | `fail-on` | `never` | `critical` / `high` / `medium` / `low` / `never`. | | `annotations` | `true` | Inline boxes on the pull request. Works on every plan. | | `upload-sarif` | `true` | Upload to Code Scanning; warns and continues if it is off. | | `include-tests` | `false` | Scan test code too. | | `leaks` | `false` | Also report effects that start a timer or subscription and never clean it up. | | `snippets` | `false` | Put the offending source line in the report. | | `config` | — | JSON file extending the source/sink model with your own entries. | | `suppressions` | — | Signed suppressions file exported from the panel. | | `panel-url` | — | Send the report to the panel. Empty means nothing is sent. | | `bundle-id` | — | Required when `panel-url` is set. | | `require-pinned-checksum` | `false` | Refuse an analyzer version this action has no checksum for. | | `fail-on-delivery-error` | `false` | Fail the build when the report could not be sent. | | `analyzer-version` | `v1.0.4` | Which analyzer to download. | ## Outputs [#outputs] Outputs are values the Action step sets for later steps of the same job. | Output | What it is | | --- | --- | | `sarif-file` | Path of the report that was written. | | `findings` | How many findings were reported. | | `report-id` | The id the panel filed the report under. Empty when nothing was sent. | ## Exit codes [#exit-codes] The analyzer ends with one of these codes. Use them in CI to tell findings apart from a licence or setup problem. | Code | Meaning | | --- | --- | | `0` | Clean | | `1` | Findings at or above `fail-on` | | `2` | Licence failure | | `3` | Bad arguments or configuration | | `4` | The scan could not complete | They are kept distinct on purpose: a developer whose licence lapsed must never be told their code has a vulnerability. A licence that cannot be verified stops the scan with `2`—it does not fall back to scanning without one. ## Requirements and licence [#requirements-and-licence] Node 20 or newer on the runner; `ubuntu-latest` has it. No `npm install`, no `node_modules`, and none of your dependencies are needed. A licence is required and is verified offline—the analyzer makes no network call to check it. Without a valid licence the scan refuses to run and exits `2`. Repository: [initialcodess/logdrop-taint-rn-action](https://github.com/initialcodess/logdrop-taint-rn-action) Questions: destek@initialcode.io