Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor open telemetry plugin #328

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/plugins/opentelemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,17 @@
"@graphql-mesh/utils": "^0.103.6",
"@graphql-tools/utils": "^10.6.2",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/context-async-hooks": "^1.29.0",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.56.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.56.0",
"@opentelemetry/exporter-zipkin": "^1.29.0",
"@opentelemetry/instrumentation": "^0.56.0",
"@opentelemetry/instrumentation-dns": "^0.42.0",
"@opentelemetry/instrumentation-grpc": "^0.56.0",
"@opentelemetry/instrumentation-http": "^0.56.0",
"@opentelemetry/resources": "^1.29.0",
"@opentelemetry/sdk-trace-base": "^1.29.0",
"@opentelemetry/sdk-trace-node": "^1.29.0",
"@opentelemetry/sdk-trace-web": "^1.29.0",
"@opentelemetry/semantic-conventions": "^1.28.0",
"@whatwg-node/disposablestack": "^0.0.5",
Expand Down
30 changes: 4 additions & 26 deletions packages/plugins/opentelemetry/src/attributes.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
// HTTP/network attributes
export {
SEMATTRS_HTTP_CLIENT_IP,
SEMATTRS_HTTP_HOST,
SEMATTRS_HTTP_METHOD,
SEMATTRS_HTTP_ROUTE,
SEMATTRS_HTTP_SCHEME,
SEMATTRS_HTTP_SERVER_NAME,
SEMATTRS_HTTP_STATUS_CODE,
SEMATTRS_HTTP_URL,
SEMATTRS_HTTP_USER_AGENT,
SEMATTRS_NET_HOST_NAME,
ATTR_SERVICE_NAME as SEMRESATTRS_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} from '@opentelemetry/semantic-conventions';

// GraphQL-specific attributes
// Based on https://opentelemetry.io/docs/specs/semconv/attributes-registry/graphql/
export const SEMATTRS_GRAPHQL_DOCUMENT = 'graphql.document';
export const SEMATTRS_GRAPHQL_OPERATION_TYPE = 'graphql.operation.type';
export const SEMATTRS_GRAPHQL_OPERATION_NAME = 'graphql.operation.name';
export const SEMATTRS_GRAPHQL_ERROR_COUNT = 'graphql.error.count';

// Gateway-specific attributes
export const SEMATTRS_GATEWAY_UPSTREAM_SUBGRAPH_NAME =
'gateway.upstream.subgraph.name';
export const ATTR_GRAPHQL_ERROR_COUNT = "graphql.errors.count"
export const ATTR_GRAPHQL_DOCUMENT = "graphql.document"
export const ATTR_GRAPHQL_OPERATION_NAME = "graphql.operation.name"
export const ATTR_GRAPHQL_OPERATION_TYPE = "graphql.operation.type"
1 change: 0 additions & 1 deletion packages/plugins/opentelemetry/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './processors';
export {
useOpenTelemetry,
type OpenTelemetryGatewayPluginOptions as OpenTelemetryMeshPluginOptions,
Expand Down
Loading
Loading