Skip to content

STAC-25469: map all span attrs - #15

Closed
deontaljaard wants to merge 2 commits into
mainfrom
stac-25469-database-mapping-updates
Closed

STAC-25469: map all span attrs#15
deontaljaard wants to merge 2 commits into
mainfrom
stac-25469-database-mapping-updates

Conversation

@deontaljaard

Copy link
Copy Markdown
Contributor

No description provided.

pattern: "db.(.*)"
target: "db.${1}"
pattern: (.*)"
target: "${1}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this pull in way too many attributes? These spans can also contain attributes with the SQL query template as value (this was already a problem with db.* I realize now), so would result in tons of updates to the component (every database call might trigger an update now).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A valid concern, but not that many from what I've observed. I first added more pattern/target pairs for server.* and net.*, but then thought we could be missing other useful info while still in this "maturing" phase.

An alternative is to have a specific tag map of all the attributes we want (covering legacy and new attributes), but then they need to go under optional. But since db attributes could theoretically change, I'm not sure we want to be that restrictive right now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying in all attributes can have much worse effects: it triggers updates to the component (and change events) for potentially every span that comes in (which can be every query that is executed, so hundreds or more per second). This will eat up resources (processing and disk)

Look at our own HBase for example (this one I hadn't even expected): it has an attribute with the thread name, which looks like a fork-join pool that has a counter for each new thread it creates.

https://stackpacks2.dev.stackstate.io/#/components/urn:opentelemetry:namespace%2Fsuse-observability-branch-master:service%2Fstackstate-server:database%2Fdefault/traces?rightPane=hidden-0__active_tab-selection__chain-span%3Ae4c1f115250e3fd14be585a940c1cd60%3A2407d93398682931%3A2407d93398682931&timeRange=1785903072844_1785913872844&timestamp=1785913872844.

Thinking more about this, for the long term we probably need to come up with a protection against this. We can't expect everyone to think through all the consequences either.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, not can, has - already observed this while trying out this mapping. Being specific in the tag mappings is necessary it seems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the protection: I think it should be doable to extend the existing tag mapping validation with a gate that prevents all attributes to be mapped (for dev/debug purposes it would be nice to disable such a gate).

@@ -99,8 +99,8 @@ nodes:
pattern: "(.*)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we also, already, include all resource attributes (on the original otel stackpack we only had a few). I'm still in doubt if that's a good idea or not (a restart will trigger an update because PID, etc will change). In the end I think I actually like it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good observation. Tbh, I don't think a lot of deep thought has gone into the tag mappings until now - mostly copy-paste from the first component mapping that was created. With semconv, we should be able to reliably declare fixed tag mapping target/pattern pairs so the mappings/presentations remain stable - we can be selective with the lifecycle attributes like you've pointed out so we don't have "no-op"/heartbeat updates that are unnecessary.

@deontaljaard

Copy link
Copy Markdown
Contributor Author

Closing this PR in light of a discussion where a more in-depth/thorough approach/fix for databases/messaging mapping needs to be done.

@deontaljaard
deontaljaard deleted the stac-25469-database-mapping-updates branch August 5, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants