Drop the stringified data point from Analytics Engine query text - #241
Open
ayaangazali wants to merge 1 commit into
Open
Drop the stringified data point from Analytics Engine query text#241ayaangazali wants to merge 1 commit into
ayaangazali wants to merge 1 commit into
Conversation
Contributor
Author
|
Still reproduces on This is the smallest of the Cloudflare PRs I have open and it deletes a line rather than adding behaviour, so it is easy to say no to. Happy to close it if you would rather keep the attribute present, even with that value. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect
Every Analytics Engine span carries
db.query.text: "writeDataPoint [object Object]".writeDataPointis the only method onAnalyticsEngineDataset, so this is on 100% of AE spans, not an edge case.Evidence
instrumentAEFnbuilt the query text by interpolating the first argument:For KV and Durable Object storage that argument is a key string, so the same line reads sensibly there. For Analytics Engine it is an
AnalyticsEngineDataPointobject, and a template literal stringifies it to[object Object].Verified on current main with the file's existing
InMemorySpanExporterharness.writeDataPoint({ blobs: ['b'], doubles: [1], indexes: ['idx'] })produced exactlywriteDataPoint [object Object].Fix
Remove the attribute rather than reformat it. A data point write has no query text to report,
db.operation.namealready carrieswriteDataPoint, and the data point's contents are already summarised bydb.cf.ae.indexes,db.cf.ae.index,db.cf.ae.doublesanddb.cf.ae.blobs. Settingdb.query.textto the bare operation name would only duplicatedb.operation.name.The new test asserts the span's complete attribute set, so it fails if the placeholder returns and also if an unexpected attribute appears. Restoring the old line fails it with
+ "db.query.text": "writeDataPoint [object Object]".If you would rather AE spans keep a
db.query.textfor consistency with KV and DO storage, say so and I will set it to the operation name instead.Built this with Claude Code's help and reviewed the diff myself.