Skip to content

Commit

Permalink
Fix demo sample recognition by fixing the demo tag (#972)
Browse files Browse the repository at this point in the history
When `demo_sample` was passed as an attribute to the
`createOpenTelemetrySpan` extension function it wasn't recognized as a
tag for AppSignal. The UI only recognizes tags and not root level
attributes for the demo samples box.

Use the attribute format described in our docs to transform the
attribute into a tag.
https://docs.appsignal.com/opentelemetry/custom-instrumentation/attributes.html#tag
  • Loading branch information
tombruijn authored Jan 9, 2024
1 parent e37f91b commit c49dbf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changesets/fix-demo-sample-recognition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Fix the demo sample recognition. Demo samples didn't show the helpful explanation box in the UI, because the `demo_sample` tag was set incorrectly as an attribute.
4 changes: 2 additions & 2 deletions src/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function demo(client: Client) {
startSec + 1,
startNsec * 1.2,
"GET /demo",
{ demo_sample: true },
{ "appsignal.tag.demo_sample": true },
"@opentelemetry/instrumentation-http"
)
performanceRootSpan.close()
Expand Down Expand Up @@ -53,7 +53,7 @@ export function demo(client: Client) {
startSec + 1,
startNsec + 200,
"GET /demo",
{ demo_sample: true },
{ "appsignal.tag.demo_sample": true },
"@opentelemetry/instrumentation-http"
)
try {
Expand Down

0 comments on commit c49dbf3

Please sign in to comment.