elastic / elastic/apm

Improve Granularity for SQL Databases

Open
#621 4 comments 0 reactions 0 assignees View on GitHub
apm-agents meta
Dominant language
Gherkin
Stars
427
Forks
125
PR merge metrics
No merged PRs in 30d

Description

There are two parts to improving the granularity for SQL Databases:
- adding new fields to agent-server protocol, for now it's mostly to future-proof the captured data as we have to keep existing fields for compatibility with UI.
- capture values for those new fields on SQL Databases, which is actually providing better granularity to the end-user.

Each step can be completed independently, but this task will be considered complete when both parts are completed.

**First step : add new service fields**

- Add and capture values for `span.context.service.target.type` and `span.context.service.target.name` for exit spans.
- Infer from those new fields the value of `span.destination.service.resource` and keep sending it.
- Add `service_target_*` fields to dropped spans metrics: add `service_target_type` and `service_target_name` next to `destination_service_resource` in `transaction.dropped_spans_stats` array, the related metrics documents should include `span.service.target.type` and `span.service.target.name` fields.
- Handle span compression with new fields (stop relying on `resource` internally)

**Second step : capture values for new fields**

------

### Spec issue
Milestone

- [x] https://github.com/elastic/apm/issues/622

## Agent issues
- [x] https://github.com/elastic/apm-agent-java/issues/2541 Milestone
- [x] https://github.com/elastic/apm-agent-dotnet/issues/1664 Milestone
- [x] https://github.com/elastic/apm-agent-go/issues/1233 Milestone
- [x] https://github.com/elastic/apm-agent-nodejs/issues/2621 Milestone
- [x] https://github.com/elastic/apm-agent-python/issues/1497 Milestone
- [ ] https://github.com/elastic/apm-agent-ruby/issues/1244 Milestone
- [x] https://github.com/elastic/apm-agent-php/issues/647 Milestone

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the agent-server protocol fields, transaction.dropped_spans_stats metrics, and span compression handling named in the issue, then inspect the linked agent issues, especially the still-open Ruby issue. Done means both new service target fields are captured for SQL database exit spans, destination resource inference remains supported, dropped-span metrics include the fields, and compression handles them.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
backend-api-design, databases, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.