Connect Telemetry Sources to a Unified Observability Data Model
In this article
This guide walks you through connecting multiple telemetry sources—metrics, logs, traces, and events—to a single unified observability data model. You'll learn how to map each source's native format to a common schema, set up ingestion pipelines, and validate the result, so you can query across all signals without juggling separate tools.
What You'll Need
- Access to your telemetry sources: at least one metrics endpoint (e.g., Prometheus), log stream (e.g., syslog, JSON logs), and trace exporter (e.g., OTLP).
- A target observability platform that supports a unified data model (e.g., Grafana Tempo + Loki + Mimir, or a commercial APM with a single schema).
- An ingestion endpoint or agent (e.g., OpenTelemetry Collector, Fluent Bit, or a vendor agent) that can receive data from your sources.
- Basic familiarity with YAML/JSON configuration and your platform's query language (e.g., PromQL, LogQL, TraceQL).
- Credentials or API keys for both sources and the target platform.
Step-by-Step
- Define your unified schema. Decide on a common set of fields that every telemetry record will carry. At minimum, include:
timestamp(RFC3339),source(e.g., 'service-a'),type(metric/log/trace),name(metric name, log message, span name),attributes(key-value map for dimensions), andvalue(numeric for metrics, text for logs, duration for spans). This schema becomes the target for all mappings. - Set up an ingestion pipeline. Install the OpenTelemetry Collector (or your chosen agent) on a host that can reach all sources. Configure it to receive data via OTLP, Prometheus remote write, and a log receiver (e.g., filelog, syslog). Ensure the collector has network access to the target platform's endpoint.
- Map metrics to the unified model. For each metric source, create a transform processor in the collector that converts the native metric name to your schema's
namefield, copies labels intoattributes, and setstype: 'metric'. For example, a Prometheus metrichttp_requests_total{method="GET"}becomesname: "http_requests_total", attributes: {method: "GET"}, value: 123. - Map logs to the unified model. Use a log transform processor to parse each log line into structured fields. Extract the timestamp, set
type: 'log', and move the raw message intoname(or a separatemessagefield if your schema allows). Map any JSON fields from the log toattributes. For unstructured logs, use a regex parser to pull out key fields. - Map traces to the unified model. For each span, set
type: 'trace',nameto the span name, andvalueto the span duration in milliseconds. Copy trace ID, span ID, parent span ID, and service name intoattributes. Ensure the timestamp is the span start time. - Add resource attributes. Enrich every record with common resource attributes like
service.name,host.name, anddeployment.environment. This is usually done in the collector'sresourceprocessor, so you can filter and group across all signals later. - Configure the exporter. Set up the collector's OTLP exporter to send the transformed data to your target platform's endpoint. Use the correct authentication (e.g., API key header, basic auth). Test the connection with a simple curl or the collector's health check.
- Run and validate. Start the collector and generate some test telemetry (e.g., hit a test endpoint, write a log line, run a small trace). Query the target platform to see if records appear with the correct fields. Check that timestamps are correct and no data is dropped.
- Iterate on field mappings. Compare the raw source data with what lands in the unified model. Adjust the transform processors to capture missing attributes or fix incorrect types. Use the collector's debug exporter to inspect the transformed data before it goes to the target.
- Document and maintain. Write down the schema version and the mapping rules. If you add new sources, follow the same pattern. Set up alerts on ingestion errors (e.g., collector logs) to catch issues early.
Common Mistakes
- Inconsistent timestamps: Mixing Unix epoch (seconds) with RFC3339 strings breaks time-based queries. Normalize everything to one format (preferably RFC3339 with milliseconds) during ingestion.
- Overloading attributes: Putting high-cardinality values like request IDs into
attributesis fine, but avoid using them as thenamefield, as that defeats grouping. - Ignoring resource attributes: If you don't add
service.name, you won't be able to correlate metrics from different services later. - Not handling missing fields: Some logs may not have a timestamp or a message. Define defaults (e.g., set timestamp to ingestion time) to avoid drops.
- Forgetting to update the schema: When you add a new telemetry type, you must extend the schema and the transforms. Otherwise, data will be silently lost.
Tips
- Start with a small set of sources (e.g., one metric, one log, one trace) and validate the full pipeline before scaling up.
- Use the collector's
debugexporter to see exactly what data is being sent. It prints the transformed records to stdout. - Leverage the
memory_limiterprocessor to prevent the collector from crashing under high load. - Use a naming convention for attributes: e.g.,
http.method,db.systemto keep things consistent across sources. - Test your queries early. If you can't query the data in the target platform, the mapping is likely wrong.
Troubleshooting
- No data appears in the target: Check the collector's logs for export errors. Verify the endpoint URL and authentication. Use the debug exporter to confirm data is being processed.
- Data appears but fields are missing: Review your transform processors. Check if the source field names are correct (e.g., Prometheus labels are lowercase, but your schema might expect camelCase). Use the debug exporter to see the raw transformed record.
- Timestamps are off by hours: Ensure all sources and the collector are using the same timezone (UTC is best). Check if the source sends epoch in milliseconds vs seconds—convert accordingly.
- Duplicate records: This can happen if you have multiple collectors or if the source sends retries. Check your exporter settings for idempotency, and ensure only one collector is ingesting each source.
- High memory usage in collector: Add the
memory_limiterprocessor and set a reasonable limit. Also, consider batching with thebatchprocessor to reduce overhead.
Frequently Asked Questions
What exactly is a unified observability data model?
It's a single schema that can represent metrics, logs, and traces in a consistent way, so you can store and query them together. Typically, each record has a timestamp, type, name, attributes, and value.
Do I need to use OpenTelemetry Collector?
No, but it's the most common and flexible tool. You can use any agent that supports transformation and forwarding, like Fluent Bit or a vendor-specific agent, as long as it can map to your target schema.
How do I handle high-cardinality attributes like user IDs?
Store them as attributes, not as part of the name or as separate fields. This keeps cardinality manageable for indexing while still allowing filtering.
Can I use the same schema for events (e.g., deployments)?
Yes, treat events as a special type (e.g., type: 'event') with a name and attributes. The same ingestion pipeline works.
What if my target platform doesn't support a unified schema?
You may need to store each signal separately but still use a common naming convention for attributes. Some platforms have built-in correlation via trace IDs, which can help.
How do I migrate existing telemetry to the new model?
You can backfill by replaying historical data through the same transformation pipeline. For logs, you might need to re-ingest from archives. For metrics, you can use remote write to re-send from Prometheus.