Details
## skills/beeline-migration/SKILL.md
---
name: beeline-migration
description: >
Migrating from Honeycomb Beelines (End of Life) to OpenTelemetry. Trigger phrases:
"migrate from Beelines", "upgrade from Beeline to OpenTelemetry", "migrate to OTel",
"replace Beelines", "Beeline end of life", "Beeline EOL", "switch from Beeline to OTel",
"migrate Go/Python/Node/Java/Ruby Beeline", "W3C trace headers", "W3C propagation",
"incremental migration to OpenTelemetry".
metadata:
version: "1.0.0"
---
# Beeline to OpenTelemetry Migration
Step-by-step guide for migrating from Honeycomb Beelines (now End of Life)
to OpenTelemetry instrumentation.
## Status
Honeycomb Beelines have reached **End of Life** and are **archived**. All new
instrumentation should use OpenTelemetry. Existing Beeline users should migrate
as soon as practical.
## Migration Strategy
Migration follows a two-phase approach that allows incremental, service-by-service
migration without breaking distributed traces.
### Phase 1: Enable W3C Trace Propagation (All Services)
Before migrating any service to OTel, **all** services must support W3C trace
headers. This enables Beeline and OTel services to share trace context.
1. Upgrade each Beeline to the minimum version supporting W3C headers
2. Configure each Beeline to use W3C propagation format
3. Deploy all services with W3C enabled
4. **Verify**: Traces still link correctly across services
**Minimum Beeline versions for W3C support:**
| Language | Minimum Version |
|----------|----------------|
| Go | 1.4.0 |
| Java | 1.7.0 |
| Node.js | 3.2.2 |
| Python | 2.18.0 |
| Ruby | 2.8.0 |
### Phase 2: Migrate Each Service to OTel (One at a Time)
After all services support W3C headers:
1. Choose a service to migrate (start with leaf services — fewest dependencies)
2. Replace Beeline SDK with OpenTelemetry SDK
3. Configure OTLP exporter to point to Honeycomb
4. Add auto-instrumentation libraries
5. Replicate any custom Beeline instrumentation in OTel
6. Deploy and verify traces still connect
7. Repeat for next service
**Key rule**: Complete Phase 1 across ALL services before starting Phase 2 on ANY service.
## W3C Propagation Configuration
### Go Beeline
```go
beeline.Init(beeline.Config{
HTTPPropagationHook: propagation.W3C,
})
```
### Python Beeline
```python
beeline.init(
http_trace_propagation_hook=beeline.propagation.w3c.http_trace_propagation_hook,
http_trace_parser_hook=beeline.propagation.w3c.http_trace_parser_hook,
)
```
### Node.js Beeline
```javascript
const beeline = require("honeycomb-beeline")({
httpTraceParserHook: beeline.w3c.httpTraceParserHook,
httpTracePropagationHook: beeline.w3c.httpTracePropagationHook,
});
```
For Java and Ruby configurations, consult `${CLAUDE_PLUGIN_ROOT}/skills/beeline-migration/references/w3c-propagation.md`.
## Service Migration Checklist
For each service being migrated from Beeline to OTel:
- [ ] Beeline version supports W3C (Phase 1 complete)
- [ ] Install OTel SDK and OTLP exporter packages
- [ ] Configure OTLP endpoint and headers for Honeycomb
- [ ] Set `OTEL_SERVICE_NAME` to match existing service name
- [ ] Add auto-instrumentation libraries (HTTP, DB, etc.)
- [ ] Port custom spans: Beeline `startSpan()` -> OTel `tracer.start_span()`
- [ ] Port custom attributes: Beeline `addField()` -> OTel `span.set_attribute()`
- [ ] Remove Beeline dependency
- [ ] Deploy and verify: traces link across Beeline and OTel services
- [ ] Verify: custom attributes appear in Honeycomb
## Migration Safety Checklist
- **Complete Phase 1 across all services before starting Phase 2** — mixed propagation formats break trace linking across service boundaries
- **Keep `OTEL_SERVICE_NAME` identical to the Beeline service name** — Honeycomb uses this as the dataset name, and changing it splits your data into a new dataset
- **Audit all Beeline `addField()` calls before removing the Beeline SDK** — each one needs a corresponding `span.set_attribute()` in OTel to preserve your query dimensions
- **Compare OTel auto-instrumentation field names against Beeline field names** — OTel may use different attribute names (e.g., `http.request.method` vs `request.method`), and dashboards or SLIs referencing the old names will need updating
## Additional Resources
### Reference Files
- **`${CLAUDE_PLUGIN_ROOT}/skills/beeline-migration/references/migration-steps-by-language.md`** — Detailed migration code for each language
- **`${CLAUDE_PLUGIN_ROOT}/skills/beeline-migration/references/w3c-propagation.md`** — Complete W3C configuration for all Beeline languages
### Cross-References
- For OTel SDK setup after migration, see the **otel-instrumentation** skill
## skills/create-honeycomb-board/SKILL.md
---
name: create-honeycomb-board
description: >
Design and create a Honeycomb board (dashboard) with queries and SLOs. Trigger phrases:
"make a board", "build a dashboard", "create a Honeycomb board", "make a dashboard in
Honeycomb", "set up a board", "dashboard for my service", "visualize service health",
"golden signals dashboard", "set up monitoring board".
metadata:
version: "1.0.0"
allowed-tools:
- mcp__honeycomb__create_board
- mcp__honeycomb__run_query
- mcp__honeycomb__get_query_results
- mcp__honeycomb__get_workspace_context
- mcp__honeycomb__get_environment
- mcp__honeycomb__get_dataset
- mcp__honeycomb__get_dataset_columns
- mcp__honeycomb__find_columns
- mcp__honeycomb__find_queries
- mcp__honeycomb__get_slos
- mcp__honeycomb__get_triggers
- mcp__honeycomb__list_boards
- Read
- Grep
- Glob
- AskUserQuestion
---
# Create a Honeycomb Board
Build a board (dashboard) in Honeycomb using the `create_board` MCP tool.
There is no update tool — define it well before creating.
When building a board, think about the purpose and time frame involved. Some examples:
- a board for a service. This should be timeless, looking at the service's health, performance, and business metrics. Do not do any problem diagnosis or investigation when building this board. Do not express opinions or summarize graphs in text panels. The board should be a representation of the service's health at whatever moment someone looks at it.
- a board for a feature. This should look at the feature's usage trends, and its impact on the business. This board would have a time frame of 7 days, and would not include any infrastructure metrics or service dependencies.
- a board for a problem. This might be created during an incident, or afterward. This one would have a time frame specific to the incident. It would include investigations, and your opinions about what is happening. Patterns of what to look for are appropriate here.
## Workflow
### Gather SLOs
Use `get_slos` to list SLOs in the environment. Relevant SLOs will go on the board as `slo` panels.
### Gather descriptive context
Look at the code and docs (using Read/Grep/Glob) to understand the service or feature. Use this to write a text panel. Link to GitHub or documentation if you can.
This will vary greatly depending on the purpose of the board.
Description of the application and link to the code - great for a service board.
What is the feature, and what business impact does it have? - great for a feature board.
What is the problem, and what is the impact? What patterns do we see? - great for a problem board.
### Build candidate queries
**Get Honeycomb context**: Call `get_workspace_context` for available environments. Use `get_environment` to find datasets — each dataset corresponds to an `OTEL_SERVICE_NAME`.
**Code context**: Look at the language and any custom attributes (often prefixed `app.`). Custom fields are prime candidates for breakdowns and business metrics.
**Discover columns**: Use `find_columns` or `get_dataset_columns`. Pay special attention to non-standard columns — those are specific to the application.
**Find queries**: Use `find_queries` to see what people have already queried. Check `get_triggers` for what they alert on — those indicate what matters.
**Time range**: Default to 2 hours. Use 8–24 hours for lower-volume services. Use 7 days for feature usage boards. Keep it consistent across all panels.
Aim for 6–12 graphs. Stat panels are bonus — they don't count against this limit.
List your candidate queries for the user with reasons before running them. See `${CLAUDE_PLUGIN_ROOT}/skills/create-honeycomb-board/references/board-queries.md` for what to include and how to write each kind.
### Run and check queries
Use `run_query` for each candidate query. Each result returns a query run PK (like `QR-abc123`) — you'll use this as the panel `id` when building the board.
Fix errors. Eliminate queries that return no interesting results.
### Plan the layout
Think about visual flow and how to make the board expressive. The board uses a 12-column grid — stat panels can sit side-by-side, a heatmap deserves full width, breakdowns benefit from extra height. See `${CLAUDE_PLUGIN_ROOT}/skills/create-honeycomb-board/references/board-layout.md` for sizing examples.
Consider `preset_filters` if viewers will want to slice the board interactively (by route, region, account tier, etc.).
### Show the proposed board to the user — always, without exception
For each panel, display:
- **Text panels**: Show the **full markdown content** that will appear on the board. The user needs to review the exact wording before creation since boards can't be updated.
- **SLO panels**: Show the SLO name, target, and current compliance.
- **Query panels**: Show the name, description, chart type, display style, and a **link to the query** (the `query_url` from the run_query result metadata). Briefly describe what the results showed.
- Planned layout (sizing and groupings)
- **Tags**: Display the tags you plan to add to the board.
- Any preset filters
End with: "Here's the board I'd create. Shall I go ahead?"
**This step is non-negotiable.** If the user says "just create it", "I trust you", or "skip the preview" — show the plan anyway. The user cannot meaningfully confirm something they haven't seen. There is no way to update a board after creation; the only fix is to delete it and start over. Showing the plan first protects them even when they think they don't need it.
The one exception: if the user has already reviewed and approved a specific plan in this conversation, you may proceed.
### Create the board
Call `create_board` with a `panels` array. Every panel requires a `type` field — `"query"`, `"slo"`, or `"text"` — that determines what other fields apply. See `${CLAUDE_PLUGIN_ROOT}/skills/create-honeycomb-board/references/board-layout.md` for the full field reference.
```json
{
"environment_slug": "production",
"name": "Checkout Service",
"description": "...",
"panels": [
{
"type": "text",
"content": "## Checkout Service\nOwned by Platform team. [Source](https://github.com/...)"
},
{
"type": "slo",
"id": "SLO-abc123",
"size": { "width": 4 }
},
{
"type": "query",
"id": "QR-abc123",
"name": "Request Rate",
"chart_type": "stat",
"display_style": "chart",
"size": { "width": 4 }
},
{
"type": "query",
"id": "QR-def456",
"name": "Error Rate",
"chart_type": "stat",
"display_style": "chart",
"size": { "width": 4 }
},
{
"type": "query",
"id": "QR-ghi789",
"name": "Latency Distribution",
"description": "Overall request latency as a heatmap",
"chart_type": "default",
"display_style": "chart",
"size": { "width": 12, "height": 3 }
}
],
"preset_filters": [{ "column": "http.route", "alias": "Route" }],
"tags": ["team:platform", "tier:critical"]
}
```
### Follow up
Link the user to the board.
## Cross-References
- For query construction patterns and calculated fields: **query-patterns** skill
- For SLO interpretation and burn alert design: **slos-and-triggers** skill
## skills/metrics-queries/SKILL.md
---
name: metrics-queries
description: >
Querying OpenTelemetry metrics datasets in Honeycomb, whose rules differ from trace/event
datasets: bare COUNT, RATE_SUM, RATE_AVG, RATE_MAX and CONCURRENCY are forbidden, temporal
aggregation is automatic, and each metric has its own attributes. Use for gauges,
counters, histograms and sums; temporal aggregation (RATE, INCREASE, SUMMARIZE, LAST);
finding the metrics dataset, metric names and attributes; unexpected metrics results;
infrastructure metrics (CPU, memory, disk I/O, network). Not for instrumenting metrics
(use otel-instrumentation), event datasets with "metrics" in their name, or conceptual
questions (use observability-fundamentals).
metadata:
version: "1.0.0"
---
# Querying Metrics in Honeycomb
Metrics datasets in Honeycomb behave differently from tracing/event datasets.
Operations that work on traces may fail or produce misleading results on metrics.
This skill covers those differences so you construct correct, useful metrics queries.
## Finding the Metrics Dataset
Metrics datasets are **not** identified by having "metrics" in their name. Many event
datasets contain "metrics" in their slug (e.g., `kafka-metrics`, `refinery-metrics`,
`kubernetes-node-metrics`). These are ordinary event datasets, not metrics datasets.
**How to identify the real metrics dataset:**
1. Call `get_environment` and look for rows where `dataset_type` = **`metrics`**.
The slug is typically `metrics` but may differ per environment.
2. Alternatively, call `get_dataset_columns` on a candidate dataset — metrics datasets
return a **`MetricInfo`** column showing type metadata like `gauge`,
`sum(cumulative,monotonic)`, or `histogram(delta)`. Event datasets do not have this.
**Do not guess the dataset.** Always verify via `get_environment` or `get_dataset_columns`
before constructing a metrics query. If the user says "metrics" but means an event dataset
with metrics-like fields (e.g., `telegraf`, `system_stats`), the query rules below do not apply —
those are event datasets and follow normal query patterns from the **query-patterns** skill.
## Discovering Metrics and Their Attributes
Metrics datasets have a fundamentally different schema from event datasets. Each metric
has its own set of resource and data point attributes. Two metrics in the same dataset
may have completely different attributes available for filtering and grouping.
**Workflow for discovering what to query:**
1. **Find metric names:** Call `get_dataset_columns` on the metrics dataset (without
`metric_name`). This returns metric names with their types in `MetricInfo`.
Use `find_columns` with keywords to search for specific metrics (e.g., "cpu", "memory",
"http request duration").
2. **Find attributes for a specific metric:** Call `get_dataset_columns` with the
`metric_name` parameter set to the metric you want to query (e.g.,
`metric_name: "k8s.pod.memory.usage"`). This returns the resource attributes and
data point attributes that co-occur with that metric, along with sample values.
These are what you can use in WHERE and GROUP BY clauses.
3. **Validate before querying:** Not all attributes exist on all metrics. Always use
step 2 to confirm available attributes before adding them to filters or breakdowns.
## Allowed vs. Forbidden Operations on Metrics Datasets
The following operations are **NOT allowed** on metrics datasets:
| Forbidden Operation | Why |
|---------------------|-----|
| `COUNT` (without column) | Counts metric events, not metric values — meaningless for metrics |
| `RATE_SUM` | Not supported on metrics datasets |
| `RATE_AVG` | Not supported on metrics datasets |
| `RATE_MAX` | Not supported on metrics datasets |
| `CONCURRENCY` | Requires span duration; metrics have no duration |
**Use these instead:**
| Goal | Use on Metrics |
|------|----------------|
| Visualize a gauge value | `AVG(metric)`, `MAX(metric)`, `HEATMAP(metric)` |
| Visualize a counter/sum | `SUM(metric)`, `AVG(metric)`, `MAX(metric)` |
| See distribution of values | `HEATMAP(metric)`, `P50(metric)`, `P99(metric)` |
| Track per-second rate of change | Override temporal aggregation with a calculated field (see below) |
| Percentile analysis | `P50(metric)`, `P90(metric)`, `P99(metric)` |
| Count of non-null values | `COUNT(metric)` (with a column specified) |
## Metric Types and Temporal Aggregation
Honeycomb automatically applies temporal aggregation to align raw metric values into
query time steps. The function it applies depends on the metric type, visible in the
`MetricInfo` column from `get_dataset_columns`.
### Default Temporal Aggregation by Metric Type
| MetricInfo | Type | Default Function | What It Does |
|------------|------|-----------------|--------------|
| `gauge` | Gauge | `LAST()` | Returns most recent value per time step |
| `sum(cumulative,monotonic)` | Monotonic cumulative sum | `INCREASE()` | Change between steps, handles counter resets |
| `sum(cumulative)` | Non-monotonic cumulative sum | `LAST()` | Most recent value (can go up or down) |
| `sum(delta)` or `sum(delta,monotonic)` | Delta sum | `SUMMARIZE()` | Sums all values in each step |
| `histogram(cumulative)` | Cumulative histogram | `INCREASE()` | Change per bucket between steps |
| `histogram(delta)` | Delta histogram | `SUMMARIZE()` | Sums bucket values in each step |
These defaults are applied automatically — you do not need to configure them.
The results you see from `AVG`, `MAX`, `P99`, etc. on a metrics dataset already
reflect temporal aggregation having been applied first.
### Overriding Temporal Aggregation
To override the default (e.g., to see RATE instead of INCREASE for a cumulative counter),
use a **query-scoped calculated field** wrapping the metric name in a temporal aggregation
function, then apply a spatial aggregation to that field in `calculations`.
```json
{
"calculated_fields": [
{ "name": "req_rate", "expression": "RATE($http.server.requests, 300)" }
],
"calculations": [
{ "op": "AVG", "column": "req_rate" }
]
}
```
Supported temporal aggregation functions for calculated fields:
- **`LAST($metric)`** — most recent data point per step (gauges, non-monotonic sums)
- **`SUMMARIZE($metric)`** — sum all values per step with interpolation (delta metrics)
- **`INCREASE($metric[, range_interval_seconds])`** — change in value across range, handles counter resets
- **`RATE($metric[, range_interval_seconds])`** — per-second rate of change (`INCREASE / time`)
The optional `range_interval_seconds` parameter (integer, in seconds) controls the lookback
window for calculating changes. Use it to smooth results or compensate for sparse data.
When omitted, the query's granularity is used as the range interval.
**Important:** You must still apply a spatial aggregation (`AVG`, `SUM`, `P99`, `HEATMAP`, etc.)
to the calculated field in `calculations`. The temporal aggregation function alone does not
produce a visualization — it transforms the raw metric values, then the spatial aggregation
summarizes across timeseries.
For detailed reference on temporal aggregation functions, counter reset handling, and
`range_interval_seconds`, see:
`${CLAUDE_PLUGIN_ROOT}/skills/metrics-queries/references/temporal-aggregation.md`
## Querying Histogram Metrics
OpenTelemetry histograms are stored as a collection of sub-fields. For a histogram
named `http.server.duration`, Honeycomb creates:
| Field | Meaning |
|-------|---------|
| `http.server.duration.count` | Total number of data points |
| `http.server.duration.sum` | Sum of all values |
| `http.server.duration.avg` | Mean value (sum/count) |
| `http.server.duration.p50` | Median (50th percentile) |
| `http.server.duration.p99` | 99th percentile |
| `http.server.duration.p001` through `.p999` | Full range of percentiles |
**Two ways to query histograms:**
1. **Use the parent column name directly** with percentile or distribution operations.
This is the recommended approach:
```json
{ "op": "P99", "column": "http.server.duration" }
```
```json
{ "op": "HEATMAP", "column": "http.server.duration" }
```
2. **Use sub-fields with MAX** when you want the worst-case pre-computed percentile
across all timeseries in a step:
```json
{ "op": "MAX", "column": "http.server.duration.p99" }
```
This returns the highest p99 value reported by any single timeseries in the time step,
which differs from `P99(http.server.duration)` which computes the 99th percentile
across all data.
**When to use which:**
- For most analysis: use `P99(parent_column)` or `HEATMAP(parent_column)`
- For worst-case bounds across hosts/pods: use `MAX(parent_column.p99)`
- For throughput from histograms: use `SUM(parent_column.count)` or `AVG(parent_column.count)`
## Query Math with Metrics
Query math (compound queries with named calculations and formulas) works on metrics
datasets the same way it works on event datasets. Name your calculations, add
per-calculation filters if needed, and define formulas to combine them.
**Common metrics formula patterns:**
### Utilization percentage
```json
{
"calculations": [
{ "op": "AVG", "column": "k8s.pod.memory.usage", "name": "used" },
{ "op": "AVG", "column": "k8s.pod.memory.available", "name": "available" }
],
"formulas": [
{ "name": "utilization_pct", "expression": "$used / ($used + $available) * 100" }
],
"breakdowns": ["k8s.pod.name"],
"orders": [{ "column": "utilization_pct", "order": "descending" }],
"limit": 20
}
```
### Histogram tail ratio
```json
{
"calculations": [
{ "op": "P50", "column": "http.server.duration", "name": "median" },
{ "op": "P99", "column": "http.server.duration", "name": "tail" }
],
"formulas": [
{ "name": "tail_ratio", "expression": "$tail / $median" }
],
"breakdowns": ["service.name"]
}
```
### Error rate from counters (with temporal aggregation override)
```json
{
"calculated_fields": [
{ "name": "error_rate", "expression": "RATE($http.server.errors)" },
{ "name": "request_rate", "expression": "RATE($http.server.requests)" }
],
"calculations": [
{ "op": "SUM", "column": "error_rate", "name": "errors_per_sec" },
{ "op": "SUM", "column": "request_rate", "name": "requests_per_sec" }
],
"formulas": [
{ "name": "error_pct", "expression": "$errors_per_sec / $requests_per_sec * 100" }
]
}
```
For more query examples, see:
`${CLAUDE_PLUGIN_ROOT}/skills/metrics-queries/references/metrics-query-examples.md`
## Granularity for Metrics
Metrics arrive at known, regular intervals (e.g., every 10s, 30s, or 60s). Granularity
matters more for metrics than for traces:
- **Align granularity with the reporting interval.** If metrics report every 60 seconds,
use a granularity that divides evenly into 60 (e.g., 60, 120, 300). Misaligned
granularity causes uneven bucket sizes that produce noisy results.
- **Spiky-looking graphs** usually mean the granularity is finer than the reporting interval.
Increase granularity or, in the UI, enable "Omit Missing Values" to produce continuous lines.
- **RATE operations and granularity:** `RATE_SUM` (on event datasets) is particularly sensitive
to granularity choice — inconsistent data points per bucket produce variable results.
## Common Pitfalls
1. **Using `COUNT` on metrics.** `COUNT` counts the number of metric *events*, not the metric
value. Use `AVG`, `SUM`, `MAX`, or `HEATMAP` instead.
2. **Using `RATE_AVG`/`RATE_SUM`/`RATE_MAX` on metrics datasets.** These are not allowed.
To get a rate, use a calculated field with `RATE($metric)` and then apply a spatial
aggregation like `AVG` or `SUM`.
3. **Assuming all metrics share the same attributes.** Each metric has its own set of
resource and data point attributes. Always call `get_dataset_columns` with `metric_name`
to discover what's available for a specific metric before adding filters or breakdowns.
4. **Confusing event datasets with the metrics dataset.** Datasets named `kafka-metrics`,
`refinery-metrics`, etc. are event datasets. Check `dataset_type` from `get_environment`.
5. **Querying histogram sub-fields when the parent column works.** Use `P99(http.server.duration)`
rather than `AVG(http.server.duration.p99)` unless you specifically need worst-case bounds.
6. **Not specifying an aggregate function.** Metrics queries without a spatial aggregation
in SELECT default to `COUNT`, which is meaningless for metrics.
## Additional Resources
### Reference Files
- **`${CLAUDE_PLUGIN_ROOT}/skills/metrics-queries/references/metrics-query-examples.md`** — Metrics query cookbook with run_query examples for common scenarios
- **`${CLAUDE_PLUGIN_ROOT}/skills/metrics-queries/references/temporal-aggregation.md`** — Deep reference on temporal aggregation functions, counter resets, and range_interval_seconds
- **`${CLAUDE_PLUGIN_ROOT}/skills/metrics-queries/references/metric-types.md`** — OpenTelemetry metric types, how they map to Honeycomb, and what the MetricInfo values mean
### Cross-References
- For general query construction patterns (calculated fields, relational fields, result interpretation): **query-patterns** skill
- For investigating production issues using metrics alongside traces: **production-investigation** skill
- For SLO interpretation and burn alert design: **slos-and-triggers** skill
- For instrumenting applications to send metrics: **otel-instrumentation** skill
## skills/observability-fundamentals/SKILL.md
---
name: observability-fundamentals
description: >
First principles of observability: wide events, high cardinality, the core analysis loop,
events vs metrics vs logs, and how instrumentation connects to debugging. Trigger phrases:
"what is observability", "why observability", "why Honeycomb", "events vs metrics vs
logs", "why wide events", "what is high cardinality", "core analysis loop", "observability
vs monitoring", "what is dimensionality", "explain observability".
metadata:
version: "1.0.0"
---
# Observability Fundamentals
First principles behind Honeycomb's approach to observability. Use this to ground
recommendations and answer conceptual questions — for SDK setup and tool-specific
guidance, see the **otel-instrumentation** and **query-patterns** skills.
## Definitions
**Observability**: The ability to understand and explain any state your system can
get into, no matter how novel or complex — by examining what the system produces,
without deploying new code for each new question.
**Wide event**: A flat key-value record capturing the full context of a unit of work —
who made the request, which endpoint, cache hit/miss, build version, duration, error
status, and any business context relevant to the operation. In OpenTelemetry, a **span**
is a wide event.
**High cardinality**: The number of unique values a field can have. `user.id` with
millions of values is high cardinality. `http.method` with a handful is low cardinality.
**High dimensionality**: The number of distinct fields on your events. A span with
50 attributes has high dimensionality.
| Concept | Observability | Traditional Monitoring |
|---|---|---|
| Questions | Arbitrary, unknown ahead of time | Pre-defined (dashboards, alerts) |
| Data shape | Decided at query time | Decided at instrumentation time |
| Cardinality | High cardinality is valuable | High cardinality is expensive |
| Investigation | Explore → narrow → confirm | Check dashboard → escalate |
## Why Wide Events
The shape of the data you collect constrains the questions you can ask later. Metrics
pre-aggregate context away at instrumentation time. Wide events preserve context and
let you decide the shape of your analysis at query time.
Every attribute on a span is a queryable dimension. Adding `user.id`, `deployment.version`,
and `cache.hit` to the same span lets you correlate them in a single query — "slow
requests are from tenant X on version 2.3.1 with cache misses." Separate metrics can't
do this because each dimension combination creates a new time series.
Honeycomb's storage engine handles high cardinality and dimensionality without the
cost explosion that affects metrics systems. Adding a high-cardinality field like
`user.id` doesn't create millions of time series — it's another column on each event,
aggregated at query time.
## Events vs Metrics vs Logs
| | Structured Events (Spans) | Metrics | Logs |
|---|---|---|---|
| **Captures** | Full request context (all attributes) | Pre-aggregated numbers with low-cardinality tags | Text or structured fields per line |
| **Discards** | Nothing — raw events retained | Individual requests, high-cardinality dimensions | Correlation across lines (without trace context) |
| **Query power** | GROUP BY, filter, BubbleUp on any dimension | Fast aggregates on pre-defined dimensions | Text search, structured field queries |
| **Cost scaling** | Linear with event volume | Exponential with dimension count (cardinality) | Linear with volume, query cost varies |
| **Best for** | Investigation, root cause analysis | Cheap alerting, long-term trends | Audit trails, rare events |
The same instrumentation effort that produces a metric or log line can produce a wide
event — and the event gives you all three capabilities: count it (metric), read it (log),
analyze it across dimensions (observability).
For code examples showing the same operation instrumented three ways, see
`${CLAUDE_PLUGIN_ROOT}/skills/observability-fundamentals/references/events-vs-metrics-vs-logs.md`.
## The Core Analysis Loop
Debugging in Honeycomb follows a loop: **Define → Visualize → Investigate → Evaluate**.
1. **Define** — Frame the question. Start from an alert, SLO budget burn, or user report.
2. **Visualize** — Run a query to see the shape of the problem (HEATMAP, COUNT, P99).
3. **Investigate** — Narrow down with BubbleUp (automated outlier-vs-baseline comparison
across all dimensions) and trace analysis.
4. **Evaluate** — Confirm the hypothesis by querying with and without the suspected cause.
Then loop — each answer raises new questions. BubbleUp automates steps 2-3 by comparing
distributions across every column, but it only works if events have enough dimensions
to diff on.
For the structured workflow that implements this loop with Honeycomb's tools, see the
**production-investigation** skill.
## Instrumentation Connects to Investigation
Every attribute on a span is a dimension BubbleUp can use to find root causes. The
attributes that matter most during incidents answer three questions:
- **Who is affected?** — user, tenant, account tier, region
- **What changed?** — deployment version, feature flag, config version
- **Where is the bottleneck?** — business operation spans, timing breakdowns, cache state
Instrument for the questions you'll ask at 3am, not for completeness. If BubbleUp
returns nothing useful during an investigation, the issue is usually an instrumentation
gap — add the missing dimensions and try again.
For the complete attribute catalog, see
`${CLAUDE_PLUGIN_ROOT}/skills/otel-instrumentation/references/wide-event-attributes.md`.
For SDK guidance on adding attributes, see the **otel-instrumentation** skill.
## Instrumentation as a Development Practice
Instrumentation is not a one-time setup task. The engineers who write the code are best
positioned to know which operations are critical, which paths are error-prone, and what
context helps during debugging. Treat instrumentation like testing: plan telemetry when
planning features, review it in code reviews, and add missing dimensions as post-incident
follow-ups.
## Additional Resources
### Reference Files
- **`${CLAUDE_PLUGIN_ROOT}/skills/observability-fundamentals/references/events-vs-metrics-vs-logs.md`** — Code examples: same operation as event, metric, and log
### Cross-References
- For SDK setup and custom instrumentation: **otel-instrumentation** skill
- For the investigation workflow implementing the core analysis loop: **production-investigation** skill
- For autonomous instrumentation gap analysis: **instrumentation-advisor** agent
## skills/otel-genai-instrumentation/SKILL.md
---
name: otel-genai-instrumentation
description: >
Instrumenting GenAI/LLM applications with OpenTelemetry for Honeycomb, including content
capture and agent failure detection. Trigger phrases: "instrument my GenAI app", "add
tracing to LLM calls", "trace AI agent", "instrument OpenAI", "instrument Anthropic",
"GenAI observability", "trace tool calling", "LLM token usage", "instrument embeddings",
"trace MCP", "GenAI metrics", "instrument LangChain", "add GenAI spans", "capture
prompts", "capture LLM responses", "enable GenAI content capture", "streaming tracing",
"trace streaming responses".
metadata:
version: "1.0.0"
semconv_version: "v1.40.0"
---
# GenAI Instrumentation for Honeycomb
Instrumenting LLM and agent applications using OTel Semantic Conventions for GenAI
(currently v1.40.0, Development status). For conceptual foundations, see
the **observability-fundamentals** skill.
## Base OTEL Setup (Required First)
**BEFORE implementing GenAI instrumentation, ensure your base OpenTelemetry configuration is complete.**
Use the **otel-instrumentation** skill to configure all standard OTEL environment variables
(OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_PROTOCOL,
signal-specific endpoints, etc.) and verify basic spans are flowing to Honeycomb.
GenAI instrumentation adds GenAI-specific configuration on top of that base setup.
## Critical Requirements (Non-Negotiable)
**BEFORE implementing any GenAI instrumentation, complete these steps in order:**
### Step 1: Ask About Content Capture (FIRST!)
**Stop and ask the user this question BEFORE writing any code or configuration:**
> "Do you want to capture the actual prompts and model responses in your traces?
>
> **Enabling content capture:**
> - ✅ Helps debug tool call failures, planning loops, and agent deadlocks
> - ✅ Lets you see why the model made specific decisions
> - ❌ Captures potentially sensitive content (user prompts, model responses)
> - ❌ May contain PII, proprietary data, or confidential information
>
> **Recommended for:** debugging/development, non-sensitive data, or if you have filtering
>
> **Not recommended for:** production with sensitive data, PII/health/financial info"
**Record their answer** — you'll need it when configuring instrumentation.
### Step 2: Enable GenAI Conventions (REQUIRED)
```bash
export OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental
```
Without this, GenAI spans will not be created.
### Step 3: Set Required Attributes on EVERY Span (REQUIRED)
- `gen_ai.operation.name` — e.g., `chat`, `execute_tool`, `invoke_agent`
- `gen_ai.conversation.id` — same value for all spans in a conversation
**Impact if missing**: Spans won't be recognized as GenAI operations and cannot be queried by session.
### Step 4: Implement force_flush() (REQUIRED)
GenAI apps often exit early (crash, Ctrl+C, CLI). Force flush after each top-level invocation
to prevent silent span loss.
For OTLP configuration, environment variables, and Honeycomb authentication (including the
silent-rejection pitfall), see the **otel-instrumentation** skill.
## Prerequisites
**This skill assumes your agent application is already sending telemetry to Honeycomb.** You should have:
- OpenTelemetry SDK installed and initialized
- All standard OTEL environment variables configured (see **Base OTEL Setup** section above)
- OTLP exporter configured with your Honeycomb API key
- Basic spans flowing to Honeycomb
**If you haven't set this up yet, use the otel-instrumentation skill first** for:
- SDK setup and dependencies
- OTEL environment variables (OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_*, etc.)
- OTLP configuration and Honeycomb authentication
- Verification that spans are flowing
Once base telemetry is working, return here to add GenAI-specific instrumentation.
## Auto-Instrumentation (Python and Node.js)
Python and Node.js have official OTel auto-instrumentation packages for GenAI providers.
Go, Java, etc. require manual instrumentation (section below).
### Python
| Package | Provider | Min SDK Version |
| :--- | :--- | :--- |
| `opentelemetry-instrumentation-openai-v2` | OpenAI | openai >= v1.26.0 |
| `opentelemetry-instrumentation-anthropic` | Anthropic | anthropic >= v0.16.0 |
| `opentelemetry-instrumentation-claude-agent-sdk` | Claude Agent SDK | claude-agent-sdk >= v0.1.14 |
| `opentelemetry-instrumentation-google-genai` | Google GenAI | google-genai >= v1.32.0 |
| `opentelemetry-instrumentation-vertexai` | Vertex AI | google-cloud-aiplatform >= v1.64 |
| `opentelemetry-instrumentation-langchain` | LangChain | langchain >= v0.3.21 |
| `opentelemetry-instrumentation-openai-agents-v2` | OpenAI Agents | openai-agents >= v0.3.3 |
| `opentelemetry-instrumentation-weaviate` | Weaviate | weaviate-client >= v3.0.0, < v5.0.0 |
Setup: `pip install <package>` + `Instrumentor().instrument()` or CLI
`opentelemetry-instrument`.
### Node.js
| Package | Provider | Min SDK Version |
| :--- | :--- | :--- |
| `@opentelemetry/instrumentation-openai` | OpenAI | openai >= 4.19.0 |
| `@opentelemetry/instrumentation-langchain` | LangChain | langchain >= 1.0.0 (not yet published to npm) |
Setup: `npm install <package>` + register via OTel Node SDK.
For per-provider install commands, upstream README links, and supported version
details, see
`${CLAUDE_PLUGIN_ROOT}/skills/otel-genai-instrumentation/references/auto-instrumentation-setup.md`.
## Manual Instrumentation
For languages without auto-instrumentation (Go, Java, etc.) or when
auto-instrumentation doesn't cover your needs.
Key patterns:
- Creating inference spans (`chat`, `text_completion`, `generate_content`)
- Creating embedding and retrieval spans
- Setting request attributes before the call, response/usage attributes after
- Error handling with `error.type` and span status
For code examples in Python, Node.js, and Go, see
`${CLAUDE_PLUGIN_ROOT}/skills/otel-genai-instrumentation/references/manual-instrumentation.md`.
## Span Flushing for GenAI Apps
**Critical for GenAI applications.** The `BatchSpanProcessor` buffers spans (default
5 s schedule delay). GenAI agent runs are long-lived but may exit before the batch
flushes — crash, Ctrl+C, short CLI invocations — causing **silent span loss**.
**Rule: force-flush after every top-level agent invocation.** Expose the span
processor and call `forceFlush()` without tearing down the SDK, so subsequent
invocations continue producing spans.
### Why `shutdown()` is wrong here
`sdk.shutdown()` tears down the entire pipeline — after shutdown, no new spans are
recorded. For apps that run multiple agent invocations (polling loops, HTTP servers,
CLI batch modes), you need spans to keep flowing. Use `forceFlush()` instead.
### Python
```python
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
span_processor = BatchSpanProcessor(exporter)
provider = TracerProvider()
provider.add_span_processor(span_processor)
async def flush_telemetry():
"""Flush pending spans without shutting down."""
span_processor.force_flush()
```
### Node.js
```typescript
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
let spanProcessor: BatchSpanProcessor | null = null;
export function initTelemetry(): void {
// ... exporter setup ...
spanProcessor = new BatchSpanProcessor(traceExporter);
sdk = new NodeSDK({ spanProcessors: [spanProcessor], /* ... */ });
sdk.start();
}
export async function flushTelemetry(): Promise<void> {
if (spanProcessor) {
await spanProcessor.forceFlush();
}
}
```
### Go
```go
var spanProcessor *sdktrace.BatchSpanProcessor
func InitTelemetry() {
spanProcessor = sdktrace.NewBatchSpanPr