Add the processor
Call featuryLogProcessor with a server key from Settings > API keys. Add it beside the processors your server already uses.
import { featuryLogProcessor } from "featury/otel";
featuryLogProcessor("fsk_from_your_server");An error you send both with featury/server and through OpenTelemetry counts twice, so send each error one way.
Name the user and route
featury reads user.id, enduser.id and http.route. If your logs use other names, pass user and route functions. Send a user id only when your privacy rules allow it.
import { NodeSDK } from "@opentelemetry/sdk-node";
import { featuryLogProcessor } from "featury/otel";
const sdk = new NodeSDK({
logRecordProcessors: [
// ...the processors you already use, then:
featuryLogProcessor(process.env.FEATURY_SERVER_KEY ?? "", {
user: (a) => (typeof a.userId === "string" ? a.userId : undefined),
route: (a) => (typeof a.surface === "string" ? a.surface : undefined),
}),
],
});
sdk.start();Where to send logs
Exporters send OTLP, OpenTelemetry's format for sending logs, to this address with an HTTP POST.
https://widget.featury.app/otlp/v1/logsYour server key goes in this header, never in the address.
Authorization: Bearer fsk_...Send OTLP JSON as application/json or OTLP protobuf as application/x-protobuf, uncompressed or with gzip. featury doesn't take gRPC, so choose your exporter's HTTP option.
Using your own exporter? Set it to send 100 logs or fewer per batch, so every batch fits featury's limits.
Use a Collector
Already running an OpenTelemetry Collector? Add this pipeline. It sends ERROR logs only, in batches of 100 or fewer.
processors:
filter/featury:
error_mode: propagate
logs:
log_record:
- 'severity_number < SEVERITY_NUMBER_ERROR'
- 'event_name == "gen_ai.evaluation.result" or attributes["event.name"] == "gen_ai.evaluation.result"'
batch/featury:
send_batch_size: 100
send_batch_max_size: 100
timeout: 1s
exporters:
otlp_http/featury:
logs_endpoint: ${env:FEATURY_OTLP_LOGS_URL}
headers:
Authorization: Bearer ${env:FEATURY_SERVER_KEY}
compression: gzip
timeout: 10s
sending_queue:
enabled: true
num_consumers: 1
queue_size: 50
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 30s
max_elapsed_time: 30s
service:
pipelines:
logs/featury:
receivers: [otlp]
processors: [filter/featury, batch/featury]
exporters: [otlp_http/featury]Set FEATURY_OTLP_LOGS_URL to the address above. Fill FEATURY_SERVER_KEY from the secret manager you already use, so the key never sits in this file.
otlp is the receiver you already have. Your other pipelines stay as they are.
The small queue keeps featury from slowing your other pipelines. If featury keeps answering 429 or 503, the Collector logs “sending queue is full” and drops featury's batches, while everything else keeps moving.
This pipeline sends ERROR and FATAL logs only. For an exception logged below ERROR, or for feedback, use the processor.
Tested with OpenTelemetry Collector Contrib 0.164.0. The event_name condition needs Collector 0.128.0 or newer: an older one won't start with this file. From 0.128.0 to 0.145.x, write otlphttp instead of otlp_http.
What featury reads
Exception type, message and stack; code location; route; feature key; user id; service, release and environment; trace ID. Feedback events use the featury.feedback names in the table. Other fields are ignored.
Errors
featury keeps a log as an error when its severity is ERROR or FATAL, or when its event name is exception or featury.error. It ignores info and warning logs and other featury.* events. AI evaluation results (gen_ai.evaluation.result) are always ignored, even at ERROR.
| Field | What it is |
|---|---|
| exception.type | The error's type, like TypeError. When it's missing, featury uses Error. |
| exception.message | The message, cut to 1,000 characters. Without one, featury uses a text body, then “Error reported”. |
| exception.stacktrace | The stack, cut to whole lines within 8 KiB. |
| code.file.pathcode.function.namecode.line.numbercode.column.number | Where in the code it happened. Used only when the stack gives no code lines. |
| http.route | The route, like /orders/:id. featury uses it to find the screen. When it matches one of your screens or a route in your code, featury keeps that pattern with the error. Otherwise it keeps nothing. |
| featury.feature | Your feature key, like checkout. |
| user.idenduser.id | Your own user id, so featury can count who hit the error. |
| service.name | Your service's name. OpenTelemetry's default, unknown_service, counts as no name. |
| vcs.ref.head.revisionservice.version | The release. When it's a commit featury has seen, the error links to that commit. |
| deployment.environment.namedeployment.environment | The environment, or production when it's missing. featury keeps errors only from the environments your product counts. |
| traceId | The log's trace ID, kept with the error's sample. Only managers, admins and owners see it. featury doesn't link it to a tracing tool. |
When a row lists two names, featury uses the first one that's set. The service, release and environment come from the resource. Everything else comes from the log itself.
An error log needs its time: timeUnixNano, else observedTimeUnixNano. featury can't read an error log from more than 24 hours ago, or one more than 5 minutes ahead of featury's clock.
featury finds the code lines in JavaScript stacks. Errors from other languages still arrive and group, but may show no code lines.
Feedback events
Send a log with the event name featury.feedback only when a person chose to give feedback, like pressing thumbs up. featury reads its attributes, never its body, and never turns other log text into feedback.
import { logs } from "@opentelemetry/api";
const logger = logs.getLogger("feedback");
export function onThumbsUp(userId: string) {
logger.emit({
eventName: "featury.feedback",
attributes: {
"featury.feature": "checkout",
"featury.feedback.value": 1,
"featury.feedback.scale": 2,
"user.id": userId,
},
});
}With @opentelemetry/api older than 1.10, import logs from @opentelemetry/api-logs instead.
| Field | What it is |
|---|---|
| featury.feedback.id | Optional: the note's id, a UUIDv7 from the last 30 days. Sent again, it's still one note. Without it, the event's own time must be from the last 30 days. |
| featury.feature | Your feature key, like checkout. |
| featury.item.typefeatury.item.id | What was rated, like answer and msg_81. A type is up to 32 lower-case letters, digits, _ or -, starts with a letter and needs an id. An id with a colon in it needs a type too. |
| featury.feedback.valuefeatury.feedback.scale | The rating. Send both: on scale 2, 0 is thumbs down and 1 is thumbs up; scale 5 takes 1 to 5; scale 10 takes 0 to 10. |
| featury.feedback.choice | The option the person picked, like outdated. |
| featury.feedback.text | What the person wrote. |
| featury.feedback.kind | The kind: problem, idea, question or praise. |
| featury.feedback.question | The words you showed the person, like “Were these results good?” |
| featury.check_in.id | The id of the check-in that asked. |
| user.idenduser.id | Your own user id. |
A note needs a rating, a choice or some text.
featury doesn't read the body, featury.area, session.id or app.screen.id, or any contact, follow-up, request, external id or meta attribute. To let the person hear back when it ships, send the note with featury/server instead.
A feedback event doesn't mean the person agreed to usage tracking or asked to hear back. featury stores no email from these events.
Limits and replies
featury accepts HTTP with JSON or protobuf, uncompressed or gzip. It doesn't accept gRPC. Each batch can hold 1 MiB after decompression, 1,000 logs and 100 errors or feedback events.
Each product can send 8 MiB of logs a minute, and each server key 600 batches a minute. Past that, featury answers 429 until the minute ends.
A 413 is final: that batch will never fit, so the exporter drops it. A 429 or a 503 is temporary: the exporter waits and sends the same batch again.
When featury can't read some logs in a batch, it takes the rest and answers 200 with the number it couldn't read. That number includes logs at any level, info too, that go over one of these limits: 128 attributes, attribute names of 128 characters, values nested 8 levels deep, lists of 256 items, and each name once per list. Send only ERROR logs, with the Collector filter or featury/otel, so info logs never reach featury.
What featury keeps
Each error group keeps up to three samples for 30 days, with the user id and trace ID you sent. Who hit an error is kept as salted hashes for 90 days. Grouped counts stay while the product exists. Feedback events follow the rules for other feedback: unlinked text is cleared once it's 12 months old, and text linked to a request stays as evidence until you erase that feedback or delete the product. featury doesn't store raw logs, HTTP bodies, headers or other attributes.
Fix common problems
A 401 needs a server key. A 413 means a batch is too large, so send smaller ones. A 415 needs JSON or protobuf over HTTP. A 429 means wait: the exporter tries again on its own. A 503 means featury can't take logs right now, because intake is off or busy. Check Settings > API keys to see what arrived today.