Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .oxlintrc.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"**/nestjs/src/integrations/vendored/**/*.ts",
"**/integrations/tracing/kafka/vendored/**/*.ts",
"**/integrations/tracing/tedious/vendored/**/*.ts",
"**/integrations/tracing/hapi/vendored/**/*.ts",
"**/integrations/tracing/mongoose/vendored/**/*.ts",
"**/integrations/tracing/amqplib/vendored/**/*.ts"
],
Expand Down
1 change: 0 additions & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@opentelemetry/core": "^2.6.1",
"@opentelemetry/instrumentation": "^0.214.0",
"@opentelemetry/instrumentation-graphql": "0.62.0",
"@opentelemetry/instrumentation-hapi": "0.60.0",
"@opentelemetry/instrumentation-http": "0.214.0",
"@opentelemetry/sql-common": "^0.41.2",
"@opentelemetry/instrumentation-pg": "0.66.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/integrations/tracing/hapi/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';
import { HapiInstrumentation } from './vendored/instrumentation';
import type { IntegrationFn, Span } from '@sentry/core';
import {
captureException,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* NOTICE from the Sentry authors:
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi
* - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0
*/
/* eslint-disable */

export enum AttributeNames {
HAPI_TYPE = 'hapi.type',
PLUGIN_NAME = 'hapi.plugin.name',
EXT_TYPE = 'server.ext.type',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Simplified type definitions vendored from @types/hapi__hapi.
* Only includes the types actually accessed by the instrumentation.
*/
/* eslint-disable */

export type ServerOptions = Record<string, any>;

export declare function server(options?: ServerOptions): Server;
export declare function Server(options?: ServerOptions): Server;

export type ServerRequestExtType =
| 'onPreAuth'
| 'onCredentials'
| 'onPostAuth'
| 'onPreHandler'
| 'onPostHandler'
| 'onPreResponse'
| 'onRequest';

export namespace Lifecycle {
export type Method = (request: any, h: any, err?: Error) => ReturnValue;
export type ReturnValue = any;
export type FailAction = 'error' | 'log' | 'ignore' | Method;
}

export interface ServerRoute<T = any> {
path: string;
method: string;
handler?: Lifecycle.Method | T;
options?: ((server: Server) => ServerRouteOptions) | ServerRouteOptions;
[key: string]: any;
}

interface ServerRouteOptions {
handler?: Lifecycle.Method | any;
[key: string]: any;
}

export interface Server {
route: (...args: any[]) => any;
ext: (...args: any[]) => any;
register: (...args: any[]) => any;
[key: string]: any;
}

export interface Plugin<T, _V = void> {
register: (server: Server, options: T) => void | Promise<void>;
name?: string;
pkg?: { name: string; [key: string]: any };
[key: string]: any;
}

export interface PluginNameVersion {
name: string;
[key: string]: any;
}

export interface PluginPackage {
pkg: { name: string; [key: string]: any };
[key: string]: any;
}

export interface ServerRegisterPluginObject<T> {
plugin: Plugin<T, void> | { plugin: Plugin<T, void>; [key: string]: any };
[key: string]: any;
}

export interface ServerRegisterOptions {
[key: string]: any;
}

export interface ServerExtEventsObject {
type: string;
[key: string]: any;
}

export interface ServerExtEventsRequestObject {
type: ServerRequestExtType;
method: Lifecycle.Method;
[key: string]: any;
}

export interface ServerExtOptions {
[key: string]: any;
}
Loading
Loading