Skip to content

Commit eecfd1d

Browse files
committed
rename attributes
1 parent ece9a59 commit eecfd1d

13 files changed

+63
-61
lines changed

configs/gateway.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ class HiveTracingSpanProcessor implements SpanProcessor {
134134
rootSpan.updateName(`${operationType} ${operationName}`);
135135

136136
// Copy attributes to root span
137-
rootSpan.setAttribute('hive.graphql.operation.type', operationType);
138-
rootSpan.setAttribute('hive.graphql.operation.name', operationName ?? '');
139-
rootSpan.setAttribute('hive.graphql.operation.document', document);
137+
rootSpan.setAttribute('graphql.operation.type', operationType);
138+
rootSpan.setAttribute('graphql.operation.name', operationName ?? '');
139+
rootSpan.setAttribute('graphql.operation.document', document);
140140
rootSpan.setAttribute('hive.graphql.error.count', errorCount ?? 0);
141+
rootSpan.setAttribute('hive.graphql.operation.hash', 'FOFOFOFOFOFOFOFOF');
141142

142143
// Add the subgraph names as a comma-separated list
143144
if (subgraphNamesForTrace && subgraphNamesForTrace.size > 0) {
@@ -173,9 +174,9 @@ class HiveTracingSpanProcessor implements SpanProcessor {
173174
// add hive branded attributes
174175
//
175176
span.attributes['hive.subgraph.name'] = span.attributes['gateway.upstream.subgraph.name'];
176-
span.attributes['hive.graphql.operation.document'] = span.attributes['graphql.document'];
177-
span.attributes['hive.graphql.operation.name'] = span.attributes['graphql.operation.name'];
178-
span.attributes['hive.graphql.operation.type'] = span.attributes['graphql.operation.type'];
177+
span.attributes['graphql.operation.document'] = span.attributes['graphql.document'];
178+
span.attributes['graphql.operation.name'] = span.attributes['graphql.operation.name'];
179+
span.attributes['graphql.operation.type'] = span.attributes['graphql.operation.type'];
179180
// TODO: attributes for error codes
180181
// hive.graphql.error.count
181182
// span.attributes['hive.graphql.error.count'] = 0;

deployment/services/otel-collector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function deployOTELCollector(args: {
2626
HIVE_OTEL_AUTH_ENDPOINT: serviceLocalEndpoint(args.graphql.service).apply(
2727
value => value + '/otel-auth',
2828
),
29-
CLICKHOUSE_PROTOCOL: 'tcp',
29+
CLICKHOUSE_PROTOCOL: 'http',
3030
},
3131
/**
3232
* We are using the healthcheck extension.

docker/docker-compose.community.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ services:
430430
image: '${DOCKER_REGISTRY}otel-collector${DOCKER_TAG}'
431431
environment:
432432
HIVE_OTEL_AUTH_ENDPOINT: 'http://server:3001/otel-auth'
433-
CLICKHOUSE_PROTOCOL: tcp
433+
CLICKHOUSE_PROTOCOL: 'http'
434434
CLICKHOUSE_HOST: clickhouse
435435
CLICKHOUSE_PORT: '8123'
436436
CLICKHOUSE_USERNAME: '${CLICKHOUSE_USER}'

docker/docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ services:
186186
dockerfile: ./../../otel-collector.dockerfile
187187
environment:
188188
HIVE_OTEL_AUTH_ENDPOINT: 'http://host.docker.internal:3001/otel-auth'
189-
CLICKHOUSE_PROTOCOL: tcp
189+
CLICKHOUSE_PROTOCOL: 'http'
190190
CLICKHOUSE_HOST: clickhouse
191191
CLICKHOUSE_PORT: 8123
192192
CLICKHOUSE_USERNAME: test

packages/migrations/src/clickhouse-actions/015-otel-trace.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,25 +165,25 @@ export const action: Action = async exec => {
165165
, "SpanAttributes"['http.url'] AS "http_url"
166166
, "SpanAttributes"['hive.client.name'] AS "client_name"
167167
, "SpanAttributes"['hive.client.version'] AS "client_version"
168-
, "SpanAttributes"['hive.graphql.operation.name'] AS "graphql_operation_name"
169-
, toLowCardinality("SpanAttributes"['hive.graphql.operation.type']) AS "graphql_operation_type"
170-
, "SpanAttributes"['hive.graphql.operation.document'] AS "graphql_operation_document"
168+
, "SpanAttributes"['graphql.operation.name'] AS "graphql_operation_name"
169+
, toLowCardinality("SpanAttributes"['graphql.operation.type']) AS "graphql_operation_type"
170+
, "SpanAttributes"['graphql.operation.document'] AS "graphql_operation_document"
171171
, "SpanAttributes"['hive.graphql.operation.hash'] AS "graphql_operation_hash"
172-
, toInt64OrZero("SpanAttributes"['hive.graphql.error.count']) AS "graphql_error_count"
172+
, toInt64OrZero("SpanAttributes"['hive.graphql.error.count']) AS "graphql_error_count"
173173
, if(
174174
"SpanAttributes"['hive.graphql.error.codes'] = '',
175175
[],
176176
arrayMap(x -> toLowCardinality(x), splitByChar(',', "SpanAttributes"['hive.graphql.error.codes']))
177177
) AS "graphql_error_codes"
178178
, if(
179-
"SpanAttributes"['hive.subgraph.names'] = '',
179+
"SpanAttributes"['hive.gateway.operation.subgraph.names'] = '',
180180
[],
181-
arrayMap(x -> toLowCardinality(x), splitByChar(',', "SpanAttributes"['hive.subgraph.names']))
181+
arrayMap(x -> toLowCardinality(x), splitByChar(',', "SpanAttributes"['hive.gateway.operation.subgraph.names']))
182182
) AS "subgraph_names"
183183
FROM
184184
"otel_traces"
185185
WHERE
186-
empty("ParentSpanId") AND NOT empty("SpanAttributes"['hive.graphql.operation.type'])
186+
empty("ParentSpanId") AND NOT empty("SpanAttributes"['graphql.operation.type'])
187187
)
188188
`);
189189

@@ -253,9 +253,9 @@ export const action: Action = async exec => {
253253
, "SpanAttributes"['http.url'] AS "http_url"
254254
, "SpanAttributes"['hive.client.name'] AS "client_name"
255255
, "SpanAttributes"['hive.client.version'] AS "client_version"
256-
, "SpanAttributes"['hive.graphql.operation.name'] AS "graphql_operation_name"
257-
, toLowCardinality("SpanAttributes"['hive.graphql.operation.type']) AS "graphql_operation_type"
258-
, "SpanAttributes"['hive.graphql.operation.document'] AS "graphql_operation_document"
256+
, "SpanAttributes"['graphql.operation.name'] AS "graphql_operation_name"
257+
, toLowCardinality("SpanAttributes"['graphql.operation.type']) AS "graphql_operation_type"
258+
, "SpanAttributes"['graphql.operation.document'] AS "graphql_operation_document"
259259
, toInt64OrZero("SpanAttributes"['hive.graphql.error.count']) AS "graphql_error_count"
260260
, if(
261261
"SpanAttributes"['hive.graphql.error.codes'] = '',

packages/web/app/src/pages/target-trace.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ function SpanNode(props: SpanNodeProps) {
457457

458458
const isDimmed =
459459
(typeof props.highlightedServiceName === 'string' &&
460-
props.highlightedServiceName !== span.spanAttributes['gateway.upstream.subgraph.name']) ||
460+
props.highlightedServiceName !==
461+
span.spanAttributes['hive.gateway.upstream.subgraph.name']) ||
461462
(activeSpanId && activeSpanId !== span.id) ||
462463
(highlightedEvent && highlightedEvent.spanId !== span.id);
463464

@@ -518,9 +519,9 @@ function SpanNode(props: SpanNodeProps) {
518519
</Badge>
519520
)}
520521
</div>
521-
{span.spanAttributes['gateway.upstream.subgraph.name'] ? (
522+
{span.spanAttributes['hive.gateway.upstream.subgraph.name'] ? (
522523
<div className={cn('truncate text-xs', isDimmed ? 'text-gray-600' : 'text-gray-500')}>
523-
{span.spanAttributes['gateway.upstream.subgraph.name']}
524+
{span.spanAttributes['hive.gateway.upstream.subgraph.name']}
524525
</div>
525526
) : null}
526527
</div>
@@ -686,7 +687,7 @@ function SpanNode(props: SpanNodeProps) {
686687
const uchildSpan = useFragment(SpanFragment, childSpan.span);
687688

688689
const serviceName: string | null =
689-
uchildSpan.spanAttributes['gateway.upstream.subgraph.name'] ??
690+
uchildSpan.spanAttributes['hive.gateway.upstream.subgraph.name'] ??
690691
props.serviceName ??
691692
null;
692693

scripts/seed-traces/sample-introspection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,13 @@
450450
}
451451
},
452452
{
453-
"key": "hive.graphql.operation.type",
453+
"key": "graphql.operation.type",
454454
"value": {
455455
"stringValue": "query"
456456
}
457457
},
458458
{
459-
"key": "hive.graphql.operation.name",
459+
"key": "graphql.operation.name",
460460
"value": {
461461
"stringValue": "IntrospectionQuery"
462462
}

scripts/seed-traces/sample-my-profile.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@
293293
}
294294
},
295295
{
296-
"key": "hive.graphql.operation.name",
296+
"key": "graphql.operation.name",
297297
"value": {
298298
"stringValue": "MyProfile"
299299
}
300300
},
301301
{
302-
"key": "hive.graphql.operation.type",
302+
"key": "graphql.operation.type",
303303
"value": {
304304
"stringValue": "query"
305305
}
@@ -453,13 +453,13 @@
453453
}
454454
},
455455
{
456-
"key": "hive.graphql.operation.name",
456+
"key": "graphql.operation.name",
457457
"value": {
458458
"stringValue": "MyProfile"
459459
}
460460
},
461461
{
462-
"key": "hive.graphql.operation.type",
462+
"key": "graphql.operation.type",
463463
"value": {
464464
"stringValue": "query"
465465
}
@@ -613,13 +613,13 @@
613613
}
614614
},
615615
{
616-
"key": "hive.graphql.operation.name",
616+
"key": "graphql.operation.name",
617617
"value": {
618618
"stringValue": "MyProfile"
619619
}
620620
},
621621
{
622-
"key": "hive.graphql.operation.type",
622+
"key": "graphql.operation.type",
623623
"value": {
624624
"stringValue": "query"
625625
}
@@ -765,19 +765,19 @@
765765
}
766766
},
767767
{
768-
"key": "hive.subgraph.names",
768+
"key": "hive.gateway.operation.subgraph.names",
769769
"value": {
770770
"stringValue": "users,reviews,products"
771771
}
772772
},
773773
{
774-
"key": "hive.graphql.operation.type",
774+
"key": "graphql.operation.type",
775775
"value": {
776776
"stringValue": "query"
777777
}
778778
},
779779
{
780-
"key": "hive.graphql.operation.name",
780+
"key": "graphql.operation.name",
781781
"value": {
782782
"stringValue": "MyProfile"
783783
}

scripts/seed-traces/sample-products-overview.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@
293293
}
294294
},
295295
{
296-
"key": "hive.graphql.operation.name",
296+
"key": "graphql.operation.name",
297297
"value": {
298298
"stringValue": "TopProductsOverview"
299299
}
300300
},
301301
{
302-
"key": "hive.graphql.operation.type",
302+
"key": "graphql.operation.type",
303303
"value": {
304304
"stringValue": "query"
305305
}
@@ -453,13 +453,13 @@
453453
}
454454
},
455455
{
456-
"key": "hive.graphql.operation.name",
456+
"key": "graphql.operation.name",
457457
"value": {
458458
"stringValue": "TopProductsOverview"
459459
}
460460
},
461461
{
462-
"key": "hive.graphql.operation.type",
462+
"key": "graphql.operation.type",
463463
"value": {
464464
"stringValue": "query"
465465
}
@@ -613,13 +613,13 @@
613613
}
614614
},
615615
{
616-
"key": "hive.graphql.operation.name",
616+
"key": "graphql.operation.name",
617617
"value": {
618618
"stringValue": "TopProductsOverview"
619619
}
620620
},
621621
{
622-
"key": "hive.graphql.operation.type",
622+
"key": "graphql.operation.type",
623623
"value": {
624624
"stringValue": "query"
625625
}
@@ -765,19 +765,19 @@
765765
}
766766
},
767767
{
768-
"key": "hive.subgraph.names",
768+
"key": "hive.gateway.operation.subgraph.names",
769769
"value": {
770770
"stringValue": "products,reviews,users"
771771
}
772772
},
773773
{
774-
"key": "hive.graphql.operation.type",
774+
"key": "graphql.operation.type",
775775
"value": {
776776
"stringValue": "query"
777777
}
778778
},
779779
{
780-
"key": "hive.graphql.operation.name",
780+
"key": "graphql.operation.name",
781781
"value": {
782782
"stringValue": "TopProductsOverview"
783783
}

scripts/seed-traces/sample-user-review-error-missing-variables.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@
269269
}
270270
},
271271
{
272-
"key": "hive.graphql.operation.type",
272+
"key": "graphql.operation.type",
273273
"value": {
274274
"stringValue": "query"
275275
}
276276
},
277277
{
278-
"key": "hive.graphql.operation.name",
278+
"key": "graphql.operation.name",
279279
"value": {
280280
"stringValue": "UserReview"
281281
}

0 commit comments

Comments
 (0)