Skip to content

Commit

Permalink
chore(deps): upgrade @types/koa__router dependency (#1670)
Browse files Browse the repository at this point in the history
* move type to dev dependencies

* chore(deps): upgrade @types/koa__router dependency

* move types to internal-types

* fix formatting

* formatting

* Revert "formatting"

This reverts commit b348406.

* Revert "fix formatting"

This reverts commit 7c60446.

* Revert "move types to internal-types"

This reverts commit 0eea745.

* moving KoaMiddleware to internal-types

* fix formatting

* fix formatting

* fix formatting

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
  • Loading branch information
pauloprestes and blumamir authored Sep 25, 2023
1 parent f64fddf commit 76dd559
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@opentelemetry/instrumentation": "^0.43.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"@types/koa": "2.13.8",
"@types/koa__router": "8.0.11"
"@types/koa__router": "12.0.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-koa#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ import {
} from '@opentelemetry/instrumentation';

import type * as koa from 'koa';
import {
KoaMiddleware,
KoaContext,
KoaLayerType,
KoaInstrumentationConfig,
} from './types';
import { KoaContext, KoaLayerType, KoaInstrumentationConfig } from './types';
import { VERSION } from './version';
import { getMiddlewareMetadata, isLayerIgnored } from './utils';
import { getRPCMetadata, RPCType } from '@opentelemetry/core';
import { kLayerPatched, KoaPatchedMiddleware } from './internal-types';
import {
kLayerPatched,
KoaMiddleware,
KoaPatchedMiddleware,
} from './internal-types';

/** Koa instrumentation for OpenTelemetry */
export class KoaInstrumentation extends InstrumentationBase<typeof koa> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { KoaMiddleware } from './types';
import type { Middleware, DefaultState } from 'koa';
import { KoaContext } from './types';
import type * as Router from '@koa/router';

export type KoaMiddleware = Middleware<DefaultState, KoaContext> & {
router?: Router;
};

/**
* This symbol is used to mark a Koa layer as being already instrumented
Expand Down
5 changes: 0 additions & 5 deletions plugins/node/opentelemetry-instrumentation-koa/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
import type { Middleware, ParameterizedContext, DefaultState } from 'koa';
import type { RouterParamContext } from '@koa/router';
import type * as Router from '@koa/router';
import { Span } from '@opentelemetry/api';
import { InstrumentationConfig } from '@opentelemetry/instrumentation';

Expand All @@ -26,10 +25,6 @@ export enum KoaLayerType {

export type KoaContext = ParameterizedContext<DefaultState, RouterParamContext>;

export type KoaMiddleware = Middleware<DefaultState, KoaContext> & {
router?: Router;
};

export type KoaRequestInfo = {
context: KoaContext;
middlewareLayer: Middleware<DefaultState, KoaContext>;
Expand Down
8 changes: 2 additions & 6 deletions plugins/node/opentelemetry-instrumentation-koa/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
KoaContext,
KoaMiddleware,
KoaLayerType,
KoaInstrumentationConfig,
} from './types';
import { KoaContext, KoaLayerType, KoaInstrumentationConfig } from './types';
import { KoaMiddleware } from './internal-types';
import { AttributeNames } from './enums/AttributeNames';
import { SpanAttributes } from '@opentelemetry/api';
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
Expand Down

0 comments on commit 76dd559

Please sign in to comment.