Appearance
Send APM data directly
Apps can export straight to Logcore, without an agent. Use this for containers, Kubernetes, serverless functions, or any host without the Logcore agent.
Endpoints
| Protocol | Endpoint | Notes |
|---|---|---|
| OTLP/HTTP (recommended) | https://logcore.lsofito.com | Uses the normal HTTPS port, so it works through most firewalls. Exporters add /v1/traces, /v1/metrics and /v1/logs. |
| OTLP/HTTP | https://logcore.lsofito.com:4318 | The standard OTLP/HTTP port. |
| OTLP/gRPC | https://logcore.lsofito.com:4317 | The standard OTLP/gRPC port, with TLS. |
Authentication
Send an organization API key with every request, in one of these headers:
| Header | Example |
|---|---|
x-logcore-api-key (preferred) | x-logcore-api-key: lc_xxxxxxxx |
x-api-key | x-api-key: lc_xxxxxxxx |
Authorization | Authorization: Bearer lc_xxxxxxxx |
Requests without a valid key are rejected with HTTP 401 or gRPC UNAUTHENTICATED.
Configuration
sh
OTEL_SERVICE_NAME=checkout
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production
OTEL_EXPORTER_OTLP_ENDPOINT=https://logcore.lsofito.com
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=x-logcore-api-key=lc_xxxxxxxx
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlpsh
OTEL_SERVICE_NAME=checkout
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production
OTEL_EXPORTER_OTLP_ENDPOINT=https://logcore.lsofito.com:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_HEADERS=x-logcore-api-key=lc_xxxxxxxx
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlpPayloads can be protobuf or JSON, optionally gzip-compressed, up to 16 MB per request.
Docker Compose
yaml
services:
checkout:
image: myorg/checkout:1.4
environment:
OTEL_SERVICE_NAME: checkout
OTEL_RESOURCE_ATTRIBUTES: deployment.environment=production
OTEL_EXPORTER_OTLP_ENDPOINT: https://logcore.lsofito.com
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_HEADERS: x-logcore-api-key=${LOGCORE_API_KEY}Kubernetes
Keep the key in a Secret:
sh
kubectl create secret generic logcore --from-literal=otlp-headers="x-logcore-api-key=lc_xxxxxxxx"yaml
env:
- name: OTEL_SERVICE_NAME
value: checkout
- name: OTEL_RESOURCE_ATTRIBUTES
value: deployment.environment=production,k8s.namespace.name=shop
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: https://logcore.lsofito.com
- name: OTEL_EXPORTER_OTLP_HEADERS
valueFrom:
secretKeyRef: { name: logcore, key: otlp-headers }For many services, it's usually better to run an OpenTelemetry Collector in the cluster and keep the key only there.
Keep the key server-side
Don't put an API key in browser or mobile app code, because anyone could read it there. Send browser telemetry through your own backend or a Collector.