Skip to content

Commit

Permalink
add templated events and links
Browse files Browse the repository at this point in the history
  • Loading branch information
ie-pham committed Jan 12, 2024
1 parent 61a9688 commit 58a4aa5
Show file tree
Hide file tree
Showing 3 changed files with 418 additions and 11 deletions.
14 changes: 13 additions & 1 deletion examples/template/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const client = new tracing.Client({
const traceDefaults = {
attributeSemantics: tracing.SEMANTICS_HTTP,
attributes: {"one": "three"},
randomAttributes: {count: 2, cardinality: 5}
randomAttributes: {count: 2, cardinality: 5},
eventDefaults: {generateExceptionOnError: true, count: 1.0, randomAttributes: {count: 2, cardinality: 3}},
linkDefaults: {linkToPreviousSpanIndex: true, count: 1.0, randomAttributes: {count: 2, cardinality: 3}},
}

const traceTemplates = [
Expand Down Expand Up @@ -63,6 +65,16 @@ const traceTemplates = [
{service: "auth-service", name: "authenticate", attributes: {"http.status_code": 403}},
]
},
{
defaults: traceDefaults,
spans: [
{service: "shop-backend", attributes: {"http.status_code": 403}},
{service: "shop-backend", name: "authenticate", attributes: {"http.request.header.accept": ["application/json"]}},
{service: "auth-service", name: "authenticate", attributes: {"http.status_code": 403}},
{service: "test-random", name: "events", randomEvents: {exceptionCount: 1, count: 2, randomAttributes: {count: 5, cardinality: 2}}},
{service: "test-random", name: "links", randomLinks: {linkToPreviousSpanIndex: true, count: 2, randomAttributes: {count: 3, cardinality: 2}}}
]
},
]

export default function () {
Expand Down
Loading

0 comments on commit 58a4aa5

Please sign in to comment.