apm icon indicating copy to clipboard operation
apm copied to clipboard

Alignment of span type/subtype

Open SylvainJuge opened this issue 4 years ago • 4 comments

This is a meta-issue to describe all the known alignment issues/inconsistencies with span type / subtype

The current state of specification is stored in tests/agents/json-specs/span_types.json in JSON format.

For convenience, we will refer to span type & subtype as type/subtype. This issue description will be modified when alignment progresses.

List of things that need improvement/simplification/alignment

  • [ ] create a generic subtype in app for internal delegation that is not framework/library specific: we currently have app/mailer, app/controller, app/resource and app/graphql #513
  • [ ] create a dedicated external/email for spans that send emails (would replace app/mailer)
  • [ ] remove json/parse and json/generate as it's only used by ruby, span naming might be enough. deprecated in #513
  • [ ] no strict specification for template/*, thus any value will be accepted as subtype, listing all known values for each platform is required to replace this with an exhaustive list, or we could replace it with a generic subtype.
  • [ ] move websocket to external/websocket
  • [ ] merge db/sqllite with db/sqlite3 deprecated in #513
  • [ ] merge db/sqlserver and db/mssql deprecated in #513
  • [ ] remove fields deprecated in #513

Process

  1. https://github.com/elastic/apm/issues/555
Agent Add automated span type/subtype checking against shared spec
Java issue details issue details
dot-net issue details issue details
Go issue details issue details
PHP issue details issue details
Ruby issue details issue details
NodeJS issue details issue details
Python issue details issue details
  1. add required type & subtypes the the JSON definition to make tests pass, open PRs (reviews optional)
  2. When merging spec PRs, add known inconsistencies to the list above (if required)
  3. discuss alignment through comments in this issue
  4. goto step 2

SylvainJuge avatar Sep 08 '21 09:09 SylvainJuge

@elastic/apm-agent-ruby there could be a few quick wins here:

  • use external/email instead of app/mailer
  • merge db/sqllite with db/sqlite3

For json/* I think we could use a generic subtype of app (the one we need to find a good name for), using span name should be enough for the end user to know it's about JSON read/write operations.

SylvainJuge avatar Sep 08 '21 09:09 SylvainJuge

Completely agree, @SylvainJuge. Good ideas 👍

mikker avatar Sep 08 '21 11:09 mikker

Proposal for internal delegation spans, simply call them app/internal (which would somehow align with Otel internal spans).

SylvainJuge avatar Sep 08 '21 12:09 SylvainJuge

Adding app/internal for generic spans: https://github.com/elastic/apm/pull/513 + few other alignment changes.

SylvainJuge avatar Sep 23 '21 12:09 SylvainJuge