Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @opentelemetry/instrumentation-http

Index

Type aliases

Func

Func<T>: (...args: any[]) => T

Type parameters

  • T

Type declaration

    • (...args: any[]): T
    • Parameters

      • Rest ...args: any[]

      Returns T

GetFunction

GetFunction: typeof get

Http

Http: typeof http

HttpCallback

HttpCallback: (res: IncomingMessage) => void

Type declaration

    • (res: IncomingMessage): void
    • Parameters

      • res: IncomingMessage

      Returns void

HttpCallbackOptional

HttpCallbackOptional: HttpCallback | undefined

HttpRequestArgs

HttpRequestArgs: (HttpCallbackOptional | RequestSignature)[]

Https

Https: typeof https

IgnoreMatcher

IgnoreMatcher: string | RegExp | ((url: string) => boolean)

ParsedRequestOptions

ParsedRequestOptions: (http.RequestOptions & Partial<url.UrlWithParsedQuery>) | http.RequestOptions

RequestFunction

RequestFunction: typeof request

RequestSignature

RequestSignature: [http.RequestOptions, HttpCallbackOptional] & HttpCallback

ResponseEndArgs

ResponseEndArgs: [() => void?] | [unknown, () => void?] | [unknown, string, () => void?]

Functions

Const getAbsoluteUrl

  • getAbsoluteUrl(requestUrl: null | ParsedRequestOptions, headers: IncomingHttpHeaders | OutgoingHttpHeaders, fallbackProtocol?: string): string

Const getAttributesFromHttpKind

  • getAttributesFromHttpKind(kind?: string): SpanAttributes

Const getIncomingRequestAttributes

  • getIncomingRequestAttributes(request: IncomingMessage, options: { component: string; hookAttributes?: SpanAttributes; serverName?: string }): SpanAttributes
  • Returns incoming request attributes scoped to the request data

    Parameters

    • request: IncomingMessage

      the request object

    • options: { component: string; hookAttributes?: SpanAttributes; serverName?: string }

      used to pass data needed to create attributes

      • component: string
      • Optional hookAttributes?: SpanAttributes
      • Optional serverName?: string

    Returns SpanAttributes

Const getIncomingRequestAttributesOnResponse

  • getIncomingRequestAttributesOnResponse(request: IncomingMessage, response: ServerResponse): SpanAttributes

Const getOutgoingRequestAttributes

  • getOutgoingRequestAttributes(requestOptions: ParsedRequestOptions, options: { component: string; hookAttributes?: SpanAttributes; hostname: string }): SpanAttributes
  • Returns outgoing request attributes scoped to the options passed to the request

    Parameters

    • requestOptions: ParsedRequestOptions

      the same options used to make the request

    • options: { component: string; hookAttributes?: SpanAttributes; hostname: string }

      used to pass data needed to create attributes

      • component: string
      • Optional hookAttributes?: SpanAttributes
      • hostname: string

    Returns SpanAttributes

Const getOutgoingRequestAttributesOnResponse

  • getOutgoingRequestAttributesOnResponse(response: IncomingMessage, options: { hostname: string }): SpanAttributes
  • Returns outgoing request attributes scoped to the response data

    Parameters

    • response: IncomingMessage

      the response object

    • options: { hostname: string }

      used to pass data needed to create attributes

      • hostname: string

    Returns SpanAttributes

Const getRequestInfo

  • getRequestInfo(options: string | RequestOptions | URL, extraOptions?: RequestOptions): { method: string; optionsParsed: RequestOptions; origin: string; pathname: string }
  • Makes sure options is an url object return an object with default value and parsed options

    Parameters

    • options: string | RequestOptions | URL

      original options for the request

    • Optional extraOptions: RequestOptions

    Returns { method: string; optionsParsed: RequestOptions; origin: string; pathname: string }

    • method: string
    • optionsParsed: RequestOptions
    • origin: string
    • pathname: string

Const hasExpectHeader

  • hasExpectHeader(options: RequestOptions): boolean

Const isCompressed

  • isCompressed(headers: IncomingHttpHeaders | OutgoingHttpHeaders): boolean

Const isIgnored

  • isIgnored(constant: string, list?: IgnoreMatcher[], onException?: (error: Error) => void): boolean
  • Check whether the given request is ignored by configuration It will not re-throw exceptions from list provided by the client

    Parameters

    • constant: string

      e.g URL of request

    • Optional list: IgnoreMatcher[]
    • Optional onException: (error: Error) => void
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns boolean

Const isValidOptionsType

  • isValidOptionsType(options: unknown): boolean

Const parseResponseStatus

  • parseResponseStatus(statusCode: undefined | number): Omit<SpanStatus, "message">

Const satisfiesPattern

  • satisfiesPattern(constant: string, pattern: IgnoreMatcher): boolean

Const setRequestContentLengthAttribute

  • setRequestContentLengthAttribute(request: IncomingMessage, attributes: SpanAttributes): void

Const setResponseContentLengthAttribute

  • setResponseContentLengthAttribute(response: IncomingMessage, attributes: SpanAttributes): void

Const setSpanWithError

  • setSpanWithError(span: Span, error: Err, obj?: ClientRequest | IncomingMessage): void

Generated using TypeDoc